class MASKING_DLL_DECLSPEC Image
Image is a class for putting static bitmaps on the screen.
Inheritance:
Public Methods
-
Image()
- default constructor
-
~Image()
- default destructor
-
virtual void SetBitmap(const char* file)
- Sets the images bitmap that is to be drawn.
-
virtual void SetBitmap(const Bitmap& bmp)
- See SetBitmap (const char *file)
-
virtual void SetBitmap(int i)
- See SetBitmap (const char *file)
-
Bitmap& GetBitmap()
- Returns the widget's bitmap
-
virtual void SetMasked(bool m)
- Pass true if you want the bitmap to be drawn as a sprite, that is if you want transparent areas to be skipped.
-
virtual void SetBackgroundColor(const Color& bg)
- The color with which the canvas is filled prior to drawing the bitmap.
-
virtual void Setup(int x, int y, int w, int h, int key, int flags, int i, bool masked = false, const Color& = -1)
- A shortcut function for Widget::Setup(), SetBitmap(), SetMasked() and SetBackgroundColor()
-
virtual void Setup(int x, int y, int w, int h, int key, int flags, const char* file, bool masked = false, const Color& = -1)
- See above
-
virtual void Setup(int x, int y, int w, int h, int key, int flags, const Bitmap& bmp, bool masked = false, const Color& = -1)
- See above
Protected Fields
-
bool allocated
- Tracks whether the widget has allocated its own memmory for the bitmap or if it just made a pointer
-
Bitmap bmp
- The actual bitmap
-
bool masked
- If true the bitmap is drawn with masked_blit() instead of blit()
-
Color bg
- The background colour
Protected Methods
-
virtual void Draw(Bitmap &canvas)
- Optionally clears the canvas to the background colour and blits the bitmap onto the canvas either with normal blit() or with masked_blit()
-
virtual void UpdateSize()
- Adjusts the size of the widget to match the size of the bitmap
Documentation
Image is a class for putting static bitmaps on the screen.
It is capable of loading its bitmap from a file on disk or from the skin and it can draw masked
bitmaps with transparent areas that can optionally be filled with a user selected colour.
In previous version of MASkinG this widget was called MASBitmap but the name had to be changed
for obvious reasons.
bool allocated
-
Tracks whether the widget has allocated its own memmory for the bitmap or if it just made a pointer
Bitmap bmp
-
The actual bitmap
bool masked
-
If true the bitmap is drawn with masked_blit() instead of blit()
Color bg
-
The background colour
virtual void Draw(Bitmap &canvas)
-
Optionally clears the canvas to the background colour and blits the bitmap onto the canvas either with normal blit() or with masked_blit()
virtual void UpdateSize()
-
Adjusts the size of the widget to match the size of the bitmap
Image()
-
default constructor
~Image()
-
default destructor
virtual void SetBitmap(const char* file)
-
Sets the images bitmap that is to be drawn. The bitmap can either be loaded from a file (the format must be BMP, PCX, TGA or LBM), copied from an existing bitmap or loaded from the skin bitmap array. Note that the size of the widget is automatically adjusted to the size of the bitmap if the D_AUTOSIZE flag is set which it is unless you explicitly turn it off.
virtual void SetBitmap(const Bitmap& bmp)
-
See SetBitmap (const char *file)
virtual void SetBitmap(int i)
-
See SetBitmap (const char *file)
Bitmap& GetBitmap()
-
Returns the widget's bitmap
virtual void SetMasked(bool m)
-
Pass true if you want the bitmap to be drawn as a sprite, that is if you want transparent areas to be skipped. Default is false.
virtual void SetBackgroundColor(const Color& bg)
-
The color with which the canvas is filled prior to drawing the bitmap. This is obviously relevant only when masked drawing is turned on or the bitmap is smaller than the widget. Even if masked is on it is not necessary to set a background colour, you should however do that if you plan to dynamically change the widget's bitmap during the execution of the program. The default colour is -1 (i.e. no colour).
virtual void Setup(int x, int y, int w, int h, int key, int flags, int i, bool masked = false, const Color& = -1)
-
A shortcut function for Widget::Setup(), SetBitmap(), SetMasked() and SetBackgroundColor()
virtual void Setup(int x, int y, int w, int h, int key, int flags, const char* file, bool masked = false, const Color& = -1)
-
See above
virtual void Setup(int x, int y, int w, int h, int key, int flags, const Bitmap& bmp, bool masked = false, const Color& = -1)
-
See above
- Direct child classes:
- Wallpaper
Alphabetic index Hierarchy of classes
Back to front page
|
page generated with DOC++