檢視原始碼 wxGraphicsGradientStops (wx v2.4.3)

代表用於 CreateLinearGradientBrush 和 CreateRadialGradientBrush 的 wxGraphicGradientStop 值集合。

停止點會依位置順序維護。如果加入兩個或更多具有相同位置的停止點,則後加入的停止點會排在後面。這對於在顏色漸層中產生不連續性很有用。

請注意,此類別為一次寫入,一旦新增停止點後,您就無法修改它們。

自:2.9.1

wxWidgets 文件:wxGraphicsGradientStops

摘要

函式

新增一個新的停止點。

銷毀物件

傳回停止點的數量。

傳回結束顏色。

傳回開始顏色。

傳回指定索引的停止點。

等同於 new([])

使用給定的邊界顏色初始化漸層停止點。

將結束顏色設定為 col

將開始顏色設定為 col

類型

連結到此類型

wxGraphicsGradientStops()

檢視原始碼
-type wxGraphicsGradientStops() :: wx:wx_object().

函式

-spec add(This, Col, Pos) -> ok
             when This :: wxGraphicsGradientStops(), Col :: wx:wx_colour(), Pos :: number().

新增一個新的停止點。

-spec destroy(This :: wxGraphicsGradientStops()) -> ok.

銷毀物件

-spec getCount(This) -> integer() when This :: wxGraphicsGradientStops().

傳回停止點的數量。

-spec getEndColour(This) -> wx:wx_colour4() when This :: wxGraphicsGradientStops().

傳回結束顏色。

-spec getStartColour(This) -> wx:wx_colour4() when This :: wxGraphicsGradientStops().

傳回開始顏色。

-spec item(This, N) -> {wx:wx_colour4(), float()} when This :: wxGraphicsGradientStops(), N :: integer().

傳回指定索引的停止點。

-spec new() -> wxGraphicsGradientStops().

等同於 new([])

-spec new([Option]) -> wxGraphicsGradientStops()
             when Option :: {startCol, wx:wx_colour()} | {endCol, wx:wx_colour()}.

使用給定的邊界顏色初始化漸層停止點。

使用 startCol 指定的開始顏色和 endCol 指定的結束顏色建立一個 wxGraphicsGradientStops 實例。

連結到此函式

setEndColour(This, Col)

檢視原始碼
-spec setEndColour(This, Col) -> ok when This :: wxGraphicsGradientStops(), Col :: wx:wx_colour().

將結束顏色設定為 col

連結到此函式

setStartColour(This, Col)

檢視原始碼
-spec setStartColour(This, Col) -> ok when This :: wxGraphicsGradientStops(), Col :: wx:wx_colour().

將開始顏色設定為 col