Bitmap Class Reference

upon destruction of this object More...

List of all members.

Public Member Functions

 Bitmap (const SmartUtil::tstring &filePath)
 RAII Constructor loading a bitmap from a file on disc.
 Bitmap (unsigned resourceId)
 RAII Constructor loading a bitmap from a resource ID.
 Bitmap (HBITMAP bitmap)
 RAII Constructor taking a HBITMAP.
HBITMAP getBitmap () const
 Getter for the underlaying HBITMAP.
Point getBitmapSize () const
 Returns the Bitmaps size.
BitmapPtr resize (const Point &newSize) const
 Resize the given Bitmap.
 ~Bitmap ()
 Frees the contained HBITMAP.

Static Public Member Functions

static Point getBitmapSize (HBITMAP Bitmap)
 Returns the given HBITMAP size.


Detailed Description

upon destruction of this object

Use this class if you need RAII semantics encapsulating an HBITMAP


Constructor & Destructor Documentation

Bitmap ( HBITMAP  bitmap  )  [explicit]

RAII Constructor taking a HBITMAP.

Note!
Class takes "control" of HBITMAP meaning it will automatically free the contained HBITMAP upon destruction

Bitmap ( unsigned  resourceId  )  [explicit]

RAII Constructor loading a bitmap from a resource ID.

Note!
Class takes "control" of HBITMAP meaning it will automatically free the contained HBITMAP upon destruction

Bitmap ( const SmartUtil::tstring &  filePath  )  [explicit]

RAII Constructor loading a bitmap from a file on disc.

Note!
Class takes "control" of HBITMAP meaning it will automatically free the contained HBITMAP upon destruction
Note!
The Pocket PC (SmartPhone, WindowsMobile, Windows CE) version of this function support loading of several different types of images:

~Bitmap (  ) 

Frees the contained HBITMAP.

Frees the contained HBITMAP meaning it will no longer be accessible or it will be destroyed


Member Function Documentation

HBITMAP getBitmap (  )  const

Getter for the underlaying HBITMAP.

Use when you need to access the underlaying HBITMAP

Point getBitmapSize ( HBITMAP  Bitmap  )  [static]

Returns the given HBITMAP size.

Returns the size (width = x, height = y) in pixels of the HBITMAP

Point getBitmapSize (  )  const

Returns the Bitmaps size.

Returns the size (width = x, height = y) in pixels of the Bitmap

BitmapPtr resize ( const Point newSize  )  const

Resize the given Bitmap.

This function is IMMUTABLE meaning it will not modify the given bitmap at all but rather return a new Bitmap containing the resized Bitmap.

Back to SmartWin website
SourceForge.net Logo