PDA

View Full Version : 2D-Graphics



Chris Stammen
8-Feb-2005, 11:19 AM
I'm using stuar's VDFGraph library to create some fancy 2d graphics. The
only problem is that with each repaint the screen flickers. Has anyone found
a solution for this? I'm a beginning VDF programmer and I'm not quite
capable of adjusting stuar's code to enhance it with an offscreen image. I'm
sure there must be a way to do it like this:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dngdi/html/msdn_flicker.asp

Maybe you can tell me if there are better ways to implement 2D graphics in
VDF? (with options like double buffering, etc.)

grtz
-Chris

Sture Andersen
8-Feb-2005, 07:01 PM
Hi Chris,

I'm sorry but I do not have the time to dive into that article. It's true
that flickering is visible when resizing panels, but other than that?

By the way, my name is spelled

-Sture

Chris Stammen
9-Feb-2005, 03:15 AM
Hello Sture,
First of all: My very big compliments to your expertise! I've seen other
articles from you - its truely amazing. Maybe you want to know that your 2d
library is of big help for our programs. So thank you very much.

However, I've been looking in your source for a way to make some sort of
image buffer where I can calculate the whole and then do a bitblit to the
screen, without using EraseBackground. This would prevent flickering, as
mentioned in the article from msdn.

Other than that, it's great working with VDFGraph.

Maybe I can better call you mr. Andersen! (Matrix ;-)

Best regards,
-Chris


"Sture Andersen" <sture.aps@mail.tele.dk> schreef in bericht
news:fBznFqjDFHA.4924@dacmail.dataaccess.com...
> Hi Chris,
>
> I'm sorry but I do not have the time to dive into that article. It's true
> that flickering is visible when resizing panels, but other than that?
>
> By the way, my name is spelled
>
> -Sture
>
>

Bob Worsley
9-Feb-2005, 09:47 AM
You can use the Windoze function LockWindowUpdate to lock the screen in a
VDF program during obnoxious screen updating to eliminate flicker, it might
work for you.

External_Function LockWindowUpdate "LockWindowUpdate" user32.dll ;
Handle hWnd Returns Integer

Handle hWnd
Integer iLocked

get window_handle of (MyViewName(Self)) to hWnd

move (LockWindowUpdate(hWnd)) to iLocked
// Do your stuff here...
if (iLocked) move (LockWindowUpdate(0)) to iLocked

Bob

"Chris Stammen" <cosmiq@home.nl> wrote in message
news:hjylE%23nDFHA.1952@dacmail.dataaccess.com...
> Hello Sture,
> First of all: My very big compliments to your expertise! I've seen other
> articles from you - its truely amazing. Maybe you want to know that your
2d
> library is of big help for our programs. So thank you very much.
>
> However, I've been looking in your source for a way to make some sort of
> image buffer where I can calculate the whole and then do a bitblit to the
> screen, without using EraseBackground. This would prevent flickering, as
> mentioned in the article from msdn.
>
> Other than that, it's great working with VDFGraph.
>
> Maybe I can better call you mr. Andersen! (Matrix ;-)
>
> Best regards,
> -Chris
>
>
> "Sture Andersen" <sture.aps@mail.tele.dk> schreef in bericht
> news:fBznFqjDFHA.4924@dacmail.dataaccess.com...
> > Hi Chris,
> >
> > I'm sorry but I do not have the time to dive into that article. It's
true
> > that flickering is visible when resizing panels, but other than that?
> >
> > By the way, my name is spelled
> >
> > -Sture
> >
> >
>
>

Sture Andersen
9-Feb-2005, 04:12 PM
Hi Chris,

You are very kind and yes, I like hearing that the code is doing good. Very
much so.

I'm not sure I understand the technique you will be using. Is it like
drawing on an invisible device context and then bitblt (=copying a memory
area?) it to the target context? Sounds clever.

Bob may another solution in his post.

-Mr Andersen

Michael Fenton
10-Feb-2005, 06:02 AM
Chris Stammen wrote:
> I'm using stuar's VDFGraph library to create some fancy 2d graphics. The
> only problem is that with each repaint the screen flickers. Has anyone found
> a solution for this? I'm a beginning VDF programmer and I'm not quite
> capable of adjusting stuar's code to enhance it with an offscreen image. I'm
> sure there must be a way to do it like this:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dngdi/html/msdn_flicker.asp
>
> Maybe you can tell me if there are better ways to implement 2D graphics in
> VDF? (with options like double buffering, etc.)
>
> grtz
> -Chris
>
>
>
What about ...

Set dynamic_update_state to false
do the whizzy bits
Set dynamic_update_state to true


Michael Fenton