CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Bitmap

  1. #1
    Guest

    Bitmap

    I want to display a bitmap on the background of the mainframe in an MDI application.

    Could somebody help me...


  2. #2
    Join Date
    May 1999
    Posts
    67

    Subclass CMDIClient

    Subclass the CMDIClient member in CMainframe::OnCreateClient like this:

    BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
    {
    if (CMDIFrameWnd::OnCreateClient(lpcs, pContext))
    {
    m_wndMdiClient.SubclassWindow(m_hWndMDIClient);
    m_wndMdiClient.SetBitmap(IDB_MDI_BGND);
    return TRUE;
    }
    else
    return FALSE;
    }

    In this code m_wndMDIClient is a CWnd derived class (CMyMDIClient) which implemets the drawing of the background in CMyMDIClient::OnEraseBkgnd(). Here you can put your code to color the background or to display a bitmap.

    Hope this helps


  3. #3
    Join Date
    Apr 1999
    Posts
    5

    Re: Subclass CMDIClient

    Thanks itb worked.


  4. #4
    Join Date
    Feb 2006
    Posts
    2

    Re: Bitmap

    How we can change the position of the bitmap ?

    Thanks in advance

    Nico

  5. #5
    Join Date
    Feb 2006
    Posts
    2

    Re: Bitmap

    Could somebody help me... ???

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