Solved

FLicker problem.

Posted on 2004-04-16
4
568 Views
Last Modified: 2013-11-20
Hi,

   I am updating a HBITMAP's DIBSection at 15 times a scond. The resolution is 1280 by 1024. When I display this DIBSection on the View in the Document/view architecture, it flickers like crazy. What could be the problem?

The HBITMAP's DIBSection is stored in the Document and the image bits in the DIBsection are copied over 15 times a second. And the view does a StretchBlt to screen at OnDraw.

Regards,
Cedric.
0
Comment
Question by:pcssecure
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Expert Comment

by:caner_elci
ID: 10840512
Are you doing double buffering?
If not, try double-buffering.. Create another HBITMAP that has the same properties with your main HBITMAP.. then do your drawing and stuff offscreen, using that HBITMAP.. then BitBlt() it to your DC.. and continues this way.. always use offscreen drawing and just bitblt..

And take a look at this sample : http://www.codeproject.com/gdi/flickerfree.asp
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 10840546
Override OnEraseBkgnd in View class and return TRUE without calling of base class function.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 10840555
If your image doesn't fill all view client area, fill it in OnDraw using your own code, because after overriding if OnEraseBkgnd there is no more white view background supplied by this function.

The reason of flickering: every time you invalidate view client area, it is drawin by OnEraseBkgnd in white color, and immidiately after this OnDraw draws the image.
0
 

Author Comment

by:pcssecure
ID: 10840662
Overiding EraseBkGnd works....
Thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
repeatEnd java challenge 42 85
iSeries FTP Exit Program 8 173
Prevent this page from creating additional dialogs. 3 786
java ^ examples 8 75
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa‚Ķ
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question