DrawingVisual 類別

定義

DrawingVisual 是可用來在螢幕上呈現向量圖形的視覺物件。DrawingVisual is a visual object that can be used to render vector graphics on the screen. 內容是由系統所保存。The content is persisted by the system.

public ref class DrawingVisual : System::Windows::Media::ContainerVisual
public class DrawingVisual : System.Windows.Media.ContainerVisual
type DrawingVisual = class
    inherit ContainerVisual
Public Class DrawingVisual
Inherits ContainerVisual
繼承

備註

DrawingVisual是輕量繪圖類別, 用來呈現圖形、影像或文字。DrawingVisual is a lightweight drawing class that is used to render shapes, images, or text. 這個類別會被視為輕量, 因為它不提供版面配置、輸入、焦點或事件處理, 以改善其效能。This class is considered lightweight because it does not provide layout, input, focus, or event handling, which improves its performance. 基於此原因,繪圖適合背景或美工圖案。For this reason, drawings are ideal for backgrounds and clip art.

若要使用DrawingVisual物件, 您必須建立物件的主機容器。In order to use DrawingVisual objects, you need to create a host container for the objects. 主機容器物件必須衍生自FrameworkElement類別, 以提供DrawingVisual類別不支援的版面配置和事件處理支援。The host container object must be derived from the FrameworkElement class, which provides the layout and event handling support that the DrawingVisual class does not support. 主機容器物件不會顯示任何視覺屬性, 因為它的主要目的是要包含子物件。The host container object does not display any visual properties, since its main purpose is to contain child objects. 如需詳細資訊,請參閱使用 DrawingVisual 物件For more information, see Using DrawingVisual Objects.

如需示範如何建立DrawingVisual具有主機容器之物件的完整範例, 請參閱使用 drawingvisuals 進行進行點擊測試範例For a complete example showing how to create DrawingVisual objects with a host container, see the Hit Test Using DrawingVisuals Sample .

建構函式

DrawingVisual()

初始化 DrawingVisual 類別的新執行個體。Initializes a new instance of the DrawingVisual class.

屬性

BitmapEffect

取得或設定 BitmapEffectContainerVisual 值。Gets or sets a BitmapEffect value for the ContainerVisual.

(繼承來源 ContainerVisual)
BitmapEffectInput

取得或設定 BitmapEffectInputContainerVisual 值。Gets or sets a BitmapEffectInput value for the ContainerVisual.

(繼承來源 ContainerVisual)
CacheMode

取得或設定 ContainerVisual 的快取表示。Gets or sets a cached representation of the ContainerVisual.

(繼承來源 ContainerVisual)
Children

取得 ContainerVisual 的子集合。Gets the child collection of the ContainerVisual.

(繼承來源 ContainerVisual)
Clip

取得或設定 ContainerVisual 的裁剪區域。Gets or sets the clipping region of the ContainerVisual.

(繼承來源 ContainerVisual)
ContentBounds

取得 ContainerVisual 內容的週框方塊。Gets the bounding box for the contents of the ContainerVisual.

(繼承來源 ContainerVisual)
DependencyObjectType

取得包裝此執行個體之 DependencyObjectType 型別的 CLRCLRGets the DependencyObjectType that wraps the CLRCLR type of this instance.

(繼承來源 DependencyObject)
DescendantBounds

取得 ContainerVisual 之所有子代的所有內容週框方塊聯集,但不包括 ContainerVisual 的內容。Gets the union of all the content bounding boxes for all of the descendants of the ContainerVisual, but not including the contents of the ContainerVisual.

(繼承來源 ContainerVisual)
Dispatcher

取得與這個 Dispatcher 關聯的 DispatcherObjectGets the Dispatcher this DispatcherObject is associated with.

(繼承來源 DispatcherObject)
Drawing

取得 DrawingVisual 物件的繪圖內容。Gets the drawing content of the DrawingVisual object.

Effect

取得或設定要套用至 ContainerVisual 的點陣圖效果。Gets or sets the bitmap effect to apply to the ContainerVisual.

(繼承來源 ContainerVisual)
IsSealed

取得值,這個值表示此執行個體目前是否已密封 (唯讀)。Gets a value that indicates whether this instance is currently sealed (read-only).

(繼承來源 DependencyObject)
Offset

取得或設定 ContainerVisual 距離其參考點的位移值。Gets or sets the offset value of the ContainerVisual from its reference point.

(繼承來源 ContainerVisual)
Opacity

取得或設定 ContainerVisual 的不透明度 (根據 0=透明,1=不透明)。Gets or sets the opacity of the ContainerVisual, based on 0=transparent, 1=opaque.

(繼承來源 ContainerVisual)
OpacityMask

取得或設定筆刷,這個筆刷指定 ContainerVisual 可能的不透明遮罩。Gets or sets a brush that specifies a possible opacity mask for the ContainerVisual.

(繼承來源 ContainerVisual)
Parent

