wxStaticBitmap(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

✨ wxStaticBitmap ✨

okay bestie, welcome to wxStaticBitmap(3) β€” the Erlang module definition page for a static bitmap control πŸ’– it's giving "picture frame that just sits there and looks cute," and honestly? we stan.


🌸 NAME 🌸

wxStaticBitmap β€” a static bitmap control displays a bitmap. that's it, that's the whole vibe. a lil guy that shows a picture. πŸ–ΌοΈ


πŸŽ€ DESCRIPTION πŸŽ€

so here's the tea, bestie: on some platforms the native implementations are only meant for display of the small icons in the dialog boxes. like, tiny icon energy only. 😭

if you want to display larger images portably, you may use the generic implementation wxGenericStaticBitmap, declared in <wx/generic/statbmpg.h>. use that one if you're tryna go big fr fr.

also, notice this: for the best results, the size of the control should be the same as the size of the image displayed in it β€” which happens by default if it's not resized explicitly. lowkey elegant. otherwise, the behaviour depends on the platform πŸ‘€:

  • under MSW, the bitmap is drawn centred inside the control
  • everywhere else, it is drawn at the origin of the control

and you can use SetScaleMode() (not implemented in wx, so don't @ her) to control how the image is scaled inside the control.

heads up πŸ’… β€” SetScaleMode() is not implemented in wx. so that one's a look-don't-touch situation, no cap.

See: wxBitmap

this class is derived, and can use functions, from:

  • wxControl
  • wxWindow
  • wxEvtHandler

wxWidgets docs: wxStaticBitmap β€” iykyk ✨


πŸ¦‹ DATA TYPES πŸ¦‹

wxStaticBitmap() :: wx:wx_object().

yes she's an object. main character energy. πŸ‘‘


πŸ’… FUNCTIONS πŸ’…

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()}.

creation function, for two-step construction πŸ› οΈ

for the details, go peep new/4. she has the lore.


destroy(This :: wxStaticBitmap()) -> ok.

destroys the object πŸ’€ rip to her but she had a good run.


getBitmap(This) -> wxBitmap:wxBitmap()

when This :: wxStaticBitmap().

returns the bitmap currently used in the control 🫢

notice that this method can be called even if SetIcon() (not implemented in wx) had been used. so like, she's flexible bestie, she's not gonna gatekeep your bitmap.

See: setBitmap/2


new() -> wxStaticBitmap().

default constructor. the blank-slate era 🌱


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()}.

constructor, creating and showing a static bitmap control. not just making her β€” showing her off. iconic behavior βœ¨πŸ’–

See: create/5


setBitmap(This, Label) -> ok

when
    This :: wxStaticBitmap(),
    Label :: wxBitmap:wxBitmap().

sets the bitmap label 🌈 swap the pic, slay.

See: getBitmap/1


and that's the whole page bestie, no notes πŸ”₯ this little gem comes to you from Ericsson AB, wx 2.6 β€” mwah πŸ’‹ go forth and display ur bitmaps, periodt. πŸ‘‘πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from