автор: Исай 27.07.2017 Комментарии: 10
You define the geometry of a path with the Data property. Point , ; polygon1.
But with this versatility comes complexity. You can round the corners of a Rectangle. You can set the Data property to a single Geometry object.
To create a basic Rectangle, specify a Width , a Height , and a Fill. Using PathGeometry may be more readable than populating a Path. The example is mainly intended to give you some examples of what elements exist in the Path.
That single Geometry is typically a GeometryGroup , which acts as a container that can composite multiple geometry definitions into a single object for purposes of the object model. PathFigure and the various elements that can be a segment in PathFigure. Add pathSegment2 ; pathFigure1.
Instead, you use design tools that enable you to work in a design or drawing metaphor on a surface. The maximum allowed value of RadiusX is the Width divided by two and the maximum allowed value of RadiusY is the Height divided by two. Point 50, 50 ; pathFigureCollection1.
Add pathFigure1 ; pathGeometry1. As with a Polygon , the Points property defines the collection of points that make up the boundary.
Add rectangleGeometry1 ; geometryGroup1. This example creates a Polyline with four points set to 10, , 60, , , , and ,
A Stroke also requires a Brush that defines its appearance, and should have a non-zero value for StrokeThickness. Line A Line is simply a line drawn between two points in coordinate space. Add pathFigure1 ; pathGeometry1.
The second segment begins with an absolute horizontal line command "H", which specifies a line drawn from the preceding subpath endpoint , to a new endpoint , 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.
Path A Path is the most versatile Shape because you can use it to define an arbitrary geometry. We set the RadiusX property to 50 and the RadiusY property to 10, which gives the Rectangle rounded corners.