Now we can move onto how to create custom shapes using Path and Data property of Path element.

Path class is used to draw Curves and complex shapes. it describes using Geometry object.There are a various types of Geometry objects describes shpaes are LineGeometry, RectangleGeometry, and EllipseGeometry.

Data attribute in path is used to create complex shapes. it has following commands.

Commands

M :- Move command establishes a start point for the path.The capital M indicates an absolute location for the new current point. A lowercase m would indicate relative coordinates.

L :- Line command creates a straight line between the current point and the specified end point.

H :- Horizontal Line command creates a horizontal line between the current point and the specified x-coordinate.

V :-Vertical Line command creates a vertical line between the current point and the specified y-coordinate.

C :- Curve command creates a cubic Bezier curve between the current point and the specified end point by using the two specified control points. Syntex : CcontrolPoint1controlPoint2endPoint A :- Arc commandcreates an elliptical arc between the current point and the specified end point.Syntex : Asize(x-radius, y-radius)rotationAngleisLargeArcFlagsweepDirectionFlagendPoint Example : A 10,5 180 0 1 100,0

Z :- Close command ends the current figure and creates a line that connects the current point to the starting point of the figure.

UIElement.Clip Property takes a Geometry type like (LineGeometry, RectangleGeometry, EllipseGeometry etc.) Clip Property is used to define the outline of the contents of a UIElement by get/set the Geometry. It display some area of region by setting outline of region.

No comments:

Post a Comment

Followers

About Me

Having Total 5 + years of Experience in Microsoft.Net Technology.
Currently working in WPF, Silverlight and Windows Phone 8.
Today in Software Development field it is hard to learn all the thing but also it is necessary to update or refresh your knowledge which upgrade each and every day.
I have now just share my knowledge through this way.