本文整理匯總了C#中System.Windows.Rect.Transform方法的典型用法代碼示例。如果您正苦於以下問題:C# Rect.Transform方法的具體用法?C# Rect.Transform怎麽用?C# Rect.Transform使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Rect
的用法示例。
在下文中一共展示了Rect.Transform方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: transformExample1
private Rect transformExample1()
{
// Initialize new rectangle.
Rect myRectangle = new Rect();
// Set the Size property of the rectangle with a width of 200
// and a height of 60.
myRectangle.Size = new Size(200, 60);
// Creating a Matrix structure.
Matrix myMatrix = new Matrix(0, 1, 1, 0, 20, 2);
// The Transform method transforms this rectangle using the specified matrix.
// myRectangle location changed from 0,0 to 20, 2 and the size changed from
// 200,60 to 60,200.
myRectangle.Transform(myMatrix);
return myRectangle;
}
示例2: transformExample2
private Rect transformExample2()
{
// Initialize new rectangle.
Rect myRectangle = new Rect();
// Set the Size property of the rectangle with a width of 200
// and a height of 60.
myRectangle.Size = new Size(200, 60);
// Creating a Matrix structure.
Matrix myMatrix = new Matrix(0, 1, 1, 0, 20, 2);
// The Transform method Transforms the specified rectangle using the specified matrix
// and returns the results.
// resultRect is an alterned version of myRectangle with a location of 20,2 rather
// then 0,0 and a size of 60,200 rather then 200,60.
Rect resultRect = Rect.Transform(myRectangle,myMatrix);
return resultRect;
}