當前位置: 首頁>>代碼示例>>C#>>正文


C# Rect構造函數代碼示例

本文整理匯總了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;
}
開發者ID:.NET開發者,項目名稱:System.Windows,代碼行數:10,代碼來源:Rect

示例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;
}
開發者ID:.NET開發者,項目名稱:System.Windows,代碼行數:9,代碼來源:Rect

示例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;
}
開發者ID:.NET開發者,項目名稱:System.Windows,代碼行數:9,代碼來源:Rect

示例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;
}
開發者ID:.NET開發者,項目名稱:System.Windows,代碼行數:10,代碼來源:Rect

示例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;
}
開發者ID:.NET開發者,項目名稱:System.Windows,代碼行數:9,代碼來源:Rect


注:本文中的System.Windows.Rect.Rect構造函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。