Re: TextOut prints a little late?
- From: deostroll <deostroll@xxxxxxxxx>
- Date: Wed, 26 Sep 2007 08:44:19 -0700
On Sep 26, 7:50 pm, "Joe Butler" <ffffh.no.s...@hotmail-spammers-
paradise.com> wrote:
You use InvalidateRect() to tell windows that the rectangular area you
specified is 'dirty' and needs to be re-drawn. When windows is not busy
doing more important things, it'll get around to telling your app, via a
WM_PAINT message that you need to repaint your window's client area.
The idea is that when you app needs to output new information on the screen,
you can calculate where that information is displayed (which may only be a
very small area in your entire application) and mark the area as needing to
be re-drawn by using InvalidateRect().
Then, in your paint handler, you can get the dirty area from from the paint
structure and update that area only, which will reduce flicker and generally
be more efficient than repainting the entire application each time some
small thing changes.
Why do you need to create a delay between making 2 TextOut() calls? Are you
outputing these direct to the screen? Do you simply need to wait for new
information before the second TextOut() call can be made?
"deostroll" <deostr...@xxxxxxxxx> wrote in message
news:1190814036.173510.74060@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Sep 26, 9:15 am, "Joe Butler" <ffffh.no.s...@hotmail-spammers-
paradise.com> wrote:
Presumably it's the GDI batching?
Try with GdiSetBatchLimit(1)
or try: GdiFlush() immediatly after your first TextOut() call.
The batching should make drawing faster overall, so, you'd only want to
do
this for special occations. On my XP, it seems that 20 is the default
batching limit and it cannot be raised above this amount. Not sure if
that's specific to my graphics card/hardware, or an XP fixed limit.
"deostroll" <deostr...@xxxxxxxxx> wrote in message
news:1190772470.352419.149250@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Inside a function I have a Sleep() in between 2 TextOut() calls. When
I call the 1st one I expect it to print immediately before Sleep() is
executed; but instead I get the output of both calls at the same time
after the Slee() and after the funtion has exited...!
Why does this happen?
What is the proper way to print immediately?
--deostroll
I've used InvalidateRect() with the last parameter FALSE. That seems
to work. Is this actually recommended? I just don't seem to understand
what InvalidateRect() does...where do you normally use it?
--deostroll
I am just learning through experimenting. When I draw lines using
Polyline() it draws quickly. Where as TextOut() did not work as
quickly as expected. Therefore I was wondering why this is so?
Ok. If the sole pupose of InvalidateRect() is to clean up why do we
have to pass a FALSE as the last parameter - to say not to clean up?
If that was my objective I would simple not call InvalidateRect() !.
--deostroll
.
- Follow-Ups:
- Re: TextOut prints a little late?
- From: Joe Butler
- Re: TextOut prints a little late?
- References:
- TextOut prints a little late?
- From: deostroll
- Re: TextOut prints a little late?
- From: Joe Butler
- Re: TextOut prints a little late?
- From: deostroll
- Re: TextOut prints a little late?
- From: Joe Butler
- TextOut prints a little late?
- Prev by Date: Re: TextOut prints a little late?
- Next by Date: Re: TextOut prints a little late?
- Previous by thread: Re: TextOut prints a little late?
- Next by thread: Re: TextOut prints a little late?
- Index(es):