RectangleGeometry class

Applies to Windows and Windows Phone

Describes a two-dimensional rectangular geometry.

Inheritance

Object
  DependencyObject
    Geometry
      RectangleGeometry

Syntax


public sealed class RectangleGeometry : Geometry


<RectangleGeometry .../>

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The RectangleGeometry class has these types of members:

Constructors

The RectangleGeometry class has these constructors.

ConstructorDescription
RectangleGeometry Initializes a new instance of the RectangleGeometry class and creates a rectangle with zero area.

 

Methods

The RectangleGeometry class has these methods. It also inherits methods from the Object class.

MethodDescription
ClearValue Clears the local value of a dependency property. (Inherited from DependencyObject)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject)
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject)
SetValue Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject)

 

Properties

The RectangleGeometry class has these properties.

PropertyAccess typeDescription

Bounds

Read-onlyGets a Rect that specifies the axis-aligned bounding box of the Geometry. (Inherited from Geometry)

Dispatcher

Read-onlyGets the CoreDispatcher that this object is associated with. (Inherited from DependencyObject)

Rect

Read/writeGets or sets the dimensions of the rectangle.

RectProperty

Read-onlyIdentifies the Rect dependency property.

Transform

Read/writeGets or sets the Transform object applied to a Geometry. (Inherited from Geometry)

 

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>


Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Media
Windows::UI::Xaml::Media [C++]

Metadata

Windows.winmd

See also

Geometry

 

 

Show:
© 2014 Microsoft