Re:Allocating Bitmaps From Heap With New ?
Quote
"Patrick Martin" <patrickmmar...@freenet.co.uk> wrote in message
news:3A3F3FE4.7C4E5FC6@freenet.co.uk...
Quote
> Somewhere I finally found (and then misplaced) the help article
> explaining that bitmap sizes are restricted on win9x.
Maybe you're thinking of an article I just found on Microsoft
knowledge base, Article Q227617?
It pretty well sums up the problem, the 16 bit routines in the win9x
GDI and fragmentation of the kernel local descriptor table.
Quote
> I have encountered this probelm, and found it's very unpredictable,
to
> boot.
Unpredictable and insurmountable. So I've learned to make the most of
it ... for now. The graphics labs at www.efg2.com have been helpful,
thanks Earl F Glynn for an excellent site. With examples and info
from the labs, I've tripled the size of bitmap I can make on my
system from about 11,000 pixels square to over 35,000 square. That's
good enough for a demo/beta version.
Quote
> I would suggest an alternative approach - some kind of virtual view
for
> efficiency.
Yes. Creating images that size in memory is convenient but
inefficient. I'll be making some changes but I need to learn a little
more about basic graphic techniques. I don't think I've fully
digested all I've read in the past 5 days. No doubt I'll have a few
more questions :) Hope to hear from you again.
_____________
Kim
Quote
> HTH
> Kim Bergman wrote:
> > I'm using CPP Builder 4 Standard under Win98 SE, 128 meg RAM, my
swap
> > file is the only file on a 2 gig partition.
> > I need to create large bitmaps. The code below compiles and runs,
no
> > problem.
> > Graphics::TBitmap *bigbmp;
> > bigbmp = new Graphics::TBitmap;
> > bigbmp->Monochrome = true;
> > bigbmp -> Width = 11000;
> > bigbmp -> Height = 11000;
> > < code to draw and print the image >
> > delete bigbmp;
> > However, if I try to set the height and width to larger values,
for
> > example....,
> > bigbmp -> Width = 12000;
> > bigbmp -> Height = 12000;
> > .... it compiles and runs, assigns the width OK but throws EOutOf
> > Resources when it tries to assign the height.
> > Builder's Help says EOutOf Resources indicates Windows has run out
of
> > handles. I use only one other handle (for the printer) and since
it
> > runs fine for an 11000 X 11000 pixel bitmap, I think the problem
is
> > that it's running out of heap memory. Since my swap file is the
only
> > file on a 2 gig partition and since I let Windows manage the swap
> > file, I don't think it's a swap file limitation.
> > I've read the Help on the new operator and related topics and it
> > appears that it is possible to allocate specific amounts of memory
> > from the heap to bitmaps via new. But I can't get the syntax
right.
> > Could someone please help me with the syntax ? Thanks.
> > Kim
> > ----------=<>{ Spam Shield ON }<>=-----------
> > Email to "thejunk...@telusplanet.net" gets
> > autotrashed....I never see it. Try **bergk-
> > at-telus**planet dot nut if you must email
> > ------------------------------------------------