取得 Visual 的父 ContainerVisualGets the parent Visual for the ContainerVisual.

(繼承來源 ContainerVisual)
Transform

取得或設定套用至 ContainerVisual 的轉換。Gets or sets the transform that is applied to the ContainerVisual.

(繼承來源 ContainerVisual)
VisualBitmapEffect

取得或設定 BitmapEffectVisual 值。Gets or sets the BitmapEffect value for the Visual.

(繼承來源 Visual)
VisualBitmapEffectInput

取得或設定 BitmapEffectInputVisual 值。Gets or sets the BitmapEffectInput value for the Visual.

(繼承來源 Visual)
VisualBitmapScalingMode

取得或設定 BitmapScalingModeVisualGets or sets the BitmapScalingMode for the Visual.

(繼承來源 Visual)
VisualCacheMode

取得或設定 Visual 的快取表示。Gets or sets a cached representation of the Visual.

(繼承來源 Visual)
VisualChildrenCount

取得 ContainerVisual 的子系數目。Gets the number of children for the ContainerVisual.

(繼承來源 ContainerVisual)
VisualClearTypeHint

取得或設定 ClearTypeHint,以決定 Visual 中的 ClearType 呈現方式。Gets or sets the ClearTypeHint that determines how ClearType is rendered in the Visual.

(繼承來源 Visual)
VisualClip

取得或設定 Visual 的裁剪區域做為 Geometry 值。Gets or sets the clip region of the Visual as a Geometry value.

(繼承來源 Visual)
VisualEdgeMode

取得或設定 Visual 的邊緣模式做為 EdgeMode 值。Gets or sets the edge mode of the Visual as an EdgeMode value.

(繼承來源 Visual)
VisualEffect

取得或設定要套用至 Visual 的點陣圖效果。Gets or sets the bitmap effect to apply to the Visual.

(繼承來源 Visual)
VisualOffset

取得或設定視覺物件的位移值。Gets or sets the offset value of the visual object.

(繼承來源 Visual)
VisualOpacity

取得或設定 Visual 的不透明度。Gets or sets the opacity of the Visual.

(繼承來源 Visual)
VisualOpacityMask

取得或設定 Brush 值,這個值表示 Visual 的不透明遮罩。Gets or sets the Brush value that represents the opacity mask of the Visual.

(繼承來源 Visual)
VisualParent

取得視覺物件的視覺化樹狀結構父物件。Gets the visual tree parent of the visual object.

(繼承來源 Visual)
VisualScrollableAreaClip

取得或設定 Visual 的可捲動裁剪區域。Gets or sets a clipped scrollable area for the Visual.

(繼承來源 Visual)
VisualTextHintingMode

取得或設定 TextHintingModeVisualGets or sets the TextHintingMode of the Visual.

(繼承來源 Visual)
VisualTextRenderingMode

取得或設定 TextRenderingModeVisualGets or sets the TextRenderingMode of the Visual.

(繼承來源 Visual)
VisualTransform

取得或設定 TransformVisual 值。Gets or sets the Transform value for the Visual.

(繼承來源 Visual)
VisualXSnappingGuidelines

取得或設定 X 座標 (垂直) 導線集合。Gets or sets the x-coordinate (vertical) guideline collection.

(繼承來源 Visual)
VisualYSnappingGuidelines

取得或設定 Y 座標 (水平) 導線集合。Gets or sets the y-coordinate (horizontal) guideline collection.

(繼承來源 Visual)
XSnappingGuidelines

取得或設定 ContainerVisual 的 X (水平) 導線。Gets or sets the X (horizontal) guideline for the ContainerVisual.

(繼承來源 ContainerVisual)
YSnappingGuidelines

取得或設定 ContainerVisual 的 Y (垂直) 導線。Gets or sets the Y (vertical) guideline for the ContainerVisual.

(繼承來源 ContainerVisual)

方法

AddVisualChild(Visual)

定義兩個視覺項目之間的父-子關係。Defines the parent-child relationship between two visuals.

(繼承來源 Visual)
CheckAccess()

判斷呼叫的執行是否可以存取這個 DispatcherObjectDetermines 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)
CoerceValue(DependencyProperty)

強制轉型所指定相依性屬性的值。Coerces the value of the specified dependency property. 完成方式是叫用存在於呼叫 CoerceValueCallback 之相依性屬性的屬性中繼資料中所指定的任何 DependencyObject 函式。This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject.

(繼承來源 DependencyObject)
Equals(Object)

判斷提供的 DependencyObject 和目前的 DependencyObject 是否相等。Determines whether a provided DependencyObject is equivalent to the current DependencyObject.

(繼承來源 DependencyObject)
FindCommonVisualAncestor(DependencyObject)

傳回兩個視覺物件的共同祖系。Returns the common ancestor of two visual objects.

(繼承來源 Visual)
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)
GetType()

取得目前執行個體的 TypeGets 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)
GetVisualChild(Int32)

