檢視原始碼 wxStaticBitmap (wx v2.4.3)
靜態點陣圖控制項用於顯示點陣圖。
在某些平台上,原生實作僅適用於在對話方塊中顯示小型圖示。
如果想要可移植地顯示較大的圖像,可以使用在 <wx/generic/statbmpg.h> 中宣告的通用實作 wxGenericStaticBitmap。
請注意,為了獲得最佳效果,控制項的大小應該與其中顯示的圖像大小相同,如果沒有明確調整大小,則預設會如此。否則,行為取決於平台:在 MSW 下,點陣圖會繪製在控制項的中心,而在其他地方則會繪製在控制項的原點。您可以使用 SetScaleMode()
(wx 中未實作)來控制圖像在控制項內部的縮放方式。
參見: wxBitmap
此類別繼承自,且可以使用以下類別中的函式:
wxWidgets 文件: wxStaticBitmap
摘要
類型
-type wxStaticBitmap() :: wx:wx_object().
函式
-spec create(This, Parent, Id, Label) -> boolean() when This :: wxStaticBitmap(), Parent :: wxWindow:wxWindow(), Id :: integer(), Label :: wxBitmap:wxBitmap().
-spec create(This, Parent, Id, Label, [Option]) -> boolean() when This :: wxStaticBitmap(), Parent :: wxWindow:wxWindow(), Id :: integer(), Label :: wxBitmap:wxBitmap(), Option :: {pos, {X :: integer(), Y :: integer()}} | {size, {W :: integer(), H :: integer()}} | {style, integer()}.
建立函式,用於兩步驟建構。
詳情請參閱 new/4
。
-spec destroy(This :: wxStaticBitmap()) -> ok.
銷毀物件
-spec getBitmap(This) -> wxBitmap:wxBitmap() when This :: wxStaticBitmap().
傳回控制項目前使用的點陣圖。
請注意,即使已使用 SetIcon()
(wx 中未實作)也可以呼叫此方法。
參見: setBitmap/2
-spec new() -> wxStaticBitmap().
預設建構子。
-spec new(Parent, Id, Label) -> wxStaticBitmap() when Parent :: wxWindow:wxWindow(), Id :: integer(), Label :: wxBitmap:wxBitmap().
-spec new(Parent, Id, Label, [Option]) -> wxStaticBitmap() when Parent :: wxWindow:wxWindow(), Id :: integer(), Label :: wxBitmap:wxBitmap(), Option :: {pos, {X :: integer(), Y :: integer()}} | {size, {W :: integer(), H :: integer()}} | {style, integer()}.
建構子,建立並顯示靜態點陣圖控制項。
參見: create/5
-spec setBitmap(This, Label) -> ok when This :: wxStaticBitmap(), Label :: wxBitmap:wxBitmap().
設定點陣圖標籤。
參見: getBitmap/1