Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How can we get pictures in Mainframe

How can we get pictures in Mainframe

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    saravana001
    wrote on last edited by
    #1

    Hi all, how to add pictures to the mainframe as my mainframe is opening with nothing in it.can any one plz tell me clearly about this,,, thanks in advance, Saravana...

    T I 2 Replies Last reply
    0
    • S saravana001

      Hi all, how to add pictures to the mainframe as my mainframe is opening with nothing in it.can any one plz tell me clearly about this,,, thanks in advance, Saravana...

      T Offline
      T Offline
      ThatsAlok
      wrote on last edited by
      #2

      saravana001 wrote:

      how to add pictures to the mainframe as my mainframe is opening with nothing in it.can any one plz tell me clearly about this,,,

      how are putting you image in MainFrame Window, i.e. View Window. have you overidden the OnDraw function for drawing image on View Window. you can use this class for display variety of image format on windows http://www.codeproject.com/bitmap/extendedbitmap2.asp[^]

      "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
      Never mind - my own stupidity is the source of every "problem" - Mixture

      cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

      1 Reply Last reply
      0
      • S saravana001

        Hi all, how to add pictures to the mainframe as my mainframe is opening with nothing in it.can any one plz tell me clearly about this,,, thanks in advance, Saravana...

        I Offline
        I Offline
        Iain Clarke Warrior Programmer
        wrote on last edited by
        #3

        I have an MDI app - and I wanted a less boring backdrop. The trick is to subclass the MDI Frame window - and then override WM_ERASEBKGND. The below code uses CSubclassWnd by Paul DiLascia - you should be able to search for in from an old MSJ article on the web. Good luck, Iain.

        int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
        {
        if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
        return -1;
        m_Backdrop.Install (m_hWndMDIClient, IDB_MIDAS, 32);
        ....
        return 0;
        }

        class CUIMDIBackdrop : public CSubclassWnd
        {
        public:
        CUIMDIBackdrop ();
        ~CUIMDIBackdrop ();
        BOOL Install (HWND hWndMDIClient, UINT idBitmap, int nMargin);

        protected:
        virtual LRESULT WindowProc(UINT msg, WPARAM wp, LPARAM lp);
        };

        CUIMDIBackdrop::CUIMDIBackdrop ()
        {
        }

        CUIMDIBackdrop::~CUIMDIBackdrop ()
        {
        }

        BOOL CUIMDIBackdrop::Install (HWND hWndMDIClient, UINT idBitmap, int nMargin)
        {
        // load resources and other graphics stuff here
        return HookWindow (hWndMDIClient);
        }

        LRESULT CUIMDIBackdrop::WindowProc(UINT msg, WPARAM wp, LPARAM lp)
        {
        if (msg != WM_ERASEBKGND)
        return CSubclassWnd::WindowProc(msg, wp, lp);

        HDC hDC = (HDC) wp;
        CDC \*pDC = CDC::FromHandle (hDC);
        
        CRect rc;
        ::GetClientRect (m\_hWnd, &rc);
        
        // do pretty stuff here
        return TRUE;
        

        }

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups