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. GDI+ Offensive Flickering

GDI+ Offensive Flickering

Scheduled Pinned Locked Moved C / C++ / MFC
winformsgraphicsquestion
2 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.
  • S Offline
    S Offline
    Steven M Hunt
    wrote on last edited by
    #1

    Hi! I'm working on a program that opens JPEG images and i'm using GDI+ to do this. Everything was working fine until i tried to create a zoom feature. ScaleTransform() somehow causes horrible flickering. I'm using CMemDC for doulbe buffering which works fine if you view the image at 100% size. Even the scrollbars get sluggish the flickering is so bad. What could be causing this and is there a non-flickering way to do zoom? -- Steve

    J 1 Reply Last reply
    0
    • S Steven M Hunt

      Hi! I'm working on a program that opens JPEG images and i'm using GDI+ to do this. Everything was working fine until i tried to create a zoom feature. ScaleTransform() somehow causes horrible flickering. I'm using CMemDC for doulbe buffering which works fine if you view the image at 100% size. Even the scrollbars get sluggish the flickering is so bad. What could be causing this and is there a non-flickering way to do zoom? -- Steve

      J Offline
      J Offline
      John R Shaw
      wrote on last edited by
      #2

      I am not sure this is a GDI+ problem. Possible causes: 1) failure to over ride CWnd::OnEraseBkgnd() (a.k.a. WM_ERASEBKGND). 2) not drawing the entire client content a memory DC before blitting it to the screen (kind of slow). When displaying rectangular images that require updating/zooming etc..., I use the following method. 1) Override OnEraseBkgnd() to return TRUE. 2) In OnDraw(): (1) draw the image, (2) then call pDC->ExcludeClipRect() to exclude the drawn image rectangle from furthur drawing, then (3) draw the background (pDC->FillSolidRect(&rectClient, ::GetSysColor(COLOR_WINDOW));). There are aticles on GDI+ and flicker free drawing at codeproject. INTP

      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