Geometry Class

Definition

Classes that derive from this abstract base class define geometric shapes. Geometry objects can be used for clipping, hit-testing, and rendering 2-D graphic data.

[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.GeometryConverter))]
[System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)]
public abstract class Geometry : System.Windows.Media.Animation.Animatable, IFormattable
Inheritance
Derived
Attributes
Implements

Remarks

Geometry Compared to Shape

The System.Windows.Shapes.Shape class has a Fill, Stroke, and other rendering properties that Geometry and its derived classes lack. The Shape class is a FrameworkElement and therefore participates in the layout system; its derived classes can be used as the content of any element that supports UIElement children.

The Geometry class, on the other hand, simply defines the geometry of a shape, and cannot render itself. Because of its simplicity, it has a wider range of uses.

Freezable Features: Because it inherits from the Freezable class, the Geometry class provides several special features: Geometry objects can be declared as , shared among multiple objects, made read-only to improve performance, cloned, and made thread-safe. For more information about the different features provided by Freezable objects, see Freezable Objects Overview.

Notes to Inheritors

Although this class is abstract, it is not publicly extensible.

Fields

TransformProperty

Identifies the Transform dependency property.

Properties

Bounds

Gets a Rect that specifies the axis-aligned bounding box of the Geometry.

Empty

Gets an empty object.

StandardFlatteningTolerance

Gets the standard tolerance used for polygonal approximation.

Transform

Gets or sets the Transform object applied to a Geometry.

Methods

Clone()

Creates a modifiable clone of the Geometry, making deep copies of the object's values. When copying dependency properties, this method copies resource references and data bindings (but they might no longer resolve) but not animations or their current values.

CloneCurrentValue()

Creates a modifiable clone of the Geometry object, making deep copies of the object's current values. Resource references, data bindings, and animations are not copied, but their current values are.

Combine(Geometry, Geometry, GeometryCombineMode, Transform)

Combines the two geometries using the specified GeometryCombineMode and applies the specified transform to the resulting geometry.

Combine(Geometry, Geometry, GeometryCombineMode, Transform, Double, ToleranceType)

Combines the two geometries using the specified GeometryCombineMode and tolerance factor, and applies the specified transform to the resulting geometry.

FillContains(Geometry)

Indicates whether the current geometry completely contains the specified Geometry.

FillContains(Point)

Indicates whether the geometry contains the specified Point.

FillContains(Geometry, Double, ToleranceType)

Indicates whether the current geometry contains the specified Geometry, given the specified margin of error.

FillContains(Point, Double, ToleranceType)

Indicates whether the geometry contains the specified Point, given the specified margin of error.

FillContainsWithDetail(Geometry)

Returns a value that describes the intersection between the current geometry and the specified geometry.

FillContainsWithDetail(Geometry, Double, ToleranceType)

Returns a value that describes the intersection between the current geometry and the specified geometry, given the specified margin of error.

GetArea()

Gets the area of the filled region of the Geometry object.

GetArea(Double, ToleranceType)

Gets the area, within the specified tolerance, of the filled region of the Geometry object.

GetFlattenedPathGeometry()

Gets a PathGeometry that is a polygonal approximation of the Geometry object.

GetFlattenedPathGeometry(Double, ToleranceType)

Gets a PathGeometry, within the specified tolerance, that is a polygonal approximation of the Geometry object.

GetOutlinedPathGeometry(Double, ToleranceType)

Gets a PathGeometry, within the specified tolerance, that is a simplified outline of the filled region of the Geometry.

GetOutlinedPathGeometry()

Gets a PathGeometry that is a simplified outline of the filled region of the Geometry.

GetRenderBounds(Pen)

Returns an axis-aligned rectangle that is exactly large enough to contain the geometry after it has been outlined with the specified Pen.

GetRenderBounds(Pen, Double, ToleranceType)

Returns an axis-aligned rectangle that is exactly large enough to contain the geometry after it has been outlined with the specified Pen, given the specified tolerance factor.

GetWidenedPathGeometry(Pen)

Gets a PathGeometry that is the shape defined by the stroke on the Geometry produced by the specified Pen.

GetWidenedPathGeometry(Pen, Double, ToleranceType)

Gets a PathGeometry that is the shape defined by the stroke on the Geometry produced by the specified Pen, given the specified tolerance factor.

