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 to Show a picture in SDI Application

How to Show a picture in SDI Application

Scheduled Pinned Locked Moved C / C++ / MFC
graphicstutorial
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
    santhoshv84
    wrote on last edited by
    #1

    Hi Friends, I am using an SDI Application, i want to show a BITMAP image in the SDI, How to do that.

    Thanks and Regards. SANTHOSH V

    CPalliniC H 2 Replies Last reply
    0
    • S santhoshv84

      Hi Friends, I am using an SDI Application, i want to show a BITMAP image in the SDI, How to do that.

      Thanks and Regards. SANTHOSH V

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      for instance (inside OnDraw method of your View class):

      ...
      CBitmap *pOldBmp, bmp;
      bmp.LoadBitmap(IDB_MY_BITMAP);
      CRect rc;
      GetClientRect(&rc);

      CDC dcMem;
      dcMem.CreateCompatibleDC(pDC);
      pOldBmp = dcMem.SelectObject(&bmp);
      pDC->BitBlt(0,0,rc.right,rc.bottom, &dcMem,0,0,SRCCOPY);
      dcMem.SelectObject(&pOldBmp);
      ...

      Please note: error handling and efficience tuning left to the reader. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      In testa che avete, signor di Ceprano?

      1 Reply Last reply
      0
      • S santhoshv84

        Hi Friends, I am using an SDI Application, i want to show a BITMAP image in the SDI, How to do that.

        Thanks and Regards. SANTHOSH V

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        Or CImage m_Image; m_Image.Load(_T("c:\\1.jpg")); or 2.bmp m_Image.BitBlt(1024,768,dc._hDC); ...

        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