Back to Devexpress

GraphicsCache.TranslateTransform(Single, Single, MatrixOrder) Method

windowsforms-devexpress-dot-utils-dot-drawing-dot-graphicscache-dot-translatetransform-x28-system-dot-single-system-dot-single-system-dot-drawing-dot-drawing2d-dot-matrixorder-x29.md

latest3.6 KB
Original Source

GraphicsCache.TranslateTransform(Single, Single, MatrixOrder) Method

Applies the translation to the transformation matrix to change the origin of the coordinate system. See the TranslateTransform method description for more information.

Namespace : DevExpress.Utils.Drawing

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
public void TranslateTransform(
    float dx,
    float dy,
    MatrixOrder order = MatrixOrder.Prepend
)
vb
Public Sub TranslateTransform(
    dx As Single,
    dy As Single,
    order As MatrixOrder = MatrixOrder.Prepend
)

Parameters

NameTypeDescription
dxSingle

The X-coordinate of the translation.

| | dy | Single |

The y-coordinate of the translation.

|

Optional Parameters

NameTypeDefaultDescription
orderMatrixOrderPrepend

Specifies whether the translation is prepended or appended to the transformation matrix.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the TranslateTransform(Single, Single, MatrixOrder) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-diagram-create-custom-toolbox/CS/CustomDiagramToolboxExample/Form1.cs#L43

csharp
e.Appearance.DrawString(e.Cache, e.DisplayText, new Rectangle(e.Bounds.X + shapeTextOffset, e.Bounds.Y, e.Bounds.Width - shapeTextOffset, e.Bounds.Height));
e.Cache.TranslateTransform(e.Bounds.X, e.Bounds.Y);
shapeItem.Width = 40;

winforms-diagram-create-custom-toolbox/VB/CustomDiagramToolboxExample/Form1.vb#L44

vb
e.Appearance.DrawString(e.Cache, e.DisplayText, New System.Drawing.Rectangle(e.Bounds.X + Me.shapeTextOffset, e.Bounds.Y, e.Bounds.Width - Me.shapeTextOffset, e.Bounds.Height))
e.Cache.TranslateTransform(e.Bounds.X, e.Bounds.Y)
shapeItem.Width = 40

See Also

GraphicsCache Class

GraphicsCache Members

DevExpress.Utils.Drawing Namespace