傳回父代 ContainerVisual 的指定子系 VisualReturns a specified child Visual for the parent ContainerVisual.

(繼承來源 ContainerVisual)
HitTest(HitTestFilterCallback, HitTestResultCallback, HitTestParameters)

使用 HitTestFilterCallbackHitTestResultCallback 物件,對 ContainerVisual 起始點擊測試。Initiates a hit test on the ContainerVisual by using the HitTestFilterCallback and HitTestResultCallback objects.

(繼承來源 ContainerVisual)
HitTest(Point)

藉由指定 Point,傳回點擊測試最上層的視覺物件。Returns the top-most visual object of a hit test by specifying a Point.

(繼承來源 ContainerVisual)
HitTestCore(GeometryHitTestParameters)

判斷幾何值是否在視覺物件的界限中。Determines whether a geometry value is within the bounds of the visual object.

HitTestCore(PointHitTestParameters)

判斷點座標值是否在 DrawingVisual 物件的界限中。Determines whether a point coordinate value is within the bounds of the DrawingVisual object.

InvalidateProperty(DependencyProperty)

重新評估指定相依性屬性的有效值。Re-evaluates the effective value for the specified dependency property.

(繼承來源 DependencyObject)
IsAncestorOf(DependencyObject)

判斷視覺物件是否為子系視覺物件的祖系。Determines whether the visual object is an ancestor of the descendant visual object.

(繼承來源 Visual)
IsDescendantOf(DependencyObject)

判斷視覺物件是否為祖系視覺物件的子系。Determines whether the visual object is a descendant of the ancestor visual object.

(繼承來源 Visual)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
OnDpiChanged(DpiScale, DpiScale)

當轉譯此 View 的 DPI 變更時呼叫。Called when the DPI at which this View is rendered changes.

(繼承來源 Visual)
OnPropertyChanged(DependencyPropertyChangedEventArgs)

每當這個 DependencyObject 上任何相依性屬性的有效值已更新時叫用。Invoked whenever the effective value of any dependency property on this DependencyObject has been updated. 已變更的特定相依性屬性會在事件資料中報告。The specific dependency property that changed is reported in the event data.

(繼承來源 DependencyObject)
OnVisualChildrenChanged(DependencyObject, DependencyObject)

當視覺物件的 VisualCollection 已修改時呼叫。Called when the VisualCollection of the visual object is modified.

(繼承來源 Visual)
OnVisualParentChanged(DependencyObject)

在視覺物件的父代變更時呼叫。Called when the parent of the visual object is changed.

(繼承來源 Visual)
PointFromScreen(Point)

將螢幕座標中的 Point 轉換為 Point,表示 Visual 的目前座標系統。Converts a Point in screen coordinates into a Point that represents the current coordinate system of the Visual.

(繼承來源 Visual)
PointToScreen(Point)

將表示 Point 之目前座標系統的 Visual 轉換為螢幕座標中的 PointConverts a Point that represents the current coordinate system of the Visual into a Point in screen coordinates.

(繼承來源 Visual)
ReadLocalValue(DependencyProperty)

傳回相依性屬性的區域值 (如果存在)。Returns the local value of a dependency property, if it exists.

(繼承來源 DependencyObject)
RemoveVisualChild(Visual)

移除兩個視覺物件之間的父-子關係。Removes the parent-child relationship between two visuals.

(繼承來源 Visual)
RenderOpen()

開啟用於呈現的 DrawingVisual 物件。Opens the DrawingVisual object for rendering. 傳回的 DrawingContext 值可用來在 DrawingVisual 中呈現。The returned DrawingContext value can be used to render into the DrawingVisual.

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)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
TransformToAncestor(Visual)

傳回轉換,這個轉換可用來將 Visual 的座標轉換為視覺物件的指定 Visual 祖系。Returns a transform that can be used to transform coordinates from the Visual to the specified Visual ancestor of the visual object.

(繼承來源 Visual)
TransformToAncestor(Visual3D)

傳回轉換,這個轉換可用來將 Visual 的座標轉換為視覺物件的指定 Visual3D 祖系。Returns a transform that can be used to transform coordinates from the Visual to the specified Visual3D ancestor of the visual object.

(繼承來源 Visual)
TransformToDescendant(Visual)

傳回轉換,這個轉換可用來將 Visual 的座標轉換為指定的視覺物件子系。Returns a transform that can be used to transform coordinates from the Visual to the specified visual object descendant.

(繼承來源 Visual)
TransformToVisual(Visual)

傳回轉換,這個轉換可用來將 Visual 的座標轉換為指定的視覺物件。Returns a transform that can be used to transform coordinates from the Visual to the specified visual object.

(繼承來源 Visual)
VerifyAccess()

請強制執行可以存取這個 DispatcherObject 的呼叫執行緒。Enforces that the calling thread has access to this DispatcherObject.

(繼承來源 DispatcherObject)

適用於