SlideShare una empresa de Scribd logo
2 D and  3 D Graphics and Animations ,[object Object],[object Object],[object Object],[object Object],[object Object],WPF  Graphics and Animations
Table of Contents (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Introduction to WPF  Graphics
Introduction to WPF  Graphics ,[object Object],[object Object],[object Object],[object Object]
WPF  Graphics – Example <DockPanel> <StackPanel DockPanel.Dock=&quot;Top&quot; Orientation=&quot;Horizontal&quot;> <TextBlock Text=&quot;Mix text, &quot; /> <Ellipse Fill=&quot;red&quot; Width=&quot;40&quot; /> <TextBlock Text=&quot; and &quot; /> <Button>Controls</Button> </StackPanel> <Ellipse DockPanel.Dock=&quot;Left&quot; Fill=&quot;Yellow&quot; Width=&quot;100&quot; /> <Button DockPanel.Dock=&quot;Left&quot;>z</Button> <TextBlock FontSize=&quot;24&quot; TextWrapping=&quot;Wrap&quot;> And of course you can put graphics into your text: <Ellipse Fill=&quot;Cyan&quot; Width=&quot;50&quot; Height=&quot;20&quot; /> </TextBlock> </DockPanel>
Introduction to WPF  Graphics Live Demo
WPF  Drawing Model
WPF  Drawing Model ,[object Object],[object Object],[object Object],[object Object],[object Object]
WPF  Drawing Model –Example <Canvas x:Name=&quot;MainCanvas&quot; MouseLeftButtonDown= &quot;mainCanvas_MouseLeftButtonDown&quot;> <Rectangle Canvas.Left=&quot;10&quot; Canvas.Top=&quot;30&quot; Fill=&quot;Indigo&quot; Width=&quot;40&quot; Height=&quot;20&quot; /> <Rectangle Canvas.Left=&quot;20&quot; Canvas.Top=&quot;40&quot; Fill=&quot;Yellow&quot; Width=&quot;40&quot; Height=&quot;20&quot; /> <Rectangle Canvas.Left=&quot;30&quot; Canvas.Top=&quot;50&quot; Fill=&quot;Orange&quot; Width=&quot;40&quot; Height=&quot;20&quot; /> </Canvas> private void MainCanvas_MouseLeftButtonDown (object sender, RoutedEventArgs e) { Rectangle r = e.Source as Rectangle; if (r != null) {  r.Width += 10;  } }
WPF  Drawing Model Live Demo
Resolution Independence, Scaling and Rotation
Resolution Independence ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Resolution Independence (2) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Scaling and Rotation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scaling and Rotation (2) ,[object Object],[object Object],[object Object],<Button> <Button.LayoutTransform> <ScaleTransform ScaleX=&quot;2&quot; ScaleY=&quot;2&quot; /> </Button.LayoutTransform> ...  <!--The result is--> </Button>  <!--without scaling-->  <!--with scaling-->
Basic Graphical Objects
Shapes, Brushes, and Pens ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Shapes, Brushes, and Pens (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Shapes, Brushes, and Pens (3) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Basic WPF Shapes
Base Shape Class Properties ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Rectangle ,[object Object],[object Object],[object Object],<Canvas> <Rectangle Fill=&quot;Yellow&quot; Stroke=&quot;Black&quot; Canvas.Left=&quot;30&quot; Canvas.Top=&quot;10&quot; Width=&quot;100&quot; Height=&quot;20&quot; /> </Canvas>
Rectangle (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Ellipse ,[object Object],[object Object],<Ellipse Width=&quot;100&quot; Height=&quot;50&quot; Fill=&quot;Yellow&quot; Stroke=&quot;Black&quot; /> <!--The result is-->
Line ,[object Object],[object Object],[object Object],<StackPanel Orientation=&quot;Vertical&quot;> <TextBlock Background=&quot;LightGray&quot;>Foo</TextBlock> <Line Stroke=&quot;Green&quot; X1=&quot;20&quot; Y1=&quot;10&quot; X2=&quot;100&quot; Y2=&quot;40&quot; /> <TextBlock Background=&quot;LightGray&quot;>Bar</TextBlock> <Line Stroke=&quot;Green&quot; X1=&quot;0&quot; Y1=&quot;10&quot; X2=&quot;100&quot; Y2=&quot;0&quot; /> </StackPanel>
Ellipses and Lines Live Demo
Polyline ,[object Object],[object Object],[object Object],<Polyline Stroke=&quot;Blue&quot; Points=&quot;0,30 10,30 15,0 18,60 23,30 35,30 40,0 43,60 48,30 160,30&quot; /> <!--The result is-->
Polygon ,[object Object],[object Object],[object Object],<Polyline Fill=&quot;Orange&quot; Stroke=&quot;Blue&quot; StrokeThickness=&quot;2&quot; Points=&quot;40,10 70,50 10,50&quot;  /> <Polygon Fill=&quot;Orange&quot; Stroke=&quot;Blue&quot; StrokeThickness=&quot;2&quot; Points=&quot;40,10 70,50 10,50&quot;  /> <!--The result is-->
Polygon (2) ,[object Object],[object Object],[object Object],[object Object],<Polygon Fill=&quot;Orange&quot; Stroke=&quot;Blue&quot; StrokeThickness=&quot;2&quot; FillRule=&quot;Nonzero&quot; Points=&quot;10,10 60,10 60,25 20,25 20,40 40,40 40,18 50,18 50,50 10,50&quot; />  <!--The result is-->
Path ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Path (2) ,[object Object],[object Object],<Canvas> <Path Fill=&quot;Cyan&quot; Stroke=&quot;Black&quot;> <Path.Data> <GeometryGroup> <EllipseGeometry Center=&quot;20, 40&quot; RadiusX=&quot;20&quot; RadiusY=&quot;40&quot; /> <EllipseGeometry Center=&quot;20, 40&quot; RadiusX=&quot;10&quot; RadiusY=&quot;30&quot; /> </GeometryGroup> </Path.Data>  <!--The result is-->  </Path> </Canvas>
Path Live Demo
Path (3) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Arc Segment – Example <Path Fill=&quot;Cyan&quot; Stroke=&quot;Black&quot;> <Path.Data> <PathGeometry> <PathFigure StartPoint=&quot;0,11&quot; IsClosed=&quot;True&quot;> <ArcSegment Point=&quot;50,61&quot; Size=&quot;70,30&quot; SweepDirection=&quot;Counterclockwise&quot; /> </PathFigure> <PathFigure StartPoint=&quot;30,11&quot; IsClosed=&quot;True&quot;> <ArcSegment Point=&quot;80,61&quot; Size=&quot;70,30&quot; SweepDirection=&quot;Clockwise&quot; IsLargeArc=&quot;True&quot; /> </PathFigure> </PathGeometry>  <!--The result is-->  </Path.Data> </Path>
ArcSegment Live Demo
Bitmaps, Images and Effects
Image ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],<Image Source=&quot;http://www.interact-sw.co.uk/images/M3/BackOfM3.jpeg&quot; /> <Image Source=&quot;/MyFunnyImage.jpeg&quot; />
Image  (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],<Image Source=&quot;/MyFunnyImage.jpeg&quot; Stretch=&quot;Fill&quot; Opacity=&quot;0.5&quot; />
ImageSource ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Creating Bitmaps ,[object Object],[object Object],RenderTargetBitmap bmp =  new RenderTargetBitmap(300,150,300,300, PixelFormats.Pbgra32); Ellipse e = new Ellipse(); e.Fill = Brushes.Green; e.Measure(new Size(96, 48)); e.Arrange(new Rect(0, 0, 96, 48)); bmp.Render(e);  <!-- The result is -->
Creating Bitmaps  (2) ,[object Object],[object Object],[object Object]
Bitmap Effects ,[object Object],[object Object],[object Object],<StackPanel Orientation=&quot;Horizontal&quot;> <StackPanel Orientation=&quot;Vertical&quot;> <TextBlock Text=&quot;Normal Text&quot;  TextAlignment=&quot;Center&quot; FontWeight=&quot;Bold&quot; /> <RadioButton Content=&quot;Better in position 1?&quot; GroupName=&quot;r&quot; /> </StackPanel> <!--The example continues-->
Bitmap Effects (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],<StackPanel Orientation=&quot;Vertical&quot; Margin=&quot;10,0&quot;> <StackPanel.BitmapEffect> <BlurBitmapEffect Radius=&quot;3&quot; /> </StackPanel.BitmapEffect> <TextBlock Text=&quot;Blurred Text&quot; TextAlignment=&quot;Center&quot; FontWeight=&quot;Bold&quot; /> <RadioButton Content=&quot;Or position 2?&quot; GroupName=&quot;r&quot; /> </StackPanel> </StackPanel>
Bitmap Effects Live Demo
Brushes and  P ens
SolidColorBrush ,[object Object],[object Object],[object Object],[object Object],[object Object],<Rectangle Fill=&quot;Yellow&quot; Width=&quot;100&quot; Height=&quot;20&quot; />
LinearGradientBrush ,[object Object],[object Object],[object Object],[object Object]
LinearGradientBrush  (2) ,[object Object],[object Object],<Rectangle Width=&quot;80&quot; Height=&quot;60&quot;> <Rectangle.Fill> <LinearGradientBrush StartPoint=&quot;0,0&quot; EndPoint=&quot;1,1&quot;> <GradientStop Color=&quot;Blue&quot; Offset=&quot;0&quot; /> <GradientStop Color=&quot;White&quot; Offset=&quot;1&quot; /> </LinearGradientBrush>  <!--The result is-->  </Rectangle.Fill> </Rectangle>
ImageBrush ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
ImageBrush  (2) ,[object Object],[object Object],[object Object],[object Object],[object Object]
ImageBrush Live Demo
Pen ,[object Object],[object Object],[object Object],[object Object],[object Object],<Rectangle Stroke=&quot;Black&quot; StrokeThickness=&quot;5&quot; StrokeDashArray=&quot;10 1 3 1&quot; /> <Rectangle Stroke=&quot;Black&quot; StrokeThickness=&quot;5&quot; StrokeDashArray=&quot;6 1 6&quot; />
Transformations
Transform Classes ,[object Object],[object Object],[object Object],<Button Width=&quot;180&quot; Height=&quot;60&quot; Canvas.Left=&quot;100&quot; Canvas.Top=&quot;100&quot;>I'm rotated 35 degrees <Button.RenderTransform> <RotateTransform Angle=&quot;35&quot;  CenterX=&quot;45&quot; CenterY=&quot;5&quot; /> </Button.RenderTransform> </Button>
Transform Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Transformations Live Demo
XAML-Based A nimation
A nimation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Animation – Example <Canvas> <Ellipse Width=&quot;200&quot; Height=&quot;150&quot; Fill=&quot;Orange&quot; x:Name=&quot;AnimatedEllipse&quot;> <Ellipse.Triggers> <EventTrigger RoutedEvent=&quot;Ellipse.Loaded&quot;> <BeginStoryboard><Storyboard> <DoubleAnimation Storyboard.TargetName=&quot;AnimatedEllipse&quot; Storyboard.TargetProperty=&quot;(Canvas.Left)&quot; From=&quot;-50&quot; To=&quot;300&quot; Duration=&quot;00:00:0.88&quot; AutoReverse=&quot;True&quot; RepeatBehavior=&quot;Forever&quot; /> </Storyboard></BeginStoryboard> </EventTrigger> </Ellipse.Triggers> </Ellipse> </Canvas>
A nimation Live Demo
WPF Graphics and Animations ,[object Object]
Exercises ,[object Object],[object Object],[object Object],[object Object],[object Object]
Exercises (2) ,[object Object],[object Object],[object Object]
Exercises (3) ,[object Object],[object Object],[object Object]
Exercises ,[object Object],[object Object],[object Object],[object Object],[object Object]
Exercises (2) ,[object Object],[object Object],[object Object]
Exercises (3) ,[object Object],[object Object]

Más contenido relacionado

La actualidad más candente

A fresh look at graphical editing
A fresh look at graphical editingA fresh look at graphical editing
A fresh look at graphical editingDr. Jan Köhnlein
 
2011 10-24-initiatives-tracker-launch-v1.0
2011 10-24-initiatives-tracker-launch-v1.02011 10-24-initiatives-tracker-launch-v1.0
2011 10-24-initiatives-tracker-launch-v1.0tommyoneill
 
Basic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in JavaBasic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in Javasuraj pandey
 
java-Unit4 chap2- awt controls and layout managers of applet
java-Unit4 chap2- awt controls and layout managers of appletjava-Unit4 chap2- awt controls and layout managers of applet
java-Unit4 chap2- awt controls and layout managers of appletraksharao
 
VISUAL BASIC 6 - CONTROLS AND DECLARATIONS
VISUAL BASIC 6 - CONTROLS AND DECLARATIONSVISUAL BASIC 6 - CONTROLS AND DECLARATIONS
VISUAL BASIC 6 - CONTROLS AND DECLARATIONSSuraj Kumar
 
Refactoring: A First Example - Martin Fowler’s First Example of Refactoring, ...
Refactoring: A First Example - Martin Fowler’s First Example of Refactoring, ...Refactoring: A First Example - Martin Fowler’s First Example of Refactoring, ...
Refactoring: A First Example - Martin Fowler’s First Example of Refactoring, ...Philip Schwarz
 
The AWT and Swing
The AWT and SwingThe AWT and Swing
The AWT and Swingadil raja
 
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2Philip Schwarz
 
Applets - lev' 2
Applets - lev' 2Applets - lev' 2
Applets - lev' 2Rakesh T
 
Dr. Rajeshree Khande :Introduction to Java AWT
Dr. Rajeshree Khande :Introduction to Java AWTDr. Rajeshree Khande :Introduction to Java AWT
Dr. Rajeshree Khande :Introduction to Java AWTDrRajeshreeKhande
 
Java awt tutorial javatpoint
Java awt tutorial   javatpointJava awt tutorial   javatpoint
Java awt tutorial javatpointRicardo Garcia
 

La actualidad más candente (20)

A fresh look at graphical editing
A fresh look at graphical editingA fresh look at graphical editing
A fresh look at graphical editing
 
2011 10-24-initiatives-tracker-launch-v1.0
2011 10-24-initiatives-tracker-launch-v1.02011 10-24-initiatives-tracker-launch-v1.0
2011 10-24-initiatives-tracker-launch-v1.0
 
GUI programming
GUI programmingGUI programming
GUI programming
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
 
Basic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in JavaBasic of Abstract Window Toolkit(AWT) in Java
Basic of Abstract Window Toolkit(AWT) in Java
 
Awt
AwtAwt
Awt
 
java-Unit4 chap2- awt controls and layout managers of applet
java-Unit4 chap2- awt controls and layout managers of appletjava-Unit4 chap2- awt controls and layout managers of applet
java-Unit4 chap2- awt controls and layout managers of applet
 
28 awt
28 awt28 awt
28 awt
 
VISUAL BASIC 6 - CONTROLS AND DECLARATIONS
VISUAL BASIC 6 - CONTROLS AND DECLARATIONSVISUAL BASIC 6 - CONTROLS AND DECLARATIONS
VISUAL BASIC 6 - CONTROLS AND DECLARATIONS
 
Refactoring: A First Example - Martin Fowler’s First Example of Refactoring, ...
Refactoring: A First Example - Martin Fowler’s First Example of Refactoring, ...Refactoring: A First Example - Martin Fowler’s First Example of Refactoring, ...
Refactoring: A First Example - Martin Fowler’s First Example of Refactoring, ...
 
The AWT and Swing
The AWT and SwingThe AWT and Swing
The AWT and Swing
 
Awt components
Awt componentsAwt components
Awt components
 
Java swing
Java swingJava swing
Java swing
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
 
Java awt
Java awtJava awt
Java awt
 
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2
Scala 3 by Example - Algebraic Data Types for Domain Driven Design - Part 2
 
Applets - lev' 2
Applets - lev' 2Applets - lev' 2
Applets - lev' 2
 
Dr. Rajeshree Khande :Introduction to Java AWT
Dr. Rajeshree Khande :Introduction to Java AWTDr. Rajeshree Khande :Introduction to Java AWT
Dr. Rajeshree Khande :Introduction to Java AWT
 
Java awt tutorial javatpoint
Java awt tutorial   javatpointJava awt tutorial   javatpoint
Java awt tutorial javatpoint
 
Gui
GuiGui
Gui
 

Similar a WPF Graphics and Animations

Cleveland Silverlight Firestarter - XAML Basics
Cleveland Silverlight Firestarter - XAML BasicsCleveland Silverlight Firestarter - XAML Basics
Cleveland Silverlight Firestarter - XAML BasicsSarah Dutkiewicz
 
Building real-time collaborative apps with Ajax.org Platform
Building real-time collaborative apps with Ajax.org PlatformBuilding real-time collaborative apps with Ajax.org Platform
Building real-time collaborative apps with Ajax.org PlatformJaveline B.V.
 
Client Side Programming with Applet
Client Side Programming with AppletClient Side Programming with Applet
Client Side Programming with Appletbackdoor
 
Svg Overview And Js Libraries
Svg Overview And Js LibrariesSvg Overview And Js Libraries
Svg Overview And Js Librariesseamusjr
 
ma project
ma projectma project
ma projectAisu
 
Displaying information within a window.68
Displaying information within a window.68Displaying information within a window.68
Displaying information within a window.68myrajendra
 
ImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlaggingImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlaggingSuite Solutions
 
What is Web Designing by Zakaria
What is Web Designing by ZakariaWhat is Web Designing by Zakaria
What is Web Designing by ZakariaZakaria Abada
 
Flex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 FinalFlex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 Finalematrix
 
Kml Basics Chpt 2 Placemarks
Kml Basics Chpt  2   PlacemarksKml Basics Chpt  2   Placemarks
Kml Basics Chpt 2 Placemarkstcooper66
 
Google Earth Tutorials Part III
Google Earth Tutorials Part IIIGoogle Earth Tutorials Part III
Google Earth Tutorials Part IIItcooper66
 
SDN Mentor Hands On - Exercise 2
SDN Mentor Hands On - Exercise 2SDN Mentor Hands On - Exercise 2
SDN Mentor Hands On - Exercise 2dan_mcweeney
 
Introduction to programming c and data-structures
Introduction to programming c and data-structures Introduction to programming c and data-structures
Introduction to programming c and data-structures Pradipta Mishra
 

Similar a WPF Graphics and Animations (20)

Cleveland Silverlight Firestarter - XAML Basics
Cleveland Silverlight Firestarter - XAML BasicsCleveland Silverlight Firestarter - XAML Basics
Cleveland Silverlight Firestarter - XAML Basics
 
Building real-time collaborative apps with Ajax.org Platform
Building real-time collaborative apps with Ajax.org PlatformBuilding real-time collaborative apps with Ajax.org Platform
Building real-time collaborative apps with Ajax.org Platform
 
Client Side Programming with Applet
Client Side Programming with AppletClient Side Programming with Applet
Client Side Programming with Applet
 
Svg Overview And Js Libraries
Svg Overview And Js LibrariesSvg Overview And Js Libraries
Svg Overview And Js Libraries
 
Wpf Workgroup 3
Wpf Workgroup 3Wpf Workgroup 3
Wpf Workgroup 3
 
ma project
ma projectma project
ma project
 
Chap22
Chap22Chap22
Chap22
 
Displaying information within a window.68
Displaying information within a window.68Displaying information within a window.68
Displaying information within a window.68
 
ImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlaggingImplementingChangeTrackingAndFlagging
ImplementingChangeTrackingAndFlagging
 
Presentation wpf
Presentation wpfPresentation wpf
Presentation wpf
 
What is Web Designing by Zakaria
What is Web Designing by ZakariaWhat is Web Designing by Zakaria
What is Web Designing by Zakaria
 
Flex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 FinalFlex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 Final
 
Kml Basics Chpt 2 Placemarks
Kml Basics Chpt  2   PlacemarksKml Basics Chpt  2   Placemarks
Kml Basics Chpt 2 Placemarks
 
C programming
C programmingC programming
C programming
 
Google Earth Tutorials Part III
Google Earth Tutorials Part IIIGoogle Earth Tutorials Part III
Google Earth Tutorials Part III
 
HTML5 Fundamentals
HTML5 FundamentalsHTML5 Fundamentals
HTML5 Fundamentals
 
Autocad 2007
Autocad 2007Autocad 2007
Autocad 2007
 
SDN Mentor Hands On - Exercise 2
SDN Mentor Hands On - Exercise 2SDN Mentor Hands On - Exercise 2
SDN Mentor Hands On - Exercise 2
 
Uk Media Center User Group April 2009
Uk Media Center User Group   April 2009Uk Media Center User Group   April 2009
Uk Media Center User Group April 2009
 
Introduction to programming c and data-structures
Introduction to programming c and data-structures Introduction to programming c and data-structures
Introduction to programming c and data-structures
 

Más de Doncho Minkov

Más de Doncho Minkov (20)

Web Design Concepts
Web Design ConceptsWeb Design Concepts
Web Design Concepts
 
Web design Tools
Web design ToolsWeb design Tools
Web design Tools
 
HTML 5
HTML 5HTML 5
HTML 5
 
HTML 5 Tables and Forms
HTML 5 Tables and FormsHTML 5 Tables and Forms
HTML 5 Tables and Forms
 
CSS Overview
CSS OverviewCSS Overview
CSS Overview
 
CSS Presentation
CSS PresentationCSS Presentation
CSS Presentation
 
CSS Layout
CSS LayoutCSS Layout
CSS Layout
 
CSS 3
CSS 3CSS 3
CSS 3
 
Adobe Photoshop
Adobe PhotoshopAdobe Photoshop
Adobe Photoshop
 
Slice and Dice
Slice and DiceSlice and Dice
Slice and Dice
 
Introduction to XAML and WPF
Introduction to XAML and WPFIntroduction to XAML and WPF
Introduction to XAML and WPF
 
WPF Templating and Styling
WPF Templating and StylingWPF Templating and Styling
WPF Templating and Styling
 
Simple Data Binding
Simple Data BindingSimple Data Binding
Simple Data Binding
 
Complex Data Binding
Complex Data BindingComplex Data Binding
Complex Data Binding
 
WPF Concepts
WPF ConceptsWPF Concepts
WPF Concepts
 
Model View ViewModel
Model View ViewModelModel View ViewModel
Model View ViewModel
 
WPF and Databases
WPF and DatabasesWPF and Databases
WPF and Databases
 
Introduction to Cross-platform Mobile Development Course
Introduction to Cross-platform Mobile Development CourseIntroduction to Cross-platform Mobile Development Course
Introduction to Cross-platform Mobile Development Course
 
HTML Fundamentals
HTML FundamentalsHTML Fundamentals
HTML Fundamentals
 
Tables and Forms in HTML
Tables and Forms in HTMLTables and Forms in HTML
Tables and Forms in HTML
 

Último

Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKUXDXConf
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupCatarinaPereira64715
 
Intelligent Gimbal FINAL PAPER Engineering.pdf
Intelligent Gimbal FINAL PAPER Engineering.pdfIntelligent Gimbal FINAL PAPER Engineering.pdf
Intelligent Gimbal FINAL PAPER Engineering.pdfAnthony Lucente
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfChristopherTHyatt
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationZilliz
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsUXDXConf
 
Server-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at PricelineServer-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at PricelineUXDXConf
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsExpeed Software
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀DianaGray10
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 

Último (20)

Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAK
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Intelligent Gimbal FINAL PAPER Engineering.pdf
Intelligent Gimbal FINAL PAPER Engineering.pdfIntelligent Gimbal FINAL PAPER Engineering.pdf
Intelligent Gimbal FINAL PAPER Engineering.pdf
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Server-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at PricelineServer-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at Priceline
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 

WPF Graphics and Animations

  • 1.
  • 2.
  • 4.
  • 5. WPF Graphics – Example <DockPanel> <StackPanel DockPanel.Dock=&quot;Top&quot; Orientation=&quot;Horizontal&quot;> <TextBlock Text=&quot;Mix text, &quot; /> <Ellipse Fill=&quot;red&quot; Width=&quot;40&quot; /> <TextBlock Text=&quot; and &quot; /> <Button>Controls</Button> </StackPanel> <Ellipse DockPanel.Dock=&quot;Left&quot; Fill=&quot;Yellow&quot; Width=&quot;100&quot; /> <Button DockPanel.Dock=&quot;Left&quot;>z</Button> <TextBlock FontSize=&quot;24&quot; TextWrapping=&quot;Wrap&quot;> And of course you can put graphics into your text: <Ellipse Fill=&quot;Cyan&quot; Width=&quot;50&quot; Height=&quot;20&quot; /> </TextBlock> </DockPanel>
  • 6. Introduction to WPF Graphics Live Demo
  • 7. WPF Drawing Model
  • 8.
  • 9. WPF Drawing Model –Example <Canvas x:Name=&quot;MainCanvas&quot; MouseLeftButtonDown= &quot;mainCanvas_MouseLeftButtonDown&quot;> <Rectangle Canvas.Left=&quot;10&quot; Canvas.Top=&quot;30&quot; Fill=&quot;Indigo&quot; Width=&quot;40&quot; Height=&quot;20&quot; /> <Rectangle Canvas.Left=&quot;20&quot; Canvas.Top=&quot;40&quot; Fill=&quot;Yellow&quot; Width=&quot;40&quot; Height=&quot;20&quot; /> <Rectangle Canvas.Left=&quot;30&quot; Canvas.Top=&quot;50&quot; Fill=&quot;Orange&quot; Width=&quot;40&quot; Height=&quot;20&quot; /> </Canvas> private void MainCanvas_MouseLeftButtonDown (object sender, RoutedEventArgs e) { Rectangle r = e.Source as Rectangle; if (r != null) { r.Width += 10; } }
  • 10. WPF Drawing Model Live Demo
  • 12.
  • 13.
  • 14.
  • 15.
  • 17.
  • 18.
  • 19.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. Ellipses and Lines Live Demo
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 33.
  • 34. Arc Segment – Example <Path Fill=&quot;Cyan&quot; Stroke=&quot;Black&quot;> <Path.Data> <PathGeometry> <PathFigure StartPoint=&quot;0,11&quot; IsClosed=&quot;True&quot;> <ArcSegment Point=&quot;50,61&quot; Size=&quot;70,30&quot; SweepDirection=&quot;Counterclockwise&quot; /> </PathFigure> <PathFigure StartPoint=&quot;30,11&quot; IsClosed=&quot;True&quot;> <ArcSegment Point=&quot;80,61&quot; Size=&quot;70,30&quot; SweepDirection=&quot;Clockwise&quot; IsLargeArc=&quot;True&quot; /> </PathFigure> </PathGeometry> <!--The result is--> </Path.Data> </Path>
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 45. Brushes and P ens
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 52.
  • 54.
  • 55.
  • 58.
  • 59. Animation – Example <Canvas> <Ellipse Width=&quot;200&quot; Height=&quot;150&quot; Fill=&quot;Orange&quot; x:Name=&quot;AnimatedEllipse&quot;> <Ellipse.Triggers> <EventTrigger RoutedEvent=&quot;Ellipse.Loaded&quot;> <BeginStoryboard><Storyboard> <DoubleAnimation Storyboard.TargetName=&quot;AnimatedEllipse&quot; Storyboard.TargetProperty=&quot;(Canvas.Left)&quot; From=&quot;-50&quot; To=&quot;300&quot; Duration=&quot;00:00:0.88&quot; AutoReverse=&quot;True&quot; RepeatBehavior=&quot;Forever&quot; /> </Storyboard></BeginStoryboard> </EventTrigger> </Ellipse.Triggers> </Ellipse> </Canvas>
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.

Notas del editor

  1. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  2. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  3. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  4. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  5. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  6. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  7. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  8. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  9. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  10. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  11. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  12. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  13. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  14. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  15. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  16. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  17. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  18. * (c) 2008 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  19. * (c) 2008 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  20. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  21. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  22. * (c) 2008 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  23. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##
  24. * 02/25/12 07/16/96 (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.* ##