Bitmap Dialog Class


This class is a "spin off" of the CGTetris application.

There is only one public method:
BOOL SetBitmap(UINT uResource, int Type = CBitmapDialog::BITMAP_TILE);
Type might be one of the following types:
CBitmapDialog::BITMAP_TILE       // tile the bitmap to fill the dialog
CBitmapDialog::BITMAP_STRETCH    // stretch the bitmap so it will fit to the dialog
CBitmapDialog::BITMAP_CENTER     // center the bitmap inside the dialog


The source consists of 6 files:
  1. add all these files to your project.
  2. create a dialog template
  3. add a bitmap resource that you want for the background
  4. create a class for the dialog template
  5. change all occurencies of CDialog in your dialog's .cpp and .h to CBitmapDialog
  6. don't forget to insert "BitmapDialog.h" in either your dialog's header file or in "stdafx.h"
  7. call the CBitmapDialog::SetBitmap() method (in your WM_INITDIALOG handler for instance)
  8. compile your project

Download demo project - 41 KB

Download source - 11 KB


  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • As all sorts of data becomes available for storage, analysis and retrieval - so called 'Big Data' - there are potentially huge benefits, but equally huge challenges...
  • The agile organization needs knowledge to act on, quickly and effectively. Though many organizations are clamouring for "Big Data", not nearly as many know what to do with it...
  • Cloud-based integration solutions can be confusing. Adding to the confusion are the multiple ways IT departments can deliver such integration...

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date