IsEmpty()

Determines whether the object is empty.

MayHaveCurves()

Determines whether the object might have curved segments.

Parse(String)

Creates a new Geometry instance from the specified string using the current culture.

ShouldSerializeTransform()

Gets a value that indicates whether the value of the Transform property should be serialized.

StrokeContains(Pen, Point)

Determines whether the specified Point is contained in the stroke produced by applying the specified Pen to the geometry.

StrokeContains(Pen, Point, Double, ToleranceType)

Determines whether the specified Point is contained in the stroke produced by applying the specified Pen to the geometry, given the specified margin of error.

StrokeContainsWithDetail(Pen, Geometry)

Returns a value that describes the intersection between the specified Geometry and the stroke created by applying the specified Pen to the current geometry.

StrokeContainsWithDetail(Pen, Geometry, Double, ToleranceType)

Gets a value that describes the intersection between the specified Geometry and the stroke created by applying the specified Pen to the current geometry, given the specified margin of error.

ToString(IFormatProvider)

Creates a string representation of the object using the specified culture-specific formatting information.

ToString()

Creates a string representation of the object based on the current culture.

Equals(Object, Object) Inherited from Object
GetType() Inherited from Object
MemberwiseClone() Inherited from Object
ReferenceEquals(Object, Object) Inherited from Object
ClearValue(DependencyProperty) Inherited from DependencyObject
ClearValue(DependencyPropertyKey) Inherited from DependencyObject
CoerceValue(DependencyProperty) Inherited from DependencyObject
DependencyObjectType Inherited from DependencyObject
Equals(Object) Inherited from DependencyObject
GetHashCode() Inherited from DependencyObject
GetLocalValueEnumerator() Inherited from DependencyObject
GetValue(DependencyProperty) Inherited from DependencyObject
InvalidateProperty(DependencyProperty) Inherited from DependencyObject
IsSealed Inherited from DependencyObject
ReadLocalValue(DependencyProperty) Inherited from DependencyObject
SetCurrentValue(DependencyProperty, Object) Inherited from DependencyObject
SetValue(DependencyProperty, Object) Inherited from DependencyObject
SetValue(DependencyPropertyKey, Object) Inherited from DependencyObject
ShouldSerializeProperty(DependencyProperty) Inherited from DependencyObject
CanFreeze Inherited from Freezable
Changed Inherited from Freezable
CloneCore(Freezable) Inherited from Freezable
CloneCurrentValueCore(Freezable) Inherited from Freezable
CreateInstance() Inherited from Freezable
CreateInstanceCore() Inherited from Freezable
Freeze() Inherited from Freezable
Freeze(Freezable, Boolean) Inherited from Freezable
GetAsFrozen() Inherited from Freezable
GetAsFrozenCore(Freezable) Inherited from Freezable
GetCurrentValueAsFrozen() Inherited from Freezable
GetCurrentValueAsFrozenCore(Freezable) Inherited from Freezable
IsFrozen Inherited from Freezable
OnChanged() Inherited from Freezable
OnFreezablePropertyChanged(DependencyObject, DependencyObject) Inherited from Freezable
OnFreezablePropertyChanged(DependencyObject, DependencyObject, DependencyProperty) Inherited from Freezable
OnPropertyChanged(DependencyPropertyChangedEventArgs) Inherited from Freezable
ReadPreamble() Inherited from Freezable
WritePostscript() Inherited from Freezable
WritePreamble() Inherited from Freezable
ApplyAnimationClock(DependencyProperty, AnimationClock) Inherited from Animatable
ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior) Inherited from Animatable
BeginAnimation(DependencyProperty, AnimationTimeline) Inherited from Animatable
BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior) Inherited from Animatable
FreezeCore(Boolean) Inherited from Animatable
GetAnimationBaseValue(DependencyProperty) Inherited from Animatable
HasAnimatedProperties Inherited from Animatable
ShouldSerializeStoredWeakReference(DependencyObject) Inherited from Animatable
CheckAccess() Inherited from DispatcherObject
Dispatcher Inherited from DispatcherObject
VerifyAccess() Inherited from DispatcherObject

Explicit Interface Implementations

IFormattable.ToString(String, IFormatProvider)

Formats the value of the current instance using the specified format.

Applies to