Professional virtual currency information station welcome
We have been making efforts.

Examples Of Properties, Creation Methods And Points Property Settings Of The Polygon Class In NET MAUI

Browse examples

The .NET Multi-platform App UI (.NET MAUI) Polygon class is derived from the Shape class and can be used to draw polygons, which are closed shapes formed by a series of connected lines. For information about the properties that the Polygon class inherits from the Shape class, see Shapes.

Polygon defines the following properties:

These properties are backed by BindableProperty objects; that is, they can be the target of data binding and can be styled.

The PointsCollection type is an ObservableCollection of Point objects. The Point structure defines X and Y properties of type double, which represent pairs of x and y coordinates in two-dimensional space. Therefore, the Points property should be set to a list of x- and y-coordinate pairs that describe the polygon's vertices, separated by a comma and/or one or more spaces. For example, "40,10 70,80" and "40 10, 70 80" are both valid.

For more information about the FillRule enumeration, see Fill Rules.

Create polygon

To draw a polygon, create a Polygon object and set its Points property to the shape's vertices. A line is automatically drawn connecting the first and last points. To draw inside a polygon, set its properties to a Brush-derived object. To outline a polygon, set its properties to a Brush derived object. Property specifies the thickness of the polygon outline. For more information about the Brush object, see Brushes.

The following XAML example demonstrates how to draw a filled polygon:


In this example, a filled polygon representing a triangle is drawn:

The following XAML example demonstrates how to draw a dashed polygon:


In this example, the polygon outline is dashed:

For more information on drawing dashed polygons, see.

The following XAML example shows a polygon using default fill rules:


In this example, the filling behavior of each polygon is determined using filling rules.

.NET MAUI Polygon class property_polygon_Draw polygon vertex coordinates

The following XAML example shows a polygon using fill rules:


polygon_.NET MAUI Polygon class property_Draw polygon vertex coordinates

In this example, the filling behavior of each polygon is determined using filling rules.

Like(0) 打赏
未经允许不得转载:Lijin Finance » Examples Of Properties, Creation Methods And Points Property Settings Of The Polygon Class In NET MAUI

评论 Get first!

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

Sign In

Forgot Password

Sign Up