TextureBrush.TranslateTransform 方法   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
按指定顺序按指定维度转换此 TextureBrush 对象的局部几何转换。
重载
| TranslateTransform(Single, Single) | 按指定维度转换此 TextureBrush 对象的局部几何转换。 此方法将转换前追加到转换。 | 
| TranslateTransform(Single, Single, MatrixOrder) | 按指定顺序按指定维度转换此 TextureBrush 对象的局部几何转换。 | 
TranslateTransform(Single, Single)
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
按指定维度转换此 TextureBrush 对象的局部几何转换。 此方法将转换前追加到转换。
public:
 void TranslateTransform(float dx, float dy);public void TranslateTransform (float dx, float dy);member this.TranslateTransform : single * single -> unitPublic Sub TranslateTransform (dx As Single, dy As Single)参数
- dx
- Single
要转换到 x 方向的维度。
- dy
- Single
要按 y 方向转换的维度。
示例
下面的示例设计用于 Windows 窗体,它需要 PaintEventArgse,这是 Paint 事件处理程序的参数。 该代码执行以下操作:
- 创建 TextureBrush 对象。 
- 在 x 方向转换纹理图像 50 个单位。 
- 使用纹理画笔填充屏幕上的矩形。 
void TranslateTransform_Example1( PaintEventArgs^ e )
{
   // Create a TextureBrush object.
   TextureBrush^ tBrush = gcnew TextureBrush( gcnew Bitmap( "texture.jpg" ) );
   // Move the texture image 2X in the x-direction.
   tBrush->TranslateTransform( 50, 0, MatrixOrder::Prepend );
   // Fill a rectangle with tBrush.
   e->Graphics->FillRectangle( tBrush, 0, 0, 100, 100 );
}
public void TranslateTransform_Example1(PaintEventArgs e)
{
             
    // Create a TextureBrush object.
    TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
             
    // Move the texture image 2X in the x-direction.
    tBrush.TranslateTransform(50, 0, MatrixOrder.Prepend);
             
    // Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
}
Public Sub TranslateTransform_Example1(ByVal e As PaintEventArgs)
    ' Create a TextureBrush object.
    Dim tBrush As New TextureBrush(New Bitmap("texture.jpg"))
    ' Move the texture image 2X in the x-direction.
    tBrush.TranslateTransform(50, 0, MatrixOrder.Prepend)
    ' Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100)
End Sub
适用于
TranslateTransform(Single, Single, MatrixOrder)
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
按指定顺序按指定维度转换此 TextureBrush 对象的局部几何转换。
public:
 void TranslateTransform(float dx, float dy, System::Drawing::Drawing2D::MatrixOrder order);public void TranslateTransform (float dx, float dy, System.Drawing.Drawing2D.MatrixOrder order);member this.TranslateTransform : single * single * System.Drawing.Drawing2D.MatrixOrder -> unitPublic Sub TranslateTransform (dx As Single, dy As Single, order As MatrixOrder)参数
- dx
- Single
要转换到 x 方向的维度。
- dy
- Single
要按 y 方向转换的维度。
- order
- MatrixOrder
应用翻译的顺序(前面或追加)。
示例
下面的示例设计用于 Windows 窗体,它需要 PaintEventArgse,这是 Paint 事件处理程序的参数。 该代码执行以下操作:
- 创建 TextureBrush 对象。 
- 在 x 方向转换纹理图像 50 个单位。 
- 使用纹理画笔填充屏幕上的矩形。 
void TranslateTransform_Example2( PaintEventArgs^ e )
{
   // Create a TextureBrush object.
   TextureBrush^ tBrush = gcnew TextureBrush( gcnew Bitmap( "texture.jpg" ) );
   // Move the texture image 2X in the x-direction.
   tBrush->TranslateTransform( 50, 0 );
   // Fill a rectangle with tBrush.
   e->Graphics->FillRectangle( tBrush, 0, 0, 100, 100 );
}
public void TranslateTransform_Example2(PaintEventArgs e)
{
         
    // Create a TextureBrush object.
    TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
         
    // Move the texture image 2X in the x-direction.
    tBrush.TranslateTransform(50, 0);
         
    // Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
}
Public Sub TranslateTransform_Example2(ByVal e As PaintEventArgs)
    ' Create a TextureBrush object.
    Dim tBrush As New TextureBrush(New Bitmap("texture.jpg"))
    ' Move the texture image 2X in the x-direction.
    tBrush.TranslateTransform(50, 0)
    ' Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100)
End Sub