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. displaying pictures

displaying pictures

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 Posts 4 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.
  • A Offline
    A Offline
    Amr Shahin
    wrote on last edited by
    #1

    hi everyone im developing a program that among other things draws images on a form; but im having this little problem when i draw a large image and move the window several times it doesn't display the image or sometimes it displays part of it is there anyway to fix this ?

    C H 2 Replies Last reply
    0
    • A Amr Shahin

      hi everyone im developing a program that among other things draws images on a form; but im having this little problem when i draw a large image and move the window several times it doesn't display the image or sometimes it displays part of it is there anyway to fix this ?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You need to draw the image in your OnPaint handler, then it will be drawn whenever your form needs to refresh itself. Christian Graus - Microsoft MVP - C++

      W 1 Reply Last reply
      0
      • C Christian Graus

        You need to draw the image in your OnPaint handler, then it will be drawn whenever your form needs to refresh itself. Christian Graus - Microsoft MVP - C++

        W Offline
        W Offline
        Waldermort
        wrote on last edited by
        #3

        Also check that you are deleting all your GDI objects correctly. If your app runs out of them it can cause unusual display problems. A good way to check for GDI leaks is watching the GDI object count in the Task Manager, finding them is another problem altogether.

        1 Reply Last reply
        0
        • A Amr Shahin

          hi everyone im developing a program that among other things draws images on a form; but im having this little problem when i draw a large image and move the window several times it doesn't display the image or sometimes it displays part of it is there anyway to fix this ?

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

          maybe it is some helpful to you CImage m_Image; m_Image.Load(Filename); In funtion Onpaint(WM_PAINT) OnPaint() { CPaint DC(this) m_Image.BitBlt(dc.m_hDC,CRect(0,0,800,600),CPoint(0,0)); // m_Image.StretchBlt(GetDC()->m_hDC,CRect(0,0,200,200)/*Dest*/,CRect(0,0,800,600)); }

          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