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 reduce Flickering ?

How to reduce Flickering ?

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
9 Posts 7 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.
  • 0 Offline
    0 Offline
    002comp
    wrote on last edited by
    #1

    Hello Friends I am using drawImage from GDIPLUS in OnPaint().And Mine image is getting flickered too much.How can i reduce it? Thanks & Regards Yogesh

    C C S 3 Replies Last reply
    0
    • 0 002comp

      Hello Friends I am using drawImage from GDIPLUS in OnPaint().And Mine image is getting flickered too much.How can i reduce it? Thanks & Regards Yogesh

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

      You may use double buffering technique. Have a look at (one of) the following CodeProject articles: http://www.codeproject.com/info/search.aspx?artkw=double+buffering&sbo=kw[^]. :)

      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.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      M 1 Reply Last reply
      0
      • 0 002comp

        Hello Friends I am using drawImage from GDIPLUS in OnPaint().And Mine image is getting flickered too much.How can i reduce it? Thanks & Regards Yogesh

        C Offline
        C Offline
        Cool_Dev
        wrote on last edited by
        #3

        in addition, handle WM_ERASEBACKGROUND message and simply return TRUE from there without calling base class's message handler. This will discard the flickering due to background painting. Remember, you have to paint the background from OnPaint (use double buffering :) )

        modified on Thursday, March 24, 2011 9:13 AM

        N 1 Reply Last reply
        0
        • C Cool_Dev

          in addition, handle WM_ERASEBACKGROUND message and simply return TRUE from there without calling base class's message handler. This will discard the flickering due to background painting. Remember, you have to paint the background from OnPaint (use double buffering :) )

          modified on Thursday, March 24, 2011 9:13 AM

          N Offline
          N Offline
          Nitheesh George
          wrote on last edited by
          #4

          Hi Also create a memory DC and select this image to this DC. And use this DC as the Source in API BitBlt, StretchBitBlt etc. Hope this helps Nitheesh George http://www.simpletools.co.in

          A 1 Reply Last reply
          0
          • 0 002comp

            Hello Friends I am using drawImage from GDIPLUS in OnPaint().And Mine image is getting flickered too much.How can i reduce it? Thanks & Regards Yogesh

            S Offline
            S Offline
            Stephen Hewitt
            wrote on last edited by
            #5

            The first step (before investigating possible solutions, such as double buffering) is to figure out why the flicking is occuring. Can you provide any more details? When does it flicker? Does the image resize if the window size is altered? Are you using the CS_HREDRAW and CS_VREDRAW[^] class styles?

            Steve

            0 1 Reply Last reply
            0
            • C CPallini

              You may use double buffering technique. Have a look at (one of) the following CodeProject articles: http://www.codeproject.com/info/search.aspx?artkw=double+buffering&sbo=kw[^]. :)

              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.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              M Offline
              M Offline
              Maximilien
              wrote on last edited by
              #6

              +1 for using the CP search instead of google! :-D

              Watched code never compiles.

              C 1 Reply Last reply
              0
              • N Nitheesh George

                Hi Also create a memory DC and select this image to this DC. And use this DC as the Source in API BitBlt, StretchBitBlt etc. Hope this helps Nitheesh George http://www.simpletools.co.in

                A Offline
                A Offline
                Albert Holguin
                wrote on last edited by
                #7

                this method works very well for drawing at high rates

                1 Reply Last reply
                0
                • M Maximilien

                  +1 for using the CP search instead of google! :-D

                  Watched code never compiles.

                  C Offline
                  C Offline
                  CPallini
                  wrote on last edited by
                  #8

                  Thanks. :laugh:

                  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.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                  [My articles]

                  1 Reply Last reply
                  0
                  • S Stephen Hewitt

                    The first step (before investigating possible solutions, such as double buffering) is to figure out why the flicking is occuring. Can you provide any more details? When does it flicker? Does the image resize if the window size is altered? Are you using the CS_HREDRAW and CS_VREDRAW[^] class styles?

                    Steve

                    0 Offline
                    0 Offline
                    002comp
                    wrote on last edited by
                    #9

                    hi,Its Flickering whenever some update happen like if i zoom,scroll etc. It looks like tht OnPaint is calling and that is makeing flickering bcoz onpaint m using drawimage(). Regards Yogesh

                    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