Professional Documents
Culture Documents
http://www.LearnNowOnline.com
Objectives
Learn to use basic shapes: lines, ellipses, rectangles, and polygons Add line caps and joins Work with geometries and paths Investigate the geometry mini-language
Agenda
Working with Shapes Digging Deeper: Using Paths and Geometries
single Path
Paths vs Geometries?
Why both paths and geometries?
Geometry defines a single shape Coordinates and properties Doesnt draw the shape Path can group shapes Allows you to draw the shape(s)
DEMO
SimpleGeometries
DEMO
GeometryGroup
PathFigure Properties
IsClosed: Determines if first and last segments are connected IsFilled: Determines if contained area should be filled using brush in Path.Fill Segments: Collection of segments that define the shape; collection of PathSegment objects StartPoint: Determines the starting point for PathFigure
Learn More @ http://www.learnnowonline.com
Copyright by Application Developers Training Company
Segment Types
ArcSegment BezierSegment, PolyBezierSegment QuadraticBezierSegment, PolyQuadraticBezierSegment LineSegment, PolyLineSegment
PathGeometry Markup
<Path > PathGeometry element<Path.Data> <PathGeometry> generally looks like <PathFigure > this: <LineSegment
DEMO
PathGeometryLines
DEMO
PathGeometryArcs
control point)
Not as flexible, but easier to define and calculate
point
Learn More @ http://www.learnnowonline.com
Copyright by Application Developers Training Company
Important Tip
Don't create Bezier curves by trial and error Use a tool that helps generate XAML for you
Expression Blend!
DEMO
PathGeometryCurves
Geometry Mini-Language
Imagine scenario with lots of shapes Tons of markup! To reduce markup, can use mini markup language that describes geometry
Called Geometry mini-language or Path mini-
language
Geometry Mini-Language
Converts from this:
To this:
Learn More @ http://www.learnnowonline.com
Copyright by Application Developers Training Company
Geometry Mini-Language
For full description:
http://msdn.microsoft.com/en-
us/library/ms752293.aspx
DEMO
GeometryMiniLanguage
Questions?
http://www.LearnNowOnline.com