TextureBrush.ResetTransform Метод
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Сбрасывает свойство Transform
объекта идентификации TextureBrush.
public:
void ResetTransform();
public void ResetTransform ();
member this.ResetTransform : unit -> unit
Public Sub ResetTransform ()
Примеры
Следующий пример предназначен для использования с Windows Forms и требует PaintEventArgse
, который является параметром обработчика Paint
событий. Код выполняет следующие действия.
Создает объект TextureBrush.
Поворачивает изображение текстуры на 90 градусов.
Заполняет прямоугольник.
Сбрасывает матрицу преобразования на удостоверение.
Заполняет второй прямоугольник.
void ResetTransform_Example( 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 );
// Reset transformation matrix to identity.
tBrush->ResetTransform();
// Fill a rectangle with tBrush.
e->Graphics->FillRectangle( tBrush, 0, 110, 100, 100 );
}
public void ResetTransform_Example(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);
// Reset transformation matrix to identity.
tBrush.ResetTransform();
// Fill a rectangle with tBrush.
e.Graphics.FillRectangle(tBrush, 0, 110, 100, 100);
}
Public Sub ResetTransform_Example(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)
' Reset transformation matrix to identity.
tBrush.ResetTransform()
' Fill a rectangle with tBrush.
e.Graphics.FillRectangle(tBrush, 0, 110, 100, 100)
End Sub
'ResetTransform_Example.
Применяется к
Обратная связь
https://aka.ms/ContentUserFeedback.
Ожидается в ближайшее время: в течение 2024 года мы постепенно откажемся от GitHub Issues как механизма обратной связи для контента и заменим его новой системой обратной связи. Дополнительные сведения см. в разделеОтправить и просмотреть отзыв по