автор: Фелицата 08.04.2017 Комментарии: 6
In this form, the Path. The most common reason for doing this is because you want to use one or more of the curves and complex shapes that can be defined as Segments values for a PathFigure , for example BezierSegment. Add line1 ; Polyline A Polyline is similar to a Polygon in that the boundary of the shape is defined by a set of points, except the last point in a Polyline is not connected to the first point.
Path A Path is the most versatile Shape because you can use it to define an arbitrary geometry. The next example shows a usage of the other technique we discussed:
On the other hand, Path. FromArgb , , , ; path1. The next example creates a Rectangle with a Width of and a Height of
You can set the Data property to a single Geometry object. This Data begins with the move command, indicated by "M", which establishes an absolute start point for the path.
As with a Polygon , the Points property defines the collection of points that make up the boundary. This can be done in code or in XAML.
This can be done in code or in XAML. For more info about brushes, see Using brushes.
A Stroke also requires a Brush that defines its appearance, and should have a non-zero value for StrokeThickness. Notice that the first and last points are not connected by the Stroke outline as they are in a Polygon. Rectangle A Rectangle is a four-sided shape with its opposite sides being equal.
Point , ; polygon1. These properties specify the x-axis and y-axis of an ellipse that defines the curve of the corners.
Data value is consuming a serialization format for graphics. We set the RadiusX property to 50 and the RadiusY property to 10, which gives the Rectangle rounded corners.
You can set the Data property to a single Geometry object. This example shows a Path that might have resulted from using Blend for Visual Studio to produce just a few vector shapes and then saving the result as XAML.
You could then use a TranslateTransform to move the entire Line, if you wanted it to start at a point other than 0,0. Add pathFigure1 ; pathGeometry1. You define the geometry of a path with the Data property.