?
Solved

FLicker problem.

Posted on 2004-04-16
4
Medium Priority
?
585 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

719 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