SlideShare uma empresa Scribd logo
1 de 67
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]

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante 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
 

Semelhante 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
 
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
 
Datatable Y Column
Datatable Y ColumnDatatable Y Column
Datatable Y Column
 

Mais de Doncho Minkov

Mais 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

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 

Último (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

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 do 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.* ##