Int32Rect 結構

定義

描述整數矩形的寬度、高度以及位置。

public value class Int32Rect : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Int32RectConverter))]
[System.Serializable]
public struct Int32Rect : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Int32RectConverter))]
public struct Int32Rect : IFormattable
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Int32RectConverter))>]
[<System.Serializable>]
type Int32Rect = struct
    interface IFormattable
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Int32RectConverter))>]
type Int32Rect = struct
    interface IFormattable
Public Structure Int32Rect
Implements IFormattable
繼承
Int32Rect
屬性
實作

備註

XAML Attribute Usage

<object property="X,Y,Width,Height"/>  
- or   
<object property="Empty"/>  

XAML 值

X
System.Int32

矩形左上角的 X 座標。

Y
System.Int32

矩形左上角的 Y 座標。

寬度
System.Int32

矩形的寬度。

高度
System.Int32

矩形的高度。

XAML 文字使用方式

您也可以使用空白字元,而不是逗號來分隔值。 空白字元也可以與逗號分隔值集搭配使用。

建構函式

Int32Rect(Int32, Int32, Int32, Int32)

使用指定的 Int32RectX 座標,以及指定的 YWidth,初始化 Height 的新執行個體。

屬性

Empty

取得空矩形,表示沒有位置或區域之矩形的特殊值。

HasArea

取得值,指出 WidthHeightInt32Rect 屬性是否大於 0。

Height

取得或設定矩形的高度。

IsEmpty

取得值,指出矩形是否為空。

Width

取得或設定矩形的寬度。

X

取得或設定矩形左上角的 X 座標。

Y

取得或設定此矩形左上角的 Y 座標。

方法

Equals(Int32Rect)

判斷指定的矩形是否等於這個矩形。

Equals(Int32Rect, Int32Rect)

判斷指定的矩形是否相等。

Equals(Object)

判斷指定的矩形是否等於這個矩形。

GetHashCode()

從這個矩形的 XYWidthHeight 值建立雜湊程式碼。

Parse(String)

從指定的 Int32Rect 表示建立 String 結構。

ToString()

建立這個 Int32Rect 的字串表示。

ToString(IFormatProvider)

根據提供的 Int32Rect 建立這個 IFormatProvider 的字串表示。

運算子

Equality(Int32Rect, Int32Rect)

比較兩個矩形是否完全相等。

Inequality(Int32Rect, Int32Rect)

比較兩個矩形是否不相等。

明確介面實作

IFormattable.ToString(String, IFormatProvider)

使用指定的格式,格式化目前執行個體的值。

適用於