Large Bitmap on Delphi

bitmap, delphi, graphics

Solution

Set the pixel format like this:

LargeBmp.PixelFormat := pf24Bit;

I had the same problem several times and that always solved it.

Problem

I want to create large Bitmap with code ``` LargeBmp := TBitmap.Create; try LargeBmp.Width := 1000; // fine LargeBmp.Height := 15000; // XP - EOutOfResources, Not enough memory, Win 7 - works fine ... finally FreeAndNil(LargeBmp); end; ``` This code raises an `EOutOfResources` exception with message "Not enough memory" on Windows XP but works fine in Windows 7. What is wrong? Why Not enough memory? It's only 60 MB.

Original source