本文整理匯總了C#中System.Windows.Rect.Rect構造函數的典型用法代碼示例。如果您正苦於以下問題:C# Rect構造函數的具體用法?C# Rect怎麽用?C# Rect使用的例子?那麽, 這裏精選的構造函數代碼示例或許可以為您提供幫助。您也可以進一步了解該構造函數所在類System.Windows.Rect
的用法示例。
在下文中一共展示了Rect構造函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: createRectExample2
private Rect createRectExample2()
{
// This constructor initializes a new instance of the Rect structure that
// is of the specified size and is located at (0,0).
Rect myRectangle = new Rect(new Size(200, 50));
// Returns a rectangle with a width of 200, a height of 50 and a position
// of 0,0.
return myRectangle;
}
示例2: createRectExample3
private Rect createRectExample3()
{
// This constructor intializes a new instance of the Rect structure that is
// exactly large enough to contain the two specified points.
Rect myRectangle = new Rect(new Point(15, 30), new Point(50,70));
// Returns a rectangle with a position of 15,30, a width of 35 and height of 40.
return myRectangle;
}
示例3: createRectExample4
private Rect createRectExample4()
{
// This constructor initializes a new instance of the Rect structure that has the
// specified top-left corner location and the specified width and height (Size).
Rect myRectangle = new Rect(new Point(15, 30), new Size(35, 40));
// Returns a rectangle with a position of 15,30, a width of 35 and height of 40.
return myRectangle;
}
示例4: createRectExample5
private Rect createRectExample5()
{
// This constructor Intializes a new instance of the Rect structure that is exactly
// large enough to contain the specified point and the sum of the specified point
// and the specified vector.
Rect myRectangle = new Rect(new Point(15, 30), new Vector(35, 40));
// Returns a rectangle with a position of 15,30, a width of 35 and height of 40.
return myRectangle;
}
示例5: createRectExample6
private Rect createRectExample6()
{
// This constructor intializes a new instance of the Rect structure with the specified
// x- and y-coordinates and the specified width and height.
Rect myRectangle = new Rect(15, 30, 35, 40);
// Returns a rectangle with a position of 15,30, a width of 35 and height of 40.
return myRectangle;
}