"clip" property of View
The "clip" property (Clip constant) of the ClipShape type specifies the crop area.There are 4 types of crop areas
inset
Rectangular cropping area. Created with the function:
func InsetClip(top, right, bottom, left SizeUnit, radius RadiusProperty) ClipShape
where top, right, bottom, left are the distance from respectively the top, right, bottom and left borders of the Viewto the cropping border of the same name; radius - sets the radii of the corners of the cropping area(see the description of the RadiusProperty type above). If there should be no rounding of corners, then nil must be passed as radius
The textual description of the rectangular cropping area is in the following format
inset{ top =, right = , bottom = , left = , [radius = ] } }
circle
Round cropping area. Created with the function:
func CircleClip(x, y, radius SizeUnit) ClipShape
where x, y - coordinates of the center of the circle; radius - radius
The textual description of the circular cropping area is in the following format
circle{ x =, y = , radius = }
ellipse
Elliptical cropping area. Created with the function:
func EllipseClip(x, y, rx, ry SizeUnit) ClipShape
where x, y - coordinates of the center of the ellipse; rх - radius of the ellipse along the X axis; ry is the radius of the ellipse along the Y axis.
The textual description of the elliptical clipping region is in the following format
ellipse{ x =, y = , radius-x = , radius-y = }
polygon
Polygonal cropping area. Created using functions:
func PolygonClip(points []any) ClipShape func PolygonPointsClip(points []SizeUnit) ClipShape
an array of corner points of the polygon is passed as an argument in the following order: x1, y1, x2, y2, …The elements of the argument to the PolygonClip function can be either text constants,or the text representation of SizeUnit, or elements of type SizeUnit.
The textual description of the polygonal cropping area is in the following format
polygon{ points = ", , , ,…" }