# MatrixTransform 類別

## 定義

``public ref class MatrixTransform sealed : System::Windows::Media::Transform``
``public sealed class MatrixTransform : System.Windows.Media.Transform``
``````type MatrixTransform = class
inherit Transform``````
``````Public NotInheritable Class MatrixTransform
Inherits Transform``````

## 備註

MatrixTransform 可以使用類別來建立 RotateTransformSkewTransformScaleTransformTranslateTransform 類別未提供的自訂轉換。Use the MatrixTransform class to create custom transformations that are not provided by the RotateTransform, SkewTransform, ScaleTransform, or TranslateTransform classes.

3x3 矩陣用於 2-D2-D x-y 平面的轉換。A 3x3 matrix is used for transformations in a 2-D2-D x-y plane. 您可以使用仿射矩陣轉換來形成線性轉換，例如，旋轉和扭曲 (切變) ，然後再進行轉譯。You can multiply affine matrix transformations to form linear transformations, such as rotation and skew (shear) that are followed by translation.

Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) Matrix 具有下列結構：A Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) Matrix has the following structure:

M11 M12 00
M21 M22 00
OffsetX OffsetY 11

(M11, M12, M21, M22, OffsetX, OffsetY)(M11, M12, M21, M22, OffsetX, OffsetY)

### XAML Attribute UsageXAML Attribute Usage

``````<object property="m11, m12, m21, m22, offsetX, offsetY"/>
- or -
<object property="Identity"/>
``````

### XAML 值XAML Values

m11m11
System.Double

(1，1) 轉換的位置值 MatrixThe value at position (1, 1) of the transformation Matrix.

m12m12
System.Double

m21m21
System.Double

m22m22
System.Double

offsetXoffsetX
System.Double

offsetYoffsetY
System.Double

(3，2) 轉換的位置值 MatrixThe value at position (3, 2) of the transformation Matrix.

## 建構函式

 初始化 MatrixTransform 類別的新執行個體。Initializes a new instance of the MatrixTransform class. 使用指定的轉換矩陣值，初始化 MatrixTransform 類別的新執行個體。Initializes a new instance of the MatrixTransform class with the specified transformation matrix values. 使用指定的轉換矩陣，初始化 MatrixTransform 類別的新執行個體。Initializes a new instance of the MatrixTransform class with the specified transformation matrix.

## 欄位

 識別 Matrix 相依性屬性。Identifies the Matrix dependency property.

## 屬性

 取得值，指出是否可以將物件設為不可修改。Gets a value that indicates whether the object can be made unmodifiable. (繼承來源 Freezable) 取得包裝此執行個體之 CLRCLR 型別的 DependencyObjectType。Gets the DependencyObjectType that wraps the CLRCLR type of this instance. (繼承來源 DependencyObject) 取得與這個 Dispatcher 關聯的 DispatcherObject。Gets the Dispatcher this DispatcherObject is associated with. (繼承來源 DispatcherObject) 取得值，這個值表示是否有一個或多個 AnimationClock 物件與這個物件的任何一個相依性屬性相關聯。Gets a value that indicates whether one or more AnimationClock objects is associated with any of this object's dependency properties. (繼承來源 Animatable) 取得這個轉換的反向 (如果有的話)。Gets the inverse of this transform, if it exists. (繼承來源 Transform) 取得值，該值表示物件目前是否可修改。Gets a value that indicates whether the object is currently modifiable. (繼承來源 Freezable) 取得值，這個值表示此執行個體目前是否已密封 (唯讀)。Gets a value that indicates whether this instance is currently sealed (read-only). (繼承來源 DependencyObject) 取得或設定定義此轉換的 Matrix 結構。Gets or sets the Matrix structure that defines this transformation. 取得表示這個 Matrix 的 MatrixTransform。Gets the Matrix that represents this MatrixTransform.

