Matrix.Rotate Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Kaynağıyla ilgili belirtilen açının saat yönünde döndürmesini bu Matrixöğesine uygular.
Aşırı Yüklemeler
Rotate(Single) |
Buna Matrix saat yönünde, başlangıcın çevresinde ve belirtilen açıya göre diker. |
Rotate(Single, MatrixOrder) |
Parametresinde |
Rotate(Single)
- Kaynak:
- Matrix.cs
- Kaynak:
- Matrix.cs
- Kaynak:
- Matrix.cs
Buna Matrix saat yönünde, başlangıcın çevresinde ve belirtilen açıya göre diker.
public:
void Rotate(float angle);
public void Rotate (float angle);
member this.Rotate : single -> unit
Public Sub Rotate (angle As Single)
Parametreler
- angle
- Single
Döndürme açısı, derece cinsinden.
Örnekler
Örnek için bkz. Rotate(Single, MatrixOrder)
Şunlara uygulanır
Rotate(Single, MatrixOrder)
- Kaynak:
- Matrix.cs
- Kaynak:
- Matrix.cs
- Kaynak:
- Matrix.cs
Parametresinde angle
belirtilen bir miktarın saat yönünde dönüşünü, bu Matrixiçin başlangıcın çevresinde (sıfır x ve y koordinatları) uygular.
public:
void Rotate(float angle, System::Drawing::Drawing2D::MatrixOrder order);
public void Rotate (float angle, System.Drawing.Drawing2D.MatrixOrder order);
member this.Rotate : single * System.Drawing.Drawing2D.MatrixOrder -> unit
Public Sub Rotate (angle As Single, order As MatrixOrder)
Parametreler
- angle
- Single
Döndürmenin derece cinsinden açısı (kapsamı).
- order
- MatrixOrder
MatrixOrder Döndürmenin bu Matrixöğesine uygulandığı sırayı (ekleme veya dik) belirten bir .
Örnekler
Aşağıdaki kod örneği Windows Forms ile kullanılmak üzere tasarlanmıştır ve bir Paint olay nesnesi gerektirir.PaintEventArgse
Kod aşağıdaki eylemleri gerçekleştirir:
Döndürme dönüşümü (mavi dikdörtgen) uygulamadan önce ekrana bir dikdörtgen çizer.
Matris oluşturur ve 45 derece döndürür.
Bu matris dönüşümünü dikdörtgene uygular.
Dönüştürülmüş dikdörtgeni ekrana (kırmızı dikdörtgen) çizer.
Kırmızı dikdörtgenin 0, 0 ekran koordinatları etrafında döndürüldüğünü göreceksiniz.
public:
void RotateExample( PaintEventArgs^ e )
{
Pen^ myPen = gcnew Pen( Color::Blue,1.0f );
Pen^ myPen2 = gcnew Pen( Color::Red,1.0f );
// Draw the rectangle to the screen before applying the transform.
e->Graphics->DrawRectangle( myPen, 150, 50, 200, 100 );
// Create a matrix and rotate it 45 degrees.
Matrix^ myMatrix = gcnew Matrix;
myMatrix->Rotate( 45, MatrixOrder::Append );
// Draw the rectangle to the screen again after applying the
// transform.
e->Graphics->Transform = myMatrix;
e->Graphics->DrawRectangle( myPen2, 150, 50, 200, 100 );
}
public void RotateExample(PaintEventArgs e)
{
Pen myPen = new Pen(Color.Blue, 1);
Pen myPen2 = new Pen(Color.Red, 1);
// Draw the rectangle to the screen before applying the transform.
e.Graphics.DrawRectangle(myPen, 150, 50, 200, 100);
// Create a matrix and rotate it 45 degrees.
Matrix myMatrix = new Matrix();
myMatrix.Rotate(45, MatrixOrder.Append);
// Draw the rectangle to the screen again after applying the
// transform.
e.Graphics.Transform = myMatrix;
e.Graphics.DrawRectangle(myPen2, 150, 50, 200, 100);
}
Public Sub RotateExample(ByVal e As PaintEventArgs)
Dim myPen As New Pen(Color.Blue, 1)
Dim myPen2 As New Pen(Color.Red, 1)
' Draw the rectangle to the screen before applying the transform.
e.Graphics.DrawRectangle(myPen, 150, 50, 200, 100)
' Create a matrix and rotate it 45 degrees.
Dim myMatrix As New Matrix
myMatrix.Rotate(45, MatrixOrder.Append)
' Draw the rectangle to the screen again after applying the
' transform.
e.Graphics.Transform = myMatrix
e.Graphics.DrawRectangle(myPen2, 150, 50, 200, 100)
End Sub
Şunlara uygulanır
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin