Professional Documents
Culture Documents
Rakesh VM
IBU| NeST |Technopark
1
2 7/29/2019
2D Graphics.
Asynchronous Programming
and Multithreading
Performance Profiling
GDI VS WPF
Feature Windows Forms (using GDI/GDI+) WPF
System.dll WindowsBase.dll
DLLs used System.Drawing.dll PresentationCore.dll
System.Windows.Forms.dll PresentationFoundation.dll
Windows Many windows One window
7/29/2019 3
4 7/29/2019
2D Graphics
(0,0) is top
left of
coordinate
space
5 7/29/2019
2D Graphics
2D Graphics
Brushes
Drawings
Geometries
Images
Shapes
6 7/29/2019
Brushes
Brush
Geometry
LineGeo
metry
Geometry
Rectangl
EllipseGe
eGeome
ometry
try
10 7/29/2019
Shape
Shape
Ellipse
Line
Path
Polygon
Polyline
Rectangle.
11 7/29/2019
The coordinates
can be specified
relative to any
side of the panel.
Canvas.Left,
Canvas.Top,
Canvas.Bottom
and Canvas.Right
are attached
properties
12 7/29/2019
Canvas.
Images.
Geometries.
Shapes.
Brushes.
WPF Performance Concerns
13
14 7/29/2019
UI Software
Virtualization Rendering
Resource Freezable
Performance
Optimizations
15 7/29/2019
UI Virtualization
•VirtualizingStackPanel.
Enable IsVirtualizing="True“
virtualization •VirtualizingStackPanel.
VirtualizationMode="Rec
containers •ScrollViewer.
IsDeferredScrollingEnabl
ed="True“.
16 7/29/2019
WPF defines
three tiers
0 = No hardware
acceleration.
DirectX version
level < 7.0
1 = Partial
hardware
acceleration.
DirectX version
level [7.0, 9.0)
2 = Most features
use hardware
acceleration.
DirectX version
level >= 9.0
18 7/29/2019
Demo
19 7/29/2019
A WPF object When unfrozen the object behaves like any other object
that has a
frozen and
an unfrozen When frozen the object cannot be modified
state.
When the object is frozen the WPF graphics system no longer needs to
spend resources monitoring the object for changes.
Opt-out of
change
notifications
Examples Brush
Transform
Geometry
20 7/29/2019
Freezables
Software
Rendering
Rendering
Tiers
Resource
Performance
UI Optimizations
Virtualization
21 7/29/2019
•Invoke
The Dispatcher •BeginInvoke
Freeze Freezables.
Backgroundworker
DoWork ()
•Start execution in different
thread.
•Don’t update the UI Controls
CancelAsync() ProgressChanged ()
•Request thread cancellation. •Event that can use for updating the
•CancellationPending Flag used to UI
determine the thread is stop
requested
RunWorkerCompleted ()
•On completion of thread execution
24 7/29/2019
Performance Memory
profiler profiler
25 7/29/2019
WPF
4.5
26 7/29/2019
Ribbon control
Reference
http://msdn.microsoft.com/en-us/library/bb613588(v=vs.110).aspx
http://msdn.microsoft.com/en-us/library/ms754130.aspx
http://msdn.microsoft.com/en-us/library/aa970683.aspx
28 7/29/2019
For queries:-
rakesh.vm@nestgroup.net
7/29/2019
IBU| NeST |Technopark
29