
Modal Form and Paint problem
Quote:
>From what I've been told, each visible Form with AutoRedraw set True will
>require equivalent memory of the full screen resolution and color depth to
>hold the persistent bitmap (so a single Form on a 1600x1200x32 display will
>require 7.5MB, two Forms 15MB, four Forms 30MB, etc.)
It doesn't actually have anything to do with AutoRedraw.
A loaded _Resizable_ Form, invisible or not, has a persistent .Image
bitmap the size of the DeskTop irrespective of the AutoRedraw setting.
This persistent bitmap has a color set by Form.BackColor.
Setting AutoRedraw just means that anything drawn to the Client Area is
drawn to the matching area in the persistent .Image bitmap instead of
another, non-persistent, canvas. Actually even that last statement isn't
literally true, but it serves as a behaviour model.
Making a Form non-resizable will give behaviour similar to a PictureBox
as far as image size and AutoRedraw are concerned.
Quote:
>One work-around to this that I have seen mentioned (but never tried) is to
>place a PictureBox into the Form client region and place all Controls into
>that along with any required custom drawing. This reduces memory
>requirements since a PictureBox only requires memory as per its actual size.
Sorry, there is no workaround and adding a PictureBox will increase
memory requirement. Also a PictureBox doesn't always only require memory
as per its actual size, but that's another story :-)
--
Richard Mason