A static bitmap control displays a bitmap.
Native implementations on some platforms are only meant for display of the small icons in the dialog boxes.
If you want to display larger images portably, you may use generic implementation GenericStaticBitmap declared in <wx/generic/statbmpg.h>.
Notice that for the best results, the size of the control should be the same as the size of the image displayed in it, as happens by default if it’s not resized explicitly. Otherwise, behaviour depends on the platform: under MSW, the bitmap is drawn centred inside the control, while elsewhere it is drawn at the origin of the control. You can use SetScaleMode
to control how the image is scaled inside the control.
See also
Default constructor. |
|
Creation function, for two-step construction. |
|
Returns the bitmap currently used in the control. |
|
Returns the icon currently used in the control. |
|
Returns the scale mode currently used in the control. |
|
Sets the bitmap label. |
|
Sets the label to the given icon. |
|
Sets the scale mode. |
wx.
StaticBitmap
(Control)¶Possible constructors:
StaticBitmap()
StaticBitmap(parent, id=ID_ANY, bitmap=NullBitmap, pos=DefaultPosition,
size=DefaultSize, style=0, name=StaticBitmapNameStr)
A static bitmap control displays a bitmap.
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
__init__ (self, parent, id=ID_ANY, bitmap=NullBitmap, pos=DefaultPosition, size=DefaultSize, style=0, name=StaticBitmapNameStr)
Constructor, creating and showing a static bitmap control.
parent (wx.Window) – Parent window. Should not be None
.
id (wx.WindowID) – Control identifier. A value of -1 denotes a default value.
bitmap (wx.BitmapBundle) –
pos (wx.Point) – Window position.
size (wx.Size) – Window size.
style (long) – Window style. See wx.StaticBitmap.
name (string) – Window name.
Bitmap label.
Create
(self, parent, id=ID_ANY, bitmap=NullBitmap, pos=DefaultPosition, size=DefaultSize, style=0, name=StaticBitmapNameStr)¶Creation function, for two-step construction.
For details see wx.StaticBitmap.
parent (wx.Window) –
id (wx.WindowID) –
bitmap (wx.BitmapBundle) –
pos (wx.Point) –
size (wx.Size) –
style (long) –
name (string) –
bool
GetBitmap
(self)¶Returns the bitmap currently used in the control.
Notice that this method can be called even if SetIcon
had been used.
See also
GetClassDefaultAttributes
(variant=WINDOW_VARIANT_NORMAL)¶variant (WindowVariant) –
GetIcon
(self)¶Returns the icon currently used in the control.
Notice that this method can only be called if SetIcon
had been used: an icon can’t be retrieved from the control if a bitmap had been set (using wx.StaticBitmap.SetBitmap
).
See also
GetScaleMode
(self)¶Returns the scale mode currently used in the control.
New in version 4.1/wxWidgets-3.1.0.
See also
SetBitmap
(self, label)¶Sets the bitmap label.
label (wx.BitmapBundle) – The new bitmap.
See also
SetScaleMode
(self, scaleMode)¶Sets the scale mode.
scaleMode (ScaleMode) – Controls how the bitmap is scaled inside the control.
New in version 4.1/wxWidgets-3.1.0.
Note
Currently only the generic implementation supports all scaling modes. You may use generic implementation GenericStaticBitmap declared in <wx/generic/statbmpg.h> in all ports.
See also