Matrix3x2F::Translation method

Creates a translation transformation that has the specified x and y displacements.

Syntax


static Matrix3x2F Translation(
   FLOAT x,
   FLOAT y
);

Parameters

x

Type: FLOAT

The distance to translate along the x-axis.

y

Type: FLOAT

The distance to translate along the y-axis.

Return value

Type: Matrix3x2F

A transformation matrix that translates an object the specified horizontal and vertical distance.

Remarks

Translation is an affine transformation, which moves every point by a fixed distance in the same direction. It is similar to shifting the origin of the coordinate space. You can translate an object along the x-axis, the y-axis, or both.

When calling this method, specify the x and y displacements. If you prefer to define both displacements in an ordered pair by using the D2D1_SIZE_F structure, call the other Translation method. The following illustration shows a square moved 20 pixels to the right along the x-axis, and 10 pixels downward along the y-axis.

Illustration of the square moved to the right and downward

For an example, see How to Translate an Object.

Requirements

Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

D2D1

Header

D2d1helper.h

Library

D2d1.lib

DLL

D2d1.dll

See also

Matrix3x2F

 

 

Show: