Board index » delphi » Tbitmap size limit under Win98?

Tbitmap size limit under Win98?

I can't find anything in Borland's docs (D6) or help about this (as usual),
but I can't seem to create large TBitmaps under Win98.

For example:

Quote

procedure TForm1.Button1Click(Sender: TObject);
          var tmp : tbitmap;
          begin
          tmp:=tbitmap.create;
          tmp.height:=3000;
          tmp.width:=3000;
          showmessage('Size='+inttostr(tmp.width)+','+inttostr(tmp.height));
          end;
<<

This runs just fine under NT/2000/XP, but under any flavor of 98, it
generates a "The parameter is incorrect" error message.  If I reverse the
.height:= and .width:= lines, the error is always generated by the second of
the two, leading me to believe it's a limit on the overall size an not on
any particular height or width.  The odd thing is that I can use TBitmaps of
this size if they are sized during loads (mybitmap.loadfromfile); it looks
like the manual sizing methods have a bug in them.  Does anyone know
antyhing about this, like how I might work around it?

Thanks,
Matt

 

Re:Tbitmap size limit under Win98?


Hi.
Quote
"Matt" <spamtrash...@gruson.net> wrote in message news:3c0339c1$1_1@dnews...
> procedure TForm1.Button1Click(Sender: TObject);
>           var tmp : tbitmap;
>           begin
>           tmp:=tbitmap.create;
>           tmp.height:=3000;
>           tmp.width:=3000;

showmessage('Size='+inttostr(tmp.width)+','+inttostr(tmp.height));

Quote
>           end;
> <<

> This runs just fine under NT/2000/XP, but under any flavor of 98, it
(Skip)
> any particular height or width.  The odd thing is that I can use TBitmaps
of
> this size if they are sized during loads (mybitmap.loadfromfile);

           tmp:=tbitmap.create;
           tmp.PixelFormat := pf32bit; // or pf24nit or pf8bit....
           tmp.height:=3000;
           tmp.width:=3000;

Re:Tbitmap size limit under Win98?


Hi Matt,

Quote
> I can't find anything in Borland's docs (D6) or help about this (as
usual),
> but I can't seem to create large TBitmaps under Win98.

You can not create a bitmap of more than 16 MB under Win95/98/ME.

See here and similar pages:
http://msdn.microsoft.com/en-us/gdi/bitmaps_3ak0.asp

Thrse

Re:Tbitmap size limit under Win98?


Quote
> You can not create a bitmap of more than 16 MB under Win95/98/ME.

> See here and similar pages:
> http://msdn.microsoft.com/en-us/gdi/bitmaps_3ak0.asp

Sorry, should have been
http://msdn.microsoft.com/library/en-us/gdi/bitmaps_3ak0.asp

Thrse

Re:Tbitmap size limit under Win98?


Quote
Matt wrote:
> I can't find anything in Borland's docs (D6) or help about this (as usual),
> but I can't seem to create large TBitmaps under Win98.

It's not borland's responsability to document this, they have nothing to
do with it.

What Takuo said may or may not be helpfull. Indeed, if you're not
getting proper support for a need, it makes sense to make sure that
you're asking for exactly what you need before concluding it is not
supported. You're version should come up with a DDB, Takuo's version
should come up with a DIB. Besides possibly making a difference, a DIB
is what you want here, so it makes sense to check out his version.

The document Thrse kindly linked to is not really relevant for DIBs,
only DDBs. Besides, in my experience, it is not correct.

Problem is size limits of bitmaps depends on a lot of factors. It can
even be very small on certain systems. You just can't rely on it. You
can't rely on getting proper error feedback either, even though you seem
to get it here. Some systems refuse to make bitmaps of certain sizes,
but do not return errors. There are other related but different limits
in the GDI, like resizing ratio limits and such.

This is commonly refered to as 'the big bitmap problem' in this NG.

In short... it's a mess. The only way to support big images reliably and
guaranteed to work across all possible systems is to tile them into very
much shorter ones and to not depend in windows GDI wherever this can be
avoided. Since you cannot afford to be occupied with tile issues qin
hundreds of places in your code, what you need to build yourself to end
up with a good solution is, in short, an object that
- stores an array of tiles internally
- expose single-dib functionality externally.

The tiling technique has a couple of other advantages too, which is the
reason that every really serious imaging lib or image editor uses this
technique.

I've got such an object. I use it in a series of TGraphics currently in
beta (currently bmp, png and tiff, others will follow shortly). It is
reliable and very performant on all possible systems. It is currently
tested for images up to 30.000 32bpp pixels square, and I suspect it
supports image size up to the complete available virtual memory (!!).
It's not freeware, but it is an industrial strengh solution. If you're
interested, drop me a line.

Joris

Please do not reply private to mail posted in newsgroups or mailing
lists, unless that was agreed upon first.
When posting to newsgroups or mailing lists, please make sure you read
these guidelines first:
  http://web.infoave.net/~dcalhoun/nnq/nquote.html
  http://www.borland.com/newsgroups/netiquette.html

Re:Tbitmap size limit under Win98?


I thought the problem solved, but it might still be relevant :

http://www.efg2.com/Lab/Graphics/VeryLargeBitmap.htm

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com

Quote
Matt wrote:

> I can't find anything in Borland's docs (D6) or help about this (as usual),
> but I can't seem to create large TBitmaps under Win98.

> For example:

> procedure TForm1.Button1Click(Sender: TObject);
>           var tmp : tbitmap;
>           begin
>           tmp:=tbitmap.create;
>           tmp.height:=3000;
>           tmp.width:=3000;
>           showmessage('Size='+inttostr(tmp.width)+','+inttostr(tmp.height));
>           end;
> <<

> This runs just fine under NT/2000/XP, but under any flavor of 98, it
> generates a "The parameter is incorrect" error message.  If I reverse the
> .height:= and .width:= lines, the error is always generated by the second of
> the two, leading me to believe it's a limit on the overall size an not on
> any particular height or width.  The odd thing is that I can use TBitmaps of
> this size if they are sized during loads (mybitmap.loadfromfile); it looks
> like the manual sizing methods have a bug in them.  Does anyone know
> antyhing about this, like how I might work around it?

> Thanks,
> Matt

Re:Tbitmap size limit under Win98?


Hi Joris,

Quote
> The document Thrse kindly linked to is not really relevant for DIBs,
> only DDBs. Besides, in my experience, it is not correct.

Do you mean it's possible to create bitmaps larger than 16 MB under
Win95/98/ME?
Or do you mean the limitation only applies to DDBs?
This would fit with the contents of this page (found on efg's page about
very large bitmap experiment), although I am not sure to understand it
correctly:
http://support.microsoft.com/support/kb/articles/Q227/6/17.ASP

Thrse

Re:Tbitmap size limit under Win98?


Hi
Quote
"Thrse Hanquet" <therese.hanq...@skynet.be> wrote in message

news:3c03a5b3_1@dnews...
Quote
> Hi Joris,

> > The document Thrse kindly linked to is not really relevant for DIBs,
> > only DDBs. Besides, in my experience, it is not correct.

> Do you mean it's possible to create bitmaps larger than 16 MB under
> Win95/98/ME?
> Or do you mean the limitation only applies to DDBs?

Yes.

In My Experience, Maximum Size of DIB Section is about up to 64MB in Win98,
but Maximun Size always is changing because Fragmentation of Selectors of
16bit address space is always changing.

DIB Section are not managed by Device Driver, but managed by GDI Engine
directly
in Win32.

In my TBigBitmap class, which I made for Big Bitmap Manipulation,
8MB DIB Sections are used to tile a Big Bitmap.In my test,
TBigBitmap can read and display 200MB Bitmap without problems in
Windows 98.

TBigBitmap class has about 3 thousand lines for manuipulate DIB Sections

Re:Tbitmap size limit under Win98?


Quote
"Thrse Hanquet" wrote:
> > The document Thrse kindly linked to is not really relevant for DIBs,
> > only DDBs. Besides, in my experience, it is not correct.

> Do you mean it's possible to create bitmaps larger than 16 MB under
> Win95/98/ME?
> Or do you mean the limitation only applies to DDBs?

Neither. What I meant was that you link points to a doc on CreateBitmap,
an api that gets you a DDB. The remark on the 16 meg limit in that doc
is incorrect in my opinion, meaning I've seen both machines/situations
that will not ever get you a 16 meg DDB no matter what and
machines/situations that will no problem get you bigger ones.

In this the DDB situation is very similar to the DIB situation. Meaning,
there are limits, they may possibly be even very small on some
machines/situation, and they are unpredictably depending on a lot of
this.

Meaning, *ANY* big image handling needs a good tiler.

Joris

Please do not reply private to mail posted in newsgroups or mailing
lists, unless that was agreed upon first.
When posting to newsgroups or mailing lists, please make sure you read
these guidelines first:
  http://web.infoave.net/~dcalhoun/nnq/nquote.html
  http://www.borland.com/newsgroups/netiquette.html

Re:Tbitmap size limit under Win98?


"Joris Van Damme" <as.van.damme.jo...@planetinternet.be> wrote in message
news:3C042B8C.9081122A@planetinternet.be...

Quote
> Neither. What I meant was that you link points to a doc on CreateBitmap,
> an api that gets you a DDB. The remark on the 16 meg limit in that doc
> is incorrect in my opinion, meaning I've seen both machines/situations
> that will not ever get you a 16 meg DDB no matter what and
> machines/situations that will no problem get you bigger ones.

I've  never seen DDBs which are bigger than 16MB in Win95/98/ME..
I tested with many many Video cards and machines by myself.

Please tell me the video card name or machine name which get you large DDB.

Re:Tbitmap size limit under Win98?


Quote
Takuo Nakamura wrote:
> I've  never seen DDBs which are bigger than 16MB in Win95/98/ME..
> I tested with many many Video cards and machines by myself.

> Please tell me the video card name or machine name which get you large DDB.

Quite possibly you are right. I don't remember nor have notes about my
own tests, either way.

My point was though that things are simply not to be relied upon. I'm
very sure I've seen machines/situations that did not support a 16 meg
DDB. Apart from this point, that things are simply a mess and one should
not make assumptions other than very basic ones, details like what you
say here does not at all seem that important (to me at least).

Joris

Please do not reply private to mail posted in newsgroups or mailing
lists, unless that was agreed upon first.
When posting to newsgroups or mailing lists, please make sure you read
these guidelines first:
  http://web.infoave.net/~dcalhoun/nnq/nquote.html
  http://www.borland.com/newsgroups/netiquette.html

Re:Tbitmap size limit under Win98?


Hi Joris,

Quote
> Quite possibly you are right. I don't remember nor have notes about my
> own tests, either way.
> My point was though that things are simply not to be relied upon. I'm
> very sure I've seen machines/situations that did not support a 16 meg
> DDB.

The point (as I understand it) is: is Microsoft's documentation
unreliable or not?

The document we discuss says that you can not create a DDB larger than
16 MB under Win95/98/ME. It does *not* state that you might always
create a DDB smaller than 16 MB.

If you have one day succeeded in creating a DDB larger than 16 MB under
Win95/98/ME, the document could be considered as unreliable. Whether you
can or not create DDBs smaller than that is another question (in my
opinion).

Thrse

Other Threads