Page 1 of 1

TBitmap size limit?

PostPosted: November 2nd, 2006, 1:04 pm
by Genie
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?

PostPosted: November 3rd, 2006, 6:40 am
by Johnny_Bit
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