CBitmap

#include <vstgui.h>

class CBitmap;

The pixmap class encapsulates various platform depended kinds of bitmaps. The pixmap objects are used to defined the graphic of a control object (such as a button, slider, ...).


CBitmap

1.0

CBitmap (int resourceID);

Create a pixmap from a resource identifier.

Example :

long MyEditor::open (void *ptr)
{
...
myPixmap = new CBitmap (kMyPixmapID);
...
}

CBitmap

1.0

CBitmap (CFrame &frame, int width, int height);

Create a pixmap with a given size.

frame -
width The pixmap's width.
height The pixmap's height.

~CBitmap

1.0

~CBitmap ();

Destroy a pixmap object.


draw

1.0

void draw (CDrawContext *drawContext, CRect &rect, const CPoint & offset = CPoint (0, 0));

Draw the pixmap using a given rect as output position and a given offset of its source pixmap.

drawContext -
rect The output position
offset An offset in the source pixmap.

[bitmap::draw]


drawTransparent

1.0

void drawTransparent (CDrawContext *context, CRect &rect, const CPoint & offset = CPoint (0, 0));

Same as previous function, but the color White (defined as 255, 255, 255) is used as transparency color.


drawAlphaBlend

2.2

void drawAlphaBlend (CDrawContext *pContext, CRect &rect,
const CPoint &offset = CPoint (0, 0), unsigned char alpha = 128);

Used to blend the bitmap with the background. Transparency effect can be regulated thanks to the alpha parameter.


getWidth

1.0

int getWidth ();

Returns the width of the pixmap.


getHeight

1.0

int getHeight ();

Returns the height of the pixmap.


forget

1.0

void forget ();

Try to destroy itself if no more reference on it.


remember

1.0

void remember ();

Add a reference to this pixmap.


getNbReference

2.0$

long getNbReference ();

Returns the number of references to this pixmap.


getHandle

1.0

void *getHandle ();

Returns the handle of the pixmap.


isLoaded

2.0

bool isLoaded ();

Returns true if the pixmap is loaded.


setTransparentColor

2.2

void setTransparentColor (const CColor color);

Sets the transparent color for the bitmap.


getTransparentColor

2.2

CColor getTransparentColor ();

Returns the transparent color for the bitmap.


setTransparencyMask

2.2

void setTransparencyMask (CDrawContext* pContext, const CPoint& offset);

Creates a mask bitmap with the transparent color of the bitmap.


Copyright ©2003 Steinberg Media Technologies GmbH. All Rights Reserved.