本文整理汇总了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;
}