Matrix.Translate(Double, Double) 方法

定義

在這個 Matrix 結構之後加上所指定位移的轉換。

public:
 void Translate(double offsetX, double offsetY);
public void Translate (double offsetX, double offsetY);
member this.Translate : double * double -> unit
Public Sub Translate (offsetX As Double, offsetY As Double)

參數

offsetX
Double

要沿著 X 軸移離這個 Matrix 的位移量。

offsetY
Double

要沿著 Y 軸移離這個 Matrix 的位移量。

範例

下列範例示範如何將翻譯附加至 Matrix 結構。

private Matrix translateExample()
{
    
    Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);
    
    myMatrix.Translate(5, 10);

    // myMatrix is equal to (5, 10, 15, 20, 30, 40).
    return myMatrix;
}

適用於

另請參閱