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. Erratic GDI+ redrawing

Erratic GDI+ redrawing

Scheduled Pinned Locked Moved C / C++ / MFC
graphicscsharpc++visual-studiowinforms
3 Posts 2 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.
  • E Offline
    E Offline
    Egosphere
    wrote on last edited by
    #1

    I have this program I made to do some stuff I wanted. It uses plain win32 (no-MFC) and draws a bitmap in a window. Well, at first I was just using normal GDI and StretchBlt and it worked perfectly, but I wanted bicubic interpolation so I converted it to GDI+. So it basicly works fantastically and looks much more crisp, but for some reason the redrawing is highly erratic. When it needs to redraw (after another window was hiding or something like that), it sometimes work but more often it doesn't work and just displays an empty window. Sometimes, however, you can see the image flicker as the window gets unhidden and then the image immidiately disappears. Also, when you would move the window so some of it is out of the monitor's bounderies and then move it quickly into show again, the image would have empty reigons that do not get redrawn even after letting go of the window. And it's not just the image: If I make it also fill a rect on the whole client area, it would have the same erratic behavior. So, it's not just the image. Is GDI+ known to have these oddities when redrawing? I haven't updated my GDI+ libraries or DLLs; My DLL is just what came in XP and my libraries are just what came with VS.NET 2003. I'm starting up GDI+ and shutting it down all just fine, and I link everything just fine and I don't get any unresolved externals or anything, and it does work, except for this weird redrawing issues. Any help would be much aprreciated. Thanks.

    B 1 Reply Last reply
    0
    • E Egosphere

      I have this program I made to do some stuff I wanted. It uses plain win32 (no-MFC) and draws a bitmap in a window. Well, at first I was just using normal GDI and StretchBlt and it worked perfectly, but I wanted bicubic interpolation so I converted it to GDI+. So it basicly works fantastically and looks much more crisp, but for some reason the redrawing is highly erratic. When it needs to redraw (after another window was hiding or something like that), it sometimes work but more often it doesn't work and just displays an empty window. Sometimes, however, you can see the image flicker as the window gets unhidden and then the image immidiately disappears. Also, when you would move the window so some of it is out of the monitor's bounderies and then move it quickly into show again, the image would have empty reigons that do not get redrawn even after letting go of the window. And it's not just the image: If I make it also fill a rect on the whole client area, it would have the same erratic behavior. So, it's not just the image. Is GDI+ known to have these oddities when redrawing? I haven't updated my GDI+ libraries or DLLs; My DLL is just what came in XP and my libraries are just what came with VS.NET 2003. I'm starting up GDI+ and shutting it down all just fine, and I link everything just fine and I don't get any unresolved externals or anything, and it does work, except for this weird redrawing issues. Any help would be much aprreciated. Thanks.

      B Offline
      B Offline
      bmzhao
      wrote on last edited by
      #2

      Do draw in WM_PAINT , then the image always exist.

      E 1 Reply Last reply
      0
      • B bmzhao

        Do draw in WM_PAINT , then the image always exist.

        E Offline
        E Offline
        Egosphere
        wrote on last edited by
        #3

        Exactly what I'm doing. The Bitmap object is created in WM_PAINT as well so it does exist. Besides when it doesn't redraw well, if you move a window over it to make it redraw it will sometimes make it redraw well. I doubt it has anything to do with the image file itself, especially seeing how it acts oddly with rect filling too.

        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