Search documentation of wx

# wxStaticBitmap (wx v2.4.3.1)

View Source

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 wxGenericStaticBitmap 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()` (not implemented in wx) to control how the image is scaled inside the control.

See: `wxBitmap`

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

- `wxControl`

- `wxWindow`

- `wxEvtHandler`

wxWidgets docs: wxStaticBitmap

# Summary

## Types

wxStaticBitmap()

## Functions

create(This, Parent, Id, Label)

Equivalent to `create(This, Parent, Id, Label, [])`.

create/5

Creation function, for two-step construction.

destroy(This)

Destroys the object

getBitmap(This)

Returns the bitmap currently used in the control.

new()

Default constructor.

new(Parent, Id, Label)

Equivalent to `new(Parent, Id, Label, [])`.

new/4

Constructor, creating and showing a static bitmap control.

setBitmap(This, Label)

Sets the bitmap label.

# Types

# wxStaticBitmap()

    -type wxStaticBitmap() :: wx:wx_object().

# Functions

# create(This, Parent, Id, Label)

    -spec create(This, Parent, Id, Label) -> boolean()
                    when
                        This :: wxStaticBitmap(),
                        Parent :: wxWindow:wxWindow(),
                        Id :: integer(),
                        Label :: wxBitmap:wxBitmap().

Equivalent to `create(This, Parent, Id, Label, [])`.

# create/5

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

Creation function, for two-step construction.

For details see `new/4`.

# destroy(This)

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

Destroys the object

# getBitmap(This)

    -spec 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.

See: `setBitmap/2`

# new()

    -spec new() -> wxStaticBitmap().

Default constructor.

# new(Parent, Id, Label)

    -spec new(Parent, Id, Label) -> wxStaticBitmap()
                 when Parent :: wxWindow:wxWindow(), Id :: integer(), Label :: wxBitmap:wxBitmap().

Equivalent to `new(Parent, Id, Label, [])`.

# new/4

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

Constructor, creating and showing a static bitmap control.

See: `create/5`

# setBitmap(This, Label)

    -spec setBitmap(This, Label) -> ok when This :: wxStaticBitmap(), Label :: wxBitmap:wxBitmap().

Sets the bitmap label.

See: `getBitmap/1`