Geometry 类
定义
public ref class Geometry abstract : System::Windows::Media::Animation::Animatable, IFormattable
[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
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Media.GeometryConverter))>]
[<System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)>]
type Geometry = class
inherit Animatable
interface IFormattable
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Media.GeometryConverter))>]
[<System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)>]
type Geometry = class
inherit Animatable
interface IFormattable
interface DUCE.IResource
Public MustInherit Class Geometry
Inherits Animatable
Implements IFormattable
- 继承
- 派生
- 属性
- 实现
注解
相对于形状的几何图形Geometry Compared to Shape
System.Windows.Shapes.Shape类具有、和 Fill Stroke Geometry 其派生类缺少的其他呈现属性。The System.Windows.Shapes.Shape class has a Fill, Stroke, and other rendering properties that Geometry and its derived classes lack. Shape类是 FrameworkElement ,因此参与布局系统; 其派生类可用作支持子级的任何元素的内容 UIElement 。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.
Geometry另一方面,类只定义形状的几何图形,而不能呈现自身。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 类,因此 Geometry 该类提供若干特殊功能: Geometry 对象可以声明为资源、在多个对象之间共享、变为只读以提高性能、克隆以及使线程安全。Freezable Features: Because it inherits from the Freezable class, the Geometry class provides several special features: Geometry objects can be declared as resources, shared among multiple objects, made read-only to improve performance, cloned, and made thread-safe. 有关对象提供的不同功能的详细信息 Freezable ,请参阅可冻结对象概述。For more information about the different features provided by Freezable objects, see Freezable Objects Overview.
实施者说明
尽管此类是抽象的,但它不是公开可扩展的。Although this class is abstract, it is not publicly extensible.
字段
TransformProperty |
标识 Transform 依赖项属性。Identifies the Transform dependency property. |
属性
Bounds |
获取一个 Rect,后者指定 Geometry 的与坐标轴对齐的边界框。Gets a Rect that specifies the axis-aligned bounding box of the Geometry. |
CanFreeze |
获取一个值,该值指示是否可将对象变为不可修改。Gets a value that indicates whether the object can be made unmodifiable. (继承自 Freezable) |
DependencyObjectType |
获取对此实例的 CLRCLR 类型进行包装的 DependencyObjectType。Gets the DependencyObjectType that wraps the CLRCLR type of this instance. (继承自 DependencyObject) |
Dispatcher |
获取与此 Dispatcher 关联的 DispatcherObject。Gets the Dispatcher this DispatcherObject is associated with. (继承自 DispatcherObject) |
Empty |
获取一个空对象。Gets an empty object. |
HasAnimatedProperties |
获取一个值,该值指示一个或多个 AnimationClock 对象是否与此对象的任何依赖项属性相关联。Gets a value that indicates whether one or more AnimationClock objects is associated with any of this object's dependency properties. (继承自 Animatable) |
IsFrozen |
获取一个值,该值指示对象当前是否可修改。Gets a value that indicates whether the object is currently modifiable. (继承自 Freezable) |
IsSealed |
获取一个值,该值指示此实例当前是否为密封的(只读)。Gets a value that indicates whether this instance is currently sealed (read-only). (继承自 DependencyObject) |
StandardFlatteningTolerance |
获取用于多边形近似的标准公差。Gets the standard tolerance used for polygonal approximation. |
Transform |
获取或设置应用于 Transform 的 Geometry 对象。Gets or sets the Transform object applied to a Geometry. |
方法
ApplyAnimationClock(DependencyProperty, AnimationClock) |
将 AnimationClock 应用到指定的 DependencyProperty。Applies an AnimationClock to the specified DependencyProperty. 如果该属性已进行动画处理,则使用 SnapshotAndReplace 切换行为。If the property is already animated, the SnapshotAndReplace handoff behavior is used. (继承自 Animatable) |
ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior) |
将 AnimationClock 应用到指定的 DependencyProperty。Applies an AnimationClock to the specified DependencyProperty. 如果该属性已进行动画处理,则使用指定的 HandoffBehavior。If the property is already animated, the specified HandoffBehavior is used. (继承自 Animatable) |
BeginAnimation(DependencyProperty, AnimationTimeline) |
将动画应用于指定 DependencyProperty。Applies an animation to the specified DependencyProperty. 动画会在呈现下一帧时启动。The animation is started when the next frame is rendered. 如果指定属性已进行动画处理,则使用 SnapshotAndReplace 切换行为。If the specified property is already animated, the SnapshotAndReplace handoff behavior is used. (继承自 Animatable) |
BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior) |
将动画应用于指定 DependencyProperty。Applies an animation to the specified DependencyProperty. 动画会在呈现下一帧时启动。The animation is started when the next frame is rendered. 如果指定的属性已进行动画处理,则使用指定的 HandoffBehavior。If the specified property is already animated, the specified HandoffBehavior is used. (继承自 Animatable) |
CheckAccess() |
确定调用线程是否可以访问此 DispatcherObject。Determines whether the calling thread has access to this DispatcherObject. (继承自 DispatcherObject) |
ClearValue(DependencyProperty) |
清除属性的本地值。Clears the local value of a property. 要清除的属性由 DependencyProperty 标识符指定。The property to be cleared is specified by a DependencyProperty identifier. (继承自 DependencyObject) |
ClearValue(DependencyPropertyKey) |
清除只读属性的本地值。Clears the local value of a read-only property. 要清除的属性由 DependencyPropertyKey 指定。The property to be cleared is specified by a DependencyPropertyKey. (继承自 DependencyObject) |
Clone() |
创建 Geometry 的可修改克隆,以制作该对象值的深层副本。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. |
CloneCore(Freezable) |
使用基(未经过动画处理的)属性值使该实例成为指定 Freezable 的克隆(深层复制)。Makes the instance a clone (deep copy) of the specified Freezable using base (non-animated) property values. (继承自 Freezable) |
CloneCurrentValue() |
创建 Geometry 对象的一个可修改复本,从而制作该对象的当前值的深层副本。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. |
CloneCurrentValueCore(Freezable) |
使用当前属性值使该实例成为指定 Freezable 的可修改克隆(深层复制)。Makes the instance a modifiable clone (deep copy) of the specified Freezable using current property values. (继承自 Freezable) |
CoerceValue(DependencyProperty) |
对指定依赖属性的值进行强制。Coerces the value of the specified dependency property. 通过对调用方 DependencyObject 上存在的依赖属性的属性元数据中所指定的任何 CoerceValueCallback 函数进行调用来完成此操作。This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject. (继承自 DependencyObject) |
Combine(Geometry, Geometry, GeometryCombineMode, Transform) |
使用指定的 GeometryCombineMode 合并两个几何图形,并对生成的几何图形应用指定的转换。Combines the two geometries using the specified GeometryCombineMode and applies the specified transform to the resulting geometry. |
Combine(Geometry, Geometry, GeometryCombineMode, Transform, Double, ToleranceType) |
使用指定的 GeometryCombineMode 和公差因子合并两个几何图形,并对生成的几何图形应用指定的转换。Combines the two geometries using the specified GeometryCombineMode and tolerance factor, and applies the specified transform to the resulting geometry. |
CreateInstance() |
初始化 Freezable 类的新实例。Initializes a new instance of the Freezable class. (继承自 Freezable) |
CreateInstanceCore() |
在派生类中实现时,创建 Freezable 派生类的新实例。When implemented in a derived class, creates a new instance of the Freezable derived class. (继承自 Freezable) |
Equals(Object) |
确定提供的 DependencyObject 是否等效于当前 DependencyObject。Determines whether a provided DependencyObject is equivalent to the current DependencyObject. (继承自 DependencyObject) |
FillContains(Geometry) |
指示当前几何图形是否完全包含指定的 Geometry。Indicates whether the current geometry completely contains the specified Geometry. |
FillContains(Geometry, Double, ToleranceType) |
在给出指定的误差范围的情况下,指示当前几何图形是否包含指定的 Geometry。Indicates whether the current geometry contains the specified Geometry, given the specified margin of error. |
FillContains(Point) |
指示该几何图形是否包含指定的 Point。Indicates whether the geometry contains the specified Point. |
FillContains(Point, Double, ToleranceType) |
在给出指定误差范围的情况下,指示几何图形是否包含指定的 Point。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. |
Freeze() |
使当前对象不可修改,并且将其 IsFrozen 属性设置为 |
FreezeCore(Boolean) |
使此 Animatable 对象成为不可修改的对象,或确定是否可使其成为不可修改的对象。Makes this Animatable object unmodifiable or determines whether it can be made unmodifiable. (继承自 Animatable) |
GetAnimationBaseValue(DependencyProperty) |
返回指定的 DependencyProperty 的未经过动画处理的值。Returns the non-animated value of the specified DependencyProperty. (继承自 Animatable) |
GetArea() |
获取 Geometry 对象填充区域的区域。Gets the area of the filled region of the Geometry object. |
GetArea(Double, ToleranceType) |
在指定的公差范围内获取 Geometry 对象填充区域的区域。Gets the area, within the specified tolerance, of the filled region of the Geometry object. |
GetAsFrozen() |
使用基(未经过动画处理的)属性值创建 Freezable 的冻结副本。Creates a frozen copy of the Freezable, using base (non-animated) property values. 由于副本已冻结,因此将通过引用复制任何冻结的子对象。Because the copy is frozen, any frozen sub-objects are copied by reference. (继承自 Freezable) |
GetAsFrozenCore(Freezable) |
让该实例成为指定的 Freezable 的冻结克隆,前者使用基(非动画的)属性值。Makes the instance a frozen clone of the specified Freezable using base (non-animated) property values. (继承自 Freezable) |
GetCurrentValueAsFrozen() |
使用当前属性值创建 Freezable 的冻结副本。Creates a frozen copy of the Freezable using current property values. 由于副本已冻结,因此将通过引用复制任何冻结的子对象。Because the copy is frozen, any frozen sub-objects are copied by reference. (继承自 Freezable) |
GetCurrentValueAsFrozenCore(Freezable) |
使当前实例成为指定 Freezable 的冻结克隆。Makes the current instance a frozen clone of the specified Freezable. 如果对象具有动画依赖属性,则复制其当前的动画值。If the object has animated dependency properties, their current animated values are copied. (继承自 Freezable) |
GetFlattenedPathGeometry() |
获取 PathGeometry 对象的多边形近似 Geometry。Gets a PathGeometry that is a polygonal approximation of the Geometry object. |
GetFlattenedPathGeometry(Double, ToleranceType) |
在指定的公差范围内获取 PathGeometry 对象的多边形近似 Geometry。Gets a PathGeometry, within the specified tolerance, that is a polygonal approximation of the Geometry object. |
GetHashCode() |
获取此 DependencyObject 的哈希代码。Gets a hash code for this DependencyObject. (继承自 DependencyObject) |
GetLocalValueEnumerator() |
创建一个专用的枚举数,用于确定哪些依赖项属性在此 DependencyObject 上具有以本地方式设置的值。Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject. (继承自 DependencyObject) |
GetOutlinedPathGeometry() |
获取 PathGeometry 填充区域的简化轮廓 Geometry。Gets a PathGeometry that is a simplified outline of the filled region of the Geometry. |
GetOutlinedPathGeometry(Double, ToleranceType) |
在指定的公差范围内获取 PathGeometry 填充区域的简化轮廓 Geometry。Gets a PathGeometry, within the specified tolerance, that is a simplified outline of the filled region of the Geometry. |
GetRenderBounds(Pen) |
返回一个与坐标轴对齐的矩形,该矩形的大小正好能容纳用指定的 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) |
在给出指定的公差因子的情况下,返回一个与坐标轴对齐的矩形,该矩形的大小正好能容纳用指定的 Pen 勾勒的几何图形。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. |
GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
GetValue(DependencyProperty) |
对 DependencyObject 的此实例返回依赖属性的当前有效值。Returns the current effective value of a dependency property on this instance of a DependencyObject. (继承自 DependencyObject) |
GetWidenedPathGeometry(Pen) |
获取一个由指定 PathGeometry 生成的 Geometry 上的笔画所定义的形状 Pen。Gets a PathGeometry that is the shape defined by the stroke on the Geometry produced by the specified Pen. |
GetWidenedPathGeometry(Pen, Double, ToleranceType) |
在给出指定的公差因子的情况下,获取一个由指定 PathGeometry 生成的 Geometry 上的笔画所定义的形状 Pen。Gets a PathGeometry that is the shape defined by the stroke on the Geometry produced by the specified Pen, given the specified tolerance factor. |
InvalidateProperty(DependencyProperty) |
重新评估指定依赖属性的有效值。Re-evaluates the effective value for the specified dependency property. (继承自 DependencyObject) |
IsEmpty() |
确定对象是否为空。Determines whether the object is empty. |
MayHaveCurves() |
确定对象是否可以具有曲线段。Determines whether the object might have curved segments. |
MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
OnChanged() |
修改当前 Freezable 对象时调用。Called when the current Freezable object is modified. (继承自 Freezable) |
OnFreezablePropertyChanged(DependencyObject, DependencyObject) |
确保为刚刚设置的 DependencyObjectType 数据成员建立适当的上下文指针。Ensures that appropriate context pointers are established for a DependencyObjectType data member that has just been set. (继承自 Freezable) |
OnFreezablePropertyChanged(DependencyObject, DependencyObject, DependencyProperty) |
此成员支持 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基础结构,但不能在代码中直接使用。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. (继承自 Freezable) |
OnPropertyChanged(DependencyPropertyChangedEventArgs) |
重写 OnPropertyChanged(DependencyPropertyChangedEventArgs) 的 DependencyObject 实现,以同时调用任何响应类型 Freezable 不断变化的依赖属性的 Changed 处理程序。Overrides the DependencyObject implementation of OnPropertyChanged(DependencyPropertyChangedEventArgs) to also invoke any Changed handlers in response to a changing dependency property of type Freezable. (继承自 Freezable) |
Parse(String) |
使用当前区域性基于指定的字符串创建新的 Geometry 实例。Creates a new Geometry instance from the specified string using the current culture. |
ReadLocalValue(DependencyProperty) |
如果存在,则返回依赖属性的本地值。Returns the local value of a dependency property, if it exists. (继承自 DependencyObject) |
ReadPreamble() |
确保正在从有效的线程访问 Freezable。Ensures that the Freezable is being accessed from a valid thread. Freezable 的继承者必须在任何 API 一开始读取不属于依赖项对象的数据成员时调用此方法。Inheritors of Freezable must call this method at the beginning of any API that reads data members that are not dependency properties. (继承自 Freezable) |
SetCurrentValue(DependencyProperty, Object) |
设置依赖属性的值而不更改其值源。Sets the value of a dependency property without changing its value source. (继承自 DependencyObject) |
SetValue(DependencyProperty, Object) |
设置依赖属性的本地值,该值由其依赖属性标识符指定。Sets the local value of a dependency property, specified by its dependency property identifier. (继承自 DependencyObject) |
SetValue(DependencyPropertyKey, Object) |
设置一个只读依赖属性的本地值,该值由依赖属性的 DependencyPropertyKey 标识符指定。Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property. (继承自 DependencyObject) |
ShouldSerializeProperty(DependencyProperty) |
返回一个值,该值指示序列化进程是否应序列化所提供的依赖属性的值。Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property. (继承自 DependencyObject) |
ShouldSerializeTransform() |
获取一个值,该值指示是否应序列化 Transform 属性的值。Gets a value that indicates whether the value of the Transform property should be serialized. |
StrokeContains(Pen, Point) |
确定指定的 Point 是否包含在通过向几何图形应用指定 Pen 所生成的笔画中。Determines whether the specified Point is contained in the stroke produced by applying the specified Pen to the geometry. |
StrokeContains(Pen, Point, Double, ToleranceType) |
在给出指定误差范围的情况下,确定指定的 Point 是否包含在通过向几何图形应用指定 Pen 所生成的笔画中。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) |
返回一个值,该值描述指定的 Geometry 与通过向当前几何图形应用指定 Pen 所创建的笔画的交集。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) |
在给出指定的误差范围的情况下,获取一个值,该值描述指定的 Geometry 与通过向当前几何图形应用指定 Pen 所创建的笔画的交集。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() |
基于当前区域性创建对象的字符串表示形式。Creates a string representation of the object based on the current culture. |
ToString(IFormatProvider) |
使用指定的区域性特定的格式设置信息创建对象的字符串表示形式。Creates a string representation of the object using the specified culture-specific formatting information. |
VerifyAccess() |
强制调用线程具有此 DispatcherObject 的访问权限。Enforces that the calling thread has access to this DispatcherObject. (继承自 DispatcherObject) |
WritePostscript() |
引发 Freezable 的 Changed 事件并调用其 OnChanged() 方法。Raises the Changed event for the Freezable and invokes its OnChanged() method. 从 Freezable 派生的类应在修改的类成员不存储为依赖属性的任何 API 的末尾调用此方法。Classes that derive from Freezable should call this method at the end of any API that modifies class members that are not stored as dependency properties. (继承自 Freezable) |
WritePreamble() |
验证 Freezable 是否未被冻结,并且是否正在从有效的线程上下文中访问它。Verifies that the Freezable is not frozen and that it is being accessed from a valid threading context. Freezable 的继承项应当在任何 API 一开始写入不属于依赖项属性的数据成员时调用此方法。Freezable inheritors should call this method at the beginning of any API that writes to data members that are not dependency properties. (继承自 Freezable) |
事件
Changed |
在修改 Freezable 或其包含的对象时发生。Occurs when the Freezable or an object it contains is modified. (继承自 Freezable) |
显式接口实现
IFormattable.ToString(String, IFormatProvider) |
使用指定格式对当前实例的值设置格式。Formats the value of the current instance using the specified format. |