From: Brian Geppert Brian on
> VB's back-buffer implementation uses a Device Dependant Bitmap (DDB) to
store the image data, which is quite limited in how large it can be made.
On older OS' this used to be ~16mb uncompressed data size, on later OS this
has been expended
but is still quite restrictive.
> Mike
> - Microsoft Visual Basic MVP -
> E-Mail: EDais(a)mvps.org
> WWW: Http://EDais.mvps.org/
>

I have an application whereby I draw a plot on a screen - I have numerous
forms, each with a picture box. The app works fine on a single monitor.
However, if I use it on a dual-monitor PC, I routinely get the "cannot
autoredraw" problem. I would like to leave autoredraw = true so that the
image doesn't get erased by the other windows when they are moved around or
cascaded.

Is there any workaround for this error or is truly an OS limit?
From: Mike D Sutton on
> I have an application whereby I draw a plot on a screen - I have numerous
> forms, each with a picture box. The app works fine on a single monitor.
> However, if I use it on a dual-monitor PC, I routinely get the "cannot
> autoredraw" problem. I would like to leave autoredraw = true so that the
> image doesn't get erased by the other windows when they are moved around or
> cascaded.
>
> Is there any workaround for this error or is truly an OS limit?

In this case simply manage your own back-buffer and re-paint to the form when required - This way you get the benefits
of AutoRedraw without having to worry about the DDB memory limitations. For even better performance, subclass your
window and do your drawing in the WM_PAINT message handler, which bypasses VB's drawing entirely and gives you access to
the update rectangle rather than having to repaint the entire form every time.
Hope this helps,

Mike

P.s. It's best to post your query to a new thread rather that on the end of an old one, you'll get more people looking
at your query.


- Microsoft Visual Basic MVP -
E-Mail: EDais(a)mvps.org
WWW: Http://EDais.mvps.org/


From: Brian Geppert on
Thanks! (my first post - should have been a new thread - next time for sure).

Any examples on how to manage a back-buffer? This is new territory for me...

"Mike D Sutton" wrote:

> > I have an application whereby I draw a plot on a screen - I have numerous
> > forms, each with a picture box. The app works fine on a single monitor.
> > However, if I use it on a dual-monitor PC, I routinely get the "cannot
> > autoredraw" problem. I would like to leave autoredraw = true so that the
> > image doesn't get erased by the other windows when they are moved around or
> > cascaded.
> >
> > Is there any workaround for this error or is truly an OS limit?
>
> In this case simply manage your own back-buffer and re-paint to the form when required - This way you get the benefits
> of AutoRedraw without having to worry about the DDB memory limitations. For even better performance, subclass your
> window and do your drawing in the WM_PAINT message handler, which bypasses VB's drawing entirely and gives you access to
> the update rectangle rather than having to repaint the entire form every time.
> Hope this helps,
>
> Mike
>
> P.s. It's best to post your query to a new thread rather that on the end of an old one, you'll get more people looking
> at your query.
>
>
> - Microsoft Visual Basic MVP -
> E-Mail: EDais(a)mvps.org
> WWW: Http://EDais.mvps.org/
>
>
>
From: expvb on
Mike,

Please fix your date/time settings. It shows October 18.


From: Mike D Sutton on
> Thanks! (my first post - should have been a new thread - next time for sure).
>
> Any examples on how to manage a back-buffer? This is new territory for me...

Have a look at this old post, it demonstrates a simple class that manages all of the GDI internals for you:
http://groups.google.co.uk/group/microsoft.public.vb.winapi.graphics/msg/2f87a10315d8b6c2
Hope this helps,

Mike


- Microsoft Visual Basic MVP -
E-Mail: EDais(a)mvps.org
WWW: Http://EDais.mvps.org/