автор: Ника 12.06.2017 Комментарии: 4
On the other hand, Path. Add pathGeometry1 ; path1. The next example creates a Polygon with 4 points set to 10, , 60, , , , and ,
You can set the Data property to a single Geometry object. But with this versatility comes complexity.
There are two techniques for setting Data: Shapes namespace , Windows. Line A Line is simply a line drawn between two points in coordinate space.
This example creates a Polyline with four points set to 10, , 60, , , , and , The main difference between these classes is that a Shape has a brush associated with it and can be rendered to the screen, and a Geometry simply defines a region of space and is not rendered unless it helps contribute information to another UI property.
This segment is indicated by the "C" command in the Data attribute string. The main difference between these classes is that a Shape has a brush associated with it and can be rendered to the screen, and a Geometry simply defines a region of space and is not rendered unless it helps contribute information to another UI property.
Notice that the first and last points are not connected by the Stroke outline as they are in a Polygon. Shapes namespace , Windows. Set the Fill property of the Shape to the Brush you want.
A Line ignores any value provided for Fill , because it has no interior space. Point , ; polyline1. On the other hand, a Rectangle is probably a better choice for control composition.
The next example shows a usage of the other technique we discussed: We set the RadiusX property to 50 and the RadiusY property to 10, which gives the Rectangle rounded corners.
If you specify a Fill of a Polyline , the Fill paints the interior space of the shape, even if the start point and end point of the Points set for the Polyline do not intersect. Add pathGeometry1 ; path1.
The rendering logic for a Polygon assumes that you are defining a closed shape and will connect the end point to the start point implicitly. To create a basic Rectangle, specify a Width , a Height , and a Fill. This example exercises some of the contributing geometry types that can be used as part of a PathGeometry: