LinearGradientBrush.EndPoint 屬性

定義

取得或設定線性漸層的結束二維座標。

public:
 property System::Windows::Point EndPoint { System::Windows::Point get(); void set(System::Windows::Point value); };
public System.Windows.Point EndPoint { get; set; }
member this.EndPoint : System.Windows.Point with get, set
Public Property EndPoint As Point

屬性值

Point

線性漸層的結束二維座標。 預設值為 (1,1)。

備註

沿著 LinearGradientBrush 線條繪製漸層。 線條的起點和終點是由 StartPoint 的 和 EndPoint 屬性 LinearGradientBrush 所定義。

預設線性漸層是對角線。 在預設值中, StartPoint 線性漸層的 會 (0,0) 、填滿區域的左上角,而其 EndPoint (為 1,1) ,區域右下角。 產生的漸層中的色彩會沿著對角線路徑插補。

下圖顯示對角漸層。 已新增黑色線條,以反白顯示從起點到終點的漸層插補路徑。

對角線性漸層的漸層軸
對角線性漸層

指定相對值或絕對值

請注意, MappingModeLinearGradientBrush 屬性會判斷其 EndPoint 是否解譯為相對或絕對值。 MappingModeRelativeToBoundingBox 指定 EndPoint 值相對於繪製區域的大小。 MappingModeAbsolute 指定 EndPoint 值是以裝置獨立圖元表示。 根據預設,會 MappingMode 設定為 RelativeToBoundingBox ,使 EndPoint 成為相對值。

相依性屬性資訊

識別碼欄位 EndPointProperty
中繼資料屬性設定為 true

適用於

另請參閱