## 方法

 將 AnimationClock 套用至指定的 DependencyProperty。Applies an AnimationClock to the specified DependencyProperty. 如果屬性已有動畫效果，即使用 SnapshotAndReplace 遞移式行為。If the property is already animated, the SnapshotAndReplace handoff behavior is used. (繼承來源 Animatable) 將 AnimationClock 套用至指定的 DependencyProperty。Applies an AnimationClock to the specified DependencyProperty. 如果已建立屬性的動畫，則會使用指定的 HandoffBehavior。If the property is already animated, the specified HandoffBehavior is used. (繼承來源 Animatable) 將動畫套用至指定的 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) 將動畫套用至指定的 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) 判斷呼叫的執行是否可以存取這個 DispatcherObject。Determines whether the calling thread has access to this DispatcherObject. (繼承來源 DispatcherObject) 清除屬性的區域數值。Clears the local value of a property. 要清除的屬性是由 DependencyProperty 識別項所指定。The property to be cleared is specified by a DependencyProperty identifier. (繼承來源 DependencyObject) 清除唯讀屬性的區域數值。Clears the local value of a read-only property. 要清除的屬性是由 DependencyPropertyKey 所指定。The property to be cleared is specified by a DependencyPropertyKey. (繼承來源 DependencyObject) 藉由製作這個 MatrixTransform 值的深層複本，來建立它的可修改複本。Creates a modifiable copy of this MatrixTransform by making deep copies of its values. 使用基底 (非動畫) 屬性值，將執行個體設為指定 Freezable 的複製品 (深層複製)。Makes the instance a clone (deep copy) of the specified Freezable using base (non-animated) property values. (繼承來源 Freezable) 藉由建立這個 MatrixTransform 物件值的深層複製，來建立它的可修改複本。Creates a modifiable copy of this MatrixTransform object by making deep copies of its values. 這個方法不會複製資源參考、資料繫結或動畫，但是會複製其目前值。This method does not copy resource references, data bindings, or animations, although it does copy their current values. 使用目前的屬性值，讓執行個體成為指定之 Freezable 的可修改複本 (深層複本)。Makes the instance a modifiable clone (deep copy) of the specified Freezable using current property values. (繼承來源 Freezable) 強制轉型所指定相依性屬性的值。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) 初始化 Freezable 類別的新執行個體。Initializes a new instance of the Freezable class. (繼承來源 Freezable) 在衍生類別中實作時，建立 Freezable 衍生類別的新執行個體。When implemented in a derived class, creates a new instance of the Freezable derived class. (繼承來源 Freezable) 判斷提供的 DependencyObject 和目前的 DependencyObject 是否相等。Determines whether a provided DependencyObject is equivalent to the current DependencyObject. (繼承來源 DependencyObject) 將目前的物件設為不可修改，並將其 IsFrozen 屬性設定為 `true`。Makes the current object unmodifiable and sets its IsFrozen property to `true`. (繼承來源 Freezable) 將這個 Animatable 物件設定為不可修改，或決定是否可以將它設定為不可修改。Makes this Animatable object unmodifiable or determines whether it can be made unmodifiable. (繼承來源 Animatable) 傳回指定之 DependencyProperty 的非動畫實值。Returns the non-animated value of the specified DependencyProperty. (繼承來源 Animatable) 使用基底 (非動畫) 屬性值，建立 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) 使用基底 (非動畫) 屬性值，將執行個體設為指定 Freezable 的凍結複本。Makes the instance a frozen clone of the specified Freezable using base (non-animated) property values. (繼承來源 Freezable) 使用目前屬性值，建立 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) 將目前執行個體設為所指定 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) 取得這個 DependencyObject 的雜湊碼。Gets a hash code for this DependencyObject. (繼承來源 DependencyObject) 建立特定的列舉值，以判斷哪些相依性屬性在此 DependencyObject 上具有本機設定的值。Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject. (繼承來源 DependencyObject) 取得目前執行個體的 Type。Gets the Type of the current instance. (繼承來源 Object) 傳回 DependencyObject 的這個執行個體上之相依性屬性的目前有效值。Returns the current effective value of a dependency property on this instance of a DependencyObject. (繼承來源 DependencyObject) 重新評估指定相依性屬性的有效值。Re-evaluates the effective value for the specified dependency property. (繼承來源 DependencyObject) 建立目前 Object 的淺層複製。Creates a shallow copy of the current Object. (繼承來源 Object) 目前的 Freezable 物件遭到修改時進行呼叫。Called when the current Freezable object is modified. (繼承來源 Freezable) 確定已為剛剛設定的 DependencyObjectType 資料成員，建立適當的內容指標。Ensures that appropriate context pointers are established for a DependencyObjectType data member that has just been set. (繼承來源 Freezable) 這個成員支援 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) 的 DependencyObject 實作也可以叫用任何 Changed 處理常式，以回應類型 Freezable 的變更相依性屬性。Overrides the DependencyObject implementation of OnPropertyChanged(DependencyPropertyChangedEventArgs) to also invoke any Changed handlers in response to a changing dependency property of type Freezable. (繼承來源 Freezable) 傳回相依性屬性的區域值 (如果存在)。Returns the local value of a dependency property, if it exists. (繼承來源 DependencyObject) 確定 Freezable 是從有效的執行緒進行存取。Ensures that the Freezable is being accessed from a valid thread. 如果 API 會讀取非相依性屬性的資料成員，則 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) 設定相依性屬性的值，而不需要變更其值來源。Sets the value of a dependency property without changing its value source. (繼承來源 DependencyObject) 設定相依性屬性的區域值 (由相依性屬性的識別碼所指定)。Sets the local value of a dependency property, specified by its dependency property identifier. (繼承來源 DependencyObject) 設定唯讀相依性屬性的區域數值 (由相依性屬性的 DependencyPropertyKey 識別項所指定)。Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property. (繼承來源 DependencyObject) 傳回值，這個值表示序列化程序是否應該序列化所提供相依性屬性的值。Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property. (繼承來源 DependencyObject) 建立這個 GeneralTransform 的字串表示。Creates a string representation of this GeneralTransform. (繼承來源 GeneralTransform) 以傳遞的 IFormatProvider 參數為基礎，建立這個執行個體的字串表示。Creates a string representation of this instance, based on the passed IFormatProvider parameter. (繼承來源 GeneralTransform) 轉換指定的點，然後傳回結果。Transforms the specified point and returns the result. (繼承來源 GeneralTransform) 轉換指定的週框方塊，並傳回剛好足夠包含該方塊的軸對齊週框方塊。Transforms the specified bounding box and returns an axis-aligned bounding box that is exactly large enough to contain it. (繼承來源 Transform) 嘗試轉換指定的點，並傳回表示轉換是否成功的值。Attempts to transform the specified point and returns a value that indicates whether the transformation was successful. (繼承來源 Transform) 請強制執行可以存取這個 DispatcherObject 的呼叫執行緒。Enforces that the calling thread has access to this DispatcherObject. (繼承來源 DispatcherObject) 引發 Freezable 的 Changed 事件，並叫用其 OnChanged() 方法。Raises the Changed event for the Freezable and invokes its OnChanged() method. 在任何 API 修改未以相依性屬性儲存的類別成員之後，衍生自 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) 確認 Freezable 未凍結，而且是從有效的執行緒內容進行存取。Verifies that the Freezable is not frozen and that it is being accessed from a valid threading context. 在任何 API 將資料寫入至非相依性屬性的資料成員之前，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)

## 事件

 發生於 Freezable 或所含的物件遭到修改時。Occurs when the Freezable or an object it contains is modified. (繼承來源 Freezable)

## 明確介面實作

 使用指定的格式，格式化目前執行個體的值。Formats the value of the current instance using the specified format. (繼承來源 GeneralTransform)