Bitmap Dialog Class

WEBINAR: On-demand webcast

How to Boost Database Development Productivity on Linux, Docker, and Kubernetes with Microsoft SQL Server 2017 REGISTER >

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

Usage

The source consists of 6 files:
BitmapDialog.[h|cpp]
dib256.[h|cpp]
dibpal.[h|cpp]
  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



Comments

  • WORK like a charm

    Posted by gap001 on 10/08/2005 08:34am

    awesome,

    Reply
  • readonly

    Posted by Legacy on 10/21/2003 12:00am

    Originally posted by: bruno leclerc

    In OnCtlColor function, I would like to know if the ctrl is readonly or not. How can I do ? GetWindowLong with ES_READONLY seems to not work.
    Thanks

    Reply
  • Scroll Redraw background

    Posted by Legacy on 04/08/2003 12:00am

    Originally posted by: Marcus Vinicius

    Hello,

    I need make a program that have a background with height superior at the window. I made the union of two projects (This and a scrolling project) but when i roll the scroll the background can�t be redrawing.

    Good Bytes,

    OctogonEyes (Marcus Vinicius Antunes - Brazil)

    Reply
  • Having a problem over time

    Posted by Legacy on 04/04/2003 12:00am

    Originally posted by: Bill Hamlin

    I've been using this for over a year now and it works great, except for one little problem. Something happens over time that causes the whole Windows processing of colors to go haywire.

    For one thing the BMPDLG app looks awful and has to be restarted. But if I do something else, like rightclick on an item in the taskbar along the bottom, the popup menu has the wrong colors. Everything is just a little funky, and doesn't get cleared until I restart the machine.

    Has anyone else seen this, and what do you suppose is happening?

    Thanks,
    Bill Hamlin

    Reply
  • COPYRIGHT

    Posted by Legacy on 02/20/2003 12:00am

    Originally posted by: Chris Kohlhepp

    Hello All,

    I noticed that the header files of the bitmal dialog class contain the following comment : "This is free software. You may redistribute it by any means providing it is not sold for profit without the authors written consent." Kindly allow me to clarify this. Every author at codeguru is giving consent for anyone to use their code even - in commercial applications, i.e "sold for profit". People may, however, not sell the source code for example to re-print it in a book, etc. without the author's permission as the author does retain copyright.

    Just in case anybody was wondering...

    Chris Kohlhepp

    Reply
  • Bitmap Dialog Class

    Posted by Legacy on 12/11/2002 12:00am

    Originally posted by: Jyoti

    The given source code doesn't work in Win CE.(eVC++ 3.0)
    
    It doesn't recognize the functions in the dib256.cpp(especially the bitmap related fns such as GetDIBits() etc.)
    But these work perfectly fine in VC ++ 6.0.

    What should be done to get the code working in Win CE (eVC ++ 3.0)?

    Reply
  • thank you..

    Posted by Legacy on 10/04/2002 12:00am

    Originally posted by: sharkren

    very much

    Reply
  • Thanks

    Posted by Legacy on 09/20/2002 12:00am

    Originally posted by: MT

    Thanks for the code. Good job.

    Reply
  • mulitple images on the dialog box

    Posted by Legacy on 09/16/2002 12:00am

    Originally posted by: bvictor

    How do we load two or three separate images(bitmaps or other formats) on the dialog box ?

    Reply
  • Bitmap error

    Posted by Legacy on 04/06/2002 12:00am

    Originally posted by: Johnny

    I cannot figure this thing out....It keeps on spitting out an error " fatal error C1083: Cannot open include file: 'BitmapDialog.h': No such file or directory" I have BitmapDialog.h inside of the header files. Not to sure what i should do. Any suggestions?

    Reply
  • Loading, Please Wait ...

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