PathGradientBrush.MultiplyTransform 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 Matrix를 앞에 추가하여 지정된 PathGradientBrush를 이 Matrix의 로컬 기하학적 변환을 나타내는 Matrix에 곱합니다.
오버로드
MultiplyTransform(Matrix) |
다른 매트릭스를 곱한 브러시의 변환 매트릭스로 해당 브러시의 변환 매트릭스를 업데이트합니다. |
MultiplyTransform(Matrix, MatrixOrder) |
다른 매트릭스를 곱한 브러시의 변환 매트릭스로 해당 브러시의 변환 매트릭스를 업데이트합니다. |
MultiplyTransform(Matrix)
- Source:
- PathGradientBrush.cs
- Source:
- PathGradientBrush.cs
- Source:
- PathGradientBrush.cs
다른 매트릭스를 곱한 브러시의 변환 매트릭스로 해당 브러시의 변환 매트릭스를 업데이트합니다.
public:
void MultiplyTransform(System::Drawing::Drawing2D::Matrix ^ matrix);
public void MultiplyTransform (System.Drawing.Drawing2D.Matrix matrix);
member this.MultiplyTransform : System.Drawing.Drawing2D.Matrix -> unit
Public Sub MultiplyTransform (matrix As Matrix)
매개 변수
예제
예제를 보려면 MultiplyTransform를 참조하세요.
적용 대상
MultiplyTransform(Matrix, MatrixOrder)
- Source:
- PathGradientBrush.cs
- Source:
- PathGradientBrush.cs
- Source:
- PathGradientBrush.cs
다른 매트릭스를 곱한 브러시의 변환 매트릭스로 해당 브러시의 변환 매트릭스를 업데이트합니다.
public:
void MultiplyTransform(System::Drawing::Drawing2D::Matrix ^ matrix, System::Drawing::Drawing2D::MatrixOrder order);
public void MultiplyTransform (System.Drawing.Drawing2D.Matrix matrix, System.Drawing.Drawing2D.MatrixOrder order);
member this.MultiplyTransform : System.Drawing.Drawing2D.Matrix * System.Drawing.Drawing2D.MatrixOrder -> unit
Public Sub MultiplyTransform (matrix As Matrix, order As MatrixOrder)
매개 변수
- order
- MatrixOrder
두 매트릭스를 곱할 순서를 지정하는 MatrixOrder입니다.
예제
다음 코드 예제는 Windows Forms 사용하도록 설계되었으며 이벤트 개체인 이 OnPaint 필요합니다PaintEventArgse
. 코드는 다음 작업을 수행합니다.
그래픽 경로를 만들고 사각형을 추가합니다.
경로 지점에서 를 PathGradientBrush 만듭니다(이 예제에서는 점이 사각형을 형성하지만 대부분의 셰이프일 수 있음).
가운데 색을 빨간색으로 설정하고 주변 색을 파란색으로 설정합니다.
PathGradientBrush 곱하기 변환을 적용하기 전에 를 화면에 그립니다.
브러시를 90도 회전하고 두 축에서 100으로 변환하는 행렬을 만듭니다.
메서드를 사용하여 브러시에 이 행렬을 MultiplyTransform 적용합니다.
브러시를 화면에 그립니다.
public:
void MultiplyTransformExample( PaintEventArgs^ e )
{
// Create a graphics path and add an rectangle.
GraphicsPath^ myPath = gcnew GraphicsPath;
Rectangle rect = Rectangle(20,20,100,50);
myPath->AddRectangle( rect );
// Get the path's array of points.
array<PointF>^myPathPointArray = myPath->PathPoints;
// Create a path gradient brush.
PathGradientBrush^ myPGBrush = gcnew PathGradientBrush( myPathPointArray );
// Set the color span.
myPGBrush->CenterColor = Color::Red;
array<Color>^ mySurroundColor = {Color::Blue};
myPGBrush->SurroundColors = mySurroundColor;
// Draw the brush to the screen prior to transformation.
e->Graphics->FillRectangle( myPGBrush, 10, 10, 200, 200 );
// Create a new matrix that rotates by 90 degrees, and
// translates by 100 in each direction.
Matrix^ myMatrix = gcnew Matrix( 0,1,-1,0,100,100 );
// Apply the transform to the brush.
myPGBrush->MultiplyTransform( myMatrix, MatrixOrder::Append );
// Draw the brush to the screen again after applying the
// transform.
e->Graphics->FillRectangle( myPGBrush, 10, 10, 200, 300 );
}
public void MultiplyTransformExample(PaintEventArgs e)
{
// Create a graphics path and add an rectangle.
GraphicsPath myPath = new GraphicsPath();
Rectangle rect = new Rectangle(20, 20, 100, 50);
myPath.AddRectangle(rect);
// Get the path's array of points.
PointF[] myPathPointArray = myPath.PathPoints;
// Create a path gradient brush.
PathGradientBrush myPGBrush = new
PathGradientBrush(myPathPointArray);
// Set the color span.
myPGBrush.CenterColor = Color.Red;
Color[] mySurroundColor = {Color.Blue};
myPGBrush.SurroundColors = mySurroundColor;
// Draw the brush to the screen prior to transformation.
e.Graphics.FillRectangle(myPGBrush, 10, 10, 200, 200);
// Create a new matrix that rotates by 90 degrees, and
// translates by 100 in each direction.
Matrix myMatrix = new Matrix(0, 1, -1, 0, 100, 100);
// Apply the transform to the brush.
myPGBrush.MultiplyTransform(myMatrix, MatrixOrder.Append);
// Draw the brush to the screen again after applying the
// transform.
e.Graphics.FillRectangle(myPGBrush, 10, 10, 200, 300);
}
Public Sub MultiplyTransformExample(ByVal e As PaintEventArgs)
' Create a graphics path and add a rectangle.
Dim myPath As New GraphicsPath
Dim rect As New Rectangle(20, 20, 100, 50)
myPath.AddRectangle(rect)
' Get the path's array of points.
Dim myPathPointArray As PointF() = myPath.PathPoints
' Create a path gradient brush.
Dim myPGBrush As New PathGradientBrush(myPathPointArray)
' Set the color span.
myPGBrush.CenterColor = Color.Red
Dim mySurroundColor As Color() = {Color.Blue}
myPGBrush.SurroundColors = mySurroundColor
' Draw the brush to the screen prior to transformation.
e.Graphics.FillRectangle(myPGBrush, 10, 10, 200, 200)
' Create a new matrix that rotates by 90 degrees, and
' translates by 100 in each direction.
Dim myMatrix As New Matrix(0, 1, -1, 0, 100, 100)
' Apply the transform to the brush.
myPGBrush.MultiplyTransform(myMatrix, MatrixOrder.Append)
' Draw the brush to the screen again after applying the
' transform.
e.Graphics.FillRectangle(myPGBrush, 10, 10, 200, 300)
End Sub
적용 대상
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기