TextureBrush.RotateTransform 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将 TextureBrush 对象的局部几何转换旋转指定量。 此方法将旋转添加到转换前。
重载
RotateTransform(Single) |
将 TextureBrush 对象的局部几何转换旋转指定量。 此方法将旋转添加到转换前。 |
RotateTransform(Single, MatrixOrder) |
以指定顺序将 TextureBrush 对象的局部几何转换旋转指定的量。 |
RotateTransform(Single)
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
将 TextureBrush 对象的局部几何转换旋转指定量。 此方法将旋转添加到转换前。
public:
void RotateTransform(float angle);
public void RotateTransform (float angle);
member this.RotateTransform : single -> unit
Public Sub RotateTransform (angle As Single)
参数
- angle
- Single
旋转角度。
示例
下面的示例旨在与 Windows 窗体 一起使用,它需要 PaintEventArgse
,它是 事件处理程序的Paint
一个参数。 此代码执行以下操作:
创建一个 TextureBrush 对象。
将纹理图像旋转 90 度。
填充矩形。
void RotateTransform_Example1( PaintEventArgs^ e )
{
// Create a TextureBrush object.
TextureBrush^ tBrush = gcnew TextureBrush( gcnew Bitmap( "texture.jpg" ) );
// Rotate the texture image by 90 degrees.
tBrush->RotateTransform( 90 );
// Fill a rectangle with tBrush.
e->Graphics->FillRectangle( tBrush, 0, 0, 100, 100 );
}
public void RotateTransform_Example1(PaintEventArgs e)
{
// Create a TextureBrush object.
TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
// Rotate the texture image by 90 degrees.
tBrush.RotateTransform(90);
// Fill a rectangle with tBrush.
e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
}
Public Sub RotateTransform_Example1(ByVal e As PaintEventArgs)
' Create a TextureBrush object.
Dim tBrush As New TextureBrush(New Bitmap("texture.jpg"))
' Rotate the texture image by 90 degrees.
tBrush.RotateTransform(90)
' Fill a rectangle with tBrush.
e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100)
End Sub
适用于
RotateTransform(Single, MatrixOrder)
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
以指定顺序将 TextureBrush 对象的局部几何转换旋转指定的量。
public:
void RotateTransform(float angle, System::Drawing::Drawing2D::MatrixOrder order);
public void RotateTransform (float angle, System.Drawing.Drawing2D.MatrixOrder order);
member this.RotateTransform : single * System.Drawing.Drawing2D.MatrixOrder -> unit
Public Sub RotateTransform (angle As Single, order As MatrixOrder)
参数
- angle
- Single
旋转角度。
- order
- MatrixOrder
一个 MatrixOrder 枚举,指定是在后面追加还是在前面添加旋转矩阵。
示例
下面的示例旨在与 Windows 窗体 一起使用,它需要 PaintEventArgse
,它是 事件处理程序的Paint
一个参数。 此代码执行以下操作:
创建一个 TextureBrush 对象。
将纹理图像旋转 90 度。
填充矩形。
void RotateTransform_Example2( PaintEventArgs^ e )
{
// Create a TextureBrush object.
TextureBrush^ tBrush = gcnew TextureBrush( gcnew Bitmap( "texture.jpg" ) );
// Rotate the texture image by 90 degrees.
tBrush->RotateTransform( 90, MatrixOrder::Prepend );
// Fill a rectangle with tBrush.
e->Graphics->FillRectangle( tBrush, 0, 0, 100, 100 );
}
public void RotateTransform_Example2(PaintEventArgs e)
{
// Create a TextureBrush object.
TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
// Rotate the texture image by 90 degrees.
tBrush.RotateTransform(90, MatrixOrder.Prepend);
// Fill a rectangle with tBrush.
e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
}
Public Sub RotateTransform_Example2(ByVal e As PaintEventArgs)
' Create a TextureBrush object.
Dim tBrush As New TextureBrush(New Bitmap("texture.jpg"))
' Rotate the texture image by 90 degrees.
tBrush.RotateTransform(90, MatrixOrder.Prepend)
' Fill a rectangle with tBrush.
e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100)
End Sub
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