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
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
public void TranslateTransform(
float dx,
float dy,
MatrixOrder order = MatrixOrder.Prepend
)
Public Sub TranslateTransform(
dx As Single,
dy As Single,
order As MatrixOrder = MatrixOrder.Prepend
)
| Name | Type | Description |
|---|---|---|
| dx | Single |
The X-coordinate of the translation.
| | dy | Single |
The y-coordinate of the translation.
|
| Name | Type | Default | Description |
|---|---|---|---|
| order | MatrixOrder | Prepend |
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
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
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