RectangleGeometry Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Describes a two-dimensional rectangular geometry.
Equivalent WinUI class: Microsoft.UI.Xaml.Media.RectangleGeometry.
public ref class RectangleGeometry sealed : Geometry
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class RectangleGeometry final : Geometry
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class RectangleGeometry final : Geometry
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class RectangleGeometry : Geometry
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class RectangleGeometry : Geometry
Public NotInheritable Class RectangleGeometry
Inherits Geometry
<RectangleGeometry .../>
- Inheritance
- Attributes
Windows requirements
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
Examples
This example shows how to create and render a RectangleGeometry object. The position and dimensions of the rectangle are defined by a Rect property value, provided as an attribute. The position is (50,50) and the height and width are both 25, which creates a square.
<Canvas>
<Path Fill="LemonChiffon" Stroke="Red" StrokeThickness="3">
<Path.Data>
<RectangleGeometry Rect="50,50,25,25" />
</Path.Data>
</Path>
</Canvas>
Constructors
RectangleGeometry() |
Initializes a new instance of the RectangleGeometry class and creates a rectangle with zero area. |
Properties
Bounds |
Gets a Rect that specifies the axis-aligned bounding box of the Geometry. Equivalent WinUI property: Microsoft.UI.Xaml.Media.Geometry.Bounds. (Inherited from Geometry) |
Dispatcher |
Gets the CoreDispatcher that this object is associated with. The CoreDispatcher represents a facility that can access the DependencyObject on the UI thread even if the code is initiated by a non-UI thread. Equivalent WinUI property: Microsoft.UI.Xaml.DependencyObject.Dispatcher. (Inherited from DependencyObject) |
Rect |
Gets or sets the dimensions of the rectangle. Equivalent WinUI property: Microsoft.UI.Xaml.Media.RectangleGeometry.Rect. |
RectProperty |
Identifies the Rect dependency property. Equivalent WinUI property: Microsoft.UI.Xaml.Media.RectangleGeometry.RectProperty. |
Transform |
Gets or sets the Transform object applied to a Geometry. Equivalent WinUI property: Microsoft.UI.Xaml.Media.Geometry.Transform. (Inherited from Geometry) |
Methods
Applies to
See also
Feedback
Submit and view feedback for