Click to See Complete Forum and Search --> : How to display a bmp with a dialog adapted to it


alistairwpx
May 29th, 1999, 07:49 PM
I'like to display some graphic information during the beginning of my application. The templated dialog cannot display a bmp properly with different display configures. CDC seems helpful, but how do I get a CDC object at startup of my application? Thanks in advance.

June 1st, 1999, 01:40 AM
Why don't you use 'search' ?
just search with 'splash' (what you said is the splash window.. :)
or visit page "http://www.codeguru.com/dialog/splash.shtml".
Have a nice day !!

Jason Teagle
June 1st, 1999, 03:13 AM
As Anonymous said, you should use the splash screen code if possible; but the answer to your question is to override the OnPaint() (add a handler for WM_PAINT) of the dialogue box or window (OnDraw() for a CView-derived) and use the supplied CPaintDC (or the supplied pDC from OnDraw() ). Like this:

---void CMyDlgOrWnd::OnPaint()
{
CPaintDC dc(this); // device context used for painting

// Do your bitmap stuff here...

// Don't use bla bla.
}




---

or for CView-derived:

---void CMyView::OnDraw(CDC *pDC)
{
// Do your bitmap stuff here...
}




---

You will need to handle painting the bitmap to the screen by selecting it into a temporary DC and the BitBlt-ing (or StretchBlt-ing) it.

Wish you hadn't asked now?(!)

alistairwpx
June 2nd, 1999, 10:45 AM
Your answer is just what I have been looking for. Thank you very much.