CBitmap Class Reference

Encapsulates various platform depended kinds of bitmaps. More...

#include <vstgui.h>

Inheritance diagram for CBitmap:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~CBitmap ()
DEPRECATED_ATTRIBUTE void setTransparencyMask (CDrawContext *pContext, const CPoint &offset=CPoint(0, 0))

Protected Member Functions

 CBitmap ()
virtual void dispose ()
virtual bool loadFromResource (const CResourceDescription &resourceDesc)
virtual bool loadFromPath (const void *platformPath)

Protected Attributes

CResourceDescription resourceDesc
CCoord width
CCoord height
CColor transparentCColor
bool noAlpha
void * pHandle
void * pMask

Constructors



 CBitmap (const CResourceDescription &desc)
 Create a pixmap from a resource identifier.
 CBitmap (CFrame &frame, CCoord width, CCoord height)
 Create a pixmap with a given size.

CBitmap Methods



virtual void draw (CDrawContext *pContext, 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.
virtual void drawTransparent (CDrawContext *pContext, CRect &rect, const CPoint &offset=CPoint(0, 0))
virtual void drawAlphaBlend (CDrawContext *pContext, CRect &rect, const CPoint &offset=CPoint(0, 0), unsigned char alpha=128)
 Same as CBitmap::draw except that it uses the alpha value to draw the bitmap alpha blended.
CCoord getWidth () const
 get the width of the image
CCoord getHeight () const
 get the height of the image
bool isLoaded () const
 check if image is loaded
void * getHandle () const
 get a platform image object. Normally you don't need this
void setTransparentColor (const CColor color)
 set the color of the image which should not be drawn. Works only once on some implementations/platforms.
CColor getTransparentColor () const
 get the current transparent color
void setNoAlpha (bool state)
bool getNoAlpha () const
const CResourceDescriptiongetResourceDescription () const

Reference Counting Methods



virtual void forget ()
 decrease refcount and delete object if refcount == 0
virtual void remember ()
 increase refcount
long getNbReference () const
 get refcount

Message Methods



virtual CMessageResult notify (CBaseObject *sender, const char *message)

Detailed Description

Encapsulates various platform depended kinds of bitmaps.


Constructor & Destructor Documentation

CBitmap ( const CResourceDescription desc  ) 

Create a pixmap from a resource identifier.

CBitmap ( CFrame frame,
CCoord  width,
CCoord  height 
)

Create a pixmap with a given size.

~CBitmap (  )  [virtual]
CBitmap (  )  [protected]

Member Function Documentation

void dispose (  )  [protected, virtual]
void draw ( CDrawContext pContext,
CRect rect,
const CPoint offset = CPoint (0, 0) 
) [virtual]

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

void drawAlphaBlend ( CDrawContext pContext,
CRect rect,
const CPoint offset = CPoint (0, 0),
unsigned char  alpha = 128 
) [virtual]

Same as CBitmap::draw except that it uses the alpha value to draw the bitmap alpha blended.

void drawTransparent ( CDrawContext pContext,
CRect rect,
const CPoint offset = CPoint (0, 0) 
) [virtual]
virtual void forget (  )  [inline, virtual, inherited]

decrease refcount and delete object if refcount == 0

Reimplemented in CDrawContext.

void * getHandle (  )  const

get a platform image object. Normally you don't need this

CCoord getHeight (  )  const [inline]

get the height of the image

long getNbReference (  )  const [inline, inherited]

get refcount

bool getNoAlpha (  )  const [inline]
const CResourceDescription& getResourceDescription (  )  const [inline]
CColor getTransparentColor (  )  const [inline]

get the current transparent color

CCoord getWidth (  )  const [inline]

get the width of the image

bool isLoaded (  )  const

check if image is loaded

bool loadFromPath ( const void *  platformPath  )  [protected, virtual]
bool loadFromResource ( const CResourceDescription resourceDesc  )  [protected, virtual]
virtual CMessageResult notify ( CBaseObject sender,
const char *  message 
) [inline, virtual, inherited]
virtual void remember (  )  [inline, virtual, inherited]

increase refcount

void setNoAlpha ( bool  state  )  [inline]
void setTransparencyMask ( CDrawContext pContext,
const CPoint offset = CPoint (0, 0) 
)
void setTransparentColor ( const CColor  color  ) 

set the color of the image which should not be drawn. Works only once on some implementations/platforms.


Member Data Documentation

CCoord height [protected]
bool noAlpha [protected]
void* pHandle [protected]
void* pMask [protected]
CCoord width [protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Tue Sep 25 18:22:44 2012 for VSTGUI by  doxygen 1.6.1