Matrix3x2F::Translation(FLOAT,FLOAT) method (d2d1helper.h)
Creates a translation transformation that has the specified x and y displacements.
Syntax
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.
For an example, see How to Translate an Object.Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | d2d1helper.h |
Library | D2d1.lib |
DLL | D2d1.dll |