Bitmap Dialog Class


Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame

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!

  • You must have javascript enabled in order to post comments.

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

Most Popular Programming Stories

More for Developers

RSS Feeds

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