class MASKING_DLL_DECLSPEC Image

Image is a class for putting static bitmaps on the screen.

Inheritance:

Image - Widget - Rect


Public Methods

[more] Image()
default constructor
[more] ~Image()
default destructor
[more]virtual void SetBitmap(const char* file)
Sets the images bitmap that is to be drawn.
[more]virtual void SetBitmap(const Bitmap& bmp)
See SetBitmap (const char *file)
[more]virtual void SetBitmap(int i)
See SetBitmap (const char *file)
[more]Bitmap& GetBitmap()
Returns the widget's bitmap
[more]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.
[more]virtual void SetBackgroundColor(const Color& bg)
The color with which the canvas is filled prior to drawing the bitmap.
[more]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()
[more]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
[more]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

[more]bool allocated
Tracks whether the widget has allocated its own memmory for the bitmap or if it just made a pointer
[more]Bitmap bmp
The actual bitmap
[more]bool masked
If true the bitmap is drawn with masked_blit() instead of blit()
[more]Color bg
The background colour

Protected Methods

[more]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()
[more]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.
obool allocated
Tracks whether the widget has allocated its own memmory for the bitmap or if it just made a pointer

oBitmap bmp
The actual bitmap

obool masked
If true the bitmap is drawn with masked_blit() instead of blit()

oColor bg
The background colour

ovirtual 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()

ovirtual void UpdateSize()
Adjusts the size of the widget to match the size of the bitmap

o Image()
default constructor

o ~Image()
default destructor

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

ovirtual void SetBitmap(const Bitmap& bmp)
See SetBitmap (const char *file)

ovirtual void SetBitmap(int i)
See SetBitmap (const char *file)

oBitmap& GetBitmap()
Returns the widget's bitmap

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

ovirtual 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).

ovirtual 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()

ovirtual 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

ovirtual 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++