Re: Solving the repaint problem?
- From: "Peter Olcott" <NoSpam@xxxxxxxxxxxxx>
- Date: Sun, 19 Aug 2007 22:29:44 -0500
"David Webber" <dave@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:%23eT7$%23q4HHA.5740@xxxxxxxxxxxxxxxxxxxxxxx
"Peter Olcott" <NoSpam@xxxxxxxxxxxxx> wrote in message
news:nx2yi.95509$6K3.77299@xxxxxxxxxxxxxxx
In Java programming the entire solution is summed up in a
single phrase: [double buffering].
Double buffering is a concept independent of "Java
programming" and of any other programming language.
This essential idea carries over to MFC.
It is independent of Java or MFC or for that matter
FORTRAN
If one does all of the slow operations in an offscreen
memory bitmap, then no matter how slow these operations
are, they can not cause any possible screen flicker
because they never directly touch the screen.
Yes.
The only remaining step in Java programming is to quickly
paint the screen with this offscreen bitmap at the
appropriate times.
Again the concept is completely independent of Java.
In MFC this would translate into a BitBlt operation.
It's a BitBlt operation in any language which uses the
Windows API.
The additional complexity of MFC programming is that the
framework does more than one explicitly tells it to do,
hence the need to over-ride the OnEraseBkgnd(CDC* pDC)
function.
The MFC framework provides default responses to
WM_ERASEBKGND and WM_PAINT messages. You are expected to
respond to both of those in any Windows program, whatever
language it is written in, and so I'm not sure what you
mean by MFC doing "more than one explicitly tells it to ".
It is part of the design of Windows.
You can respond to WM_PAINT using double buffering (or
not) in any language. The point of double buffering is
that it causes the drawing to wait for a moment while the
bitmap is constructed, and then produces the image on the
screen in a very short time as it is blitted. The
dynamics of the brain and the eye make this less
distracting than if the image is constructed gradually
over the same period in front of you.
So I'm not sure what the problem is.
It looks like the only problem is that I did not know that I
needed to over-ride the
OnEraseBkgnd(CDC* pDC) function, this is not required in
Java.
Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm
.
- References:
- Solving the repaint problem?
- From: Peter Olcott
- Re: Solving the repaint problem?
- From: Scott McPhillips [MVP]
- Re: Solving the repaint problem?
- From: Peter Olcott
- Re: Solving the repaint problem?
- From: Scott McPhillips [MVP]
- Re: Solving the repaint problem?
- From: Peter Olcott
- Re: Solving the repaint problem?
- From: David Webber
- Solving the repaint problem?
- Prev by Date: Re: help me !!!
- Next by Date: Re: Solving the repaint problem?
- Previous by thread: Re: Solving the repaint problem?
- Next by thread: Re: Solving the repaint problem?
- Index(es):
Relevant Pages
|