TBitmap size limit?

Please discuss general Delphi programming topics here.

TBitmap size limit?

Postby Genie » November 2nd, 2006, 1:04 pm

Hi,

I'm using TBitmap to load 8-bit bitmaps, rotate them and display windowed parts of the rotated bitmap. My problem is that the following lines raise an "stream read error" exception when the size of the bitmap is too big (e.g. 2048x3072):

Code: Select all
ImageToRotate := TBitmap.Create;
ImageToRotate.Width := 2048; ImageToRotate.Height := 3072;

   try
      ImageToRotate.LoadFromFile(FBitmapFileName); //This line raises the exception
   except
      on E: Exception do
      begin
         ShowMessage(E.Message);
         Exit;
      end;
   end;


Smaller files generated from the same bitmap using photoshop or cropping with Paint load without any problems.

Any Suggestions?
Genie
Member
Member
 
Posts: 1
Joined: November 2nd, 2006, 12:48 pm

Postby Johnny_Bit » November 3rd, 2006, 6:40 am

yup, it's typical failure. What you need to do is not rely on built in classes that eat up memory without need or get choppy on bigger sets, what you need is your own class, that can do it hardcore way, you know drawing bitmap all over from file, not using wussy classes
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron