CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Posts
    2

    How to display a bmp with a dialog adapted to it

    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.


  2. #2
    Guest

    Re: How to display a bmp with a dialog adapted to it

    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 !!


  3. #3
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: How to display a bmp with a dialog adapted to it

    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?(!)



    --
    Jason Teagle
    [email protected]

  4. #4
    Join Date
    May 1999
    Posts
    2

    Re: How to display a bmp with a dialog adapted to it

    Your answer is just what I have been looking for. Thank you very much.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured