How to reduce Flickering ?
-
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
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] -
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
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
-
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
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
-
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
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
-
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]+1 for using the CP search instead of google! :-D
Watched code never compiles.
-
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
this method works very well for drawing at high rates
-
+1 for using the CP search instead of google! :-D
Watched code never compiles.
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] -
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