ImageEn, unit iexBitmaps

TIEBitmap.Allocate

TIEBitmap.Allocate


Declaration

function Allocate(ImageWidth, ImageHeight: integer; FillColor: TColor; Alpha: Integer = 255): boolean; overload;   // Sets to ie24RGB
function Allocate(ImageWidth, ImageHeight: integer; ImagePixelFormat: TIEPixelFormat = ie24RGB; FillValue: Double = -1; Alpha: Integer = 255): boolean; overload;


Description

Prepares space for an image with ImageWidth and ImageHeight sizes.
Optionally, if FillColor <> -1, it will fill with the specified color (see Fill for suitable ranges), and set the alpha (from 0: Fully Transparent - 255: Fully Opaque).
The first overload always creates an ie24RGB image.
Returns true on success.

Note: Calling Allocate to set Alpha to 255 will have no effect unless another parameter is different from the existing value, i.e. this method has no effect: myBmp.Allocate( myBmp.Width, myBmp.Height, myBMP.PixelFormat, -1, 255 );


Examples

// Create a 1000x1000 CMYK bitmap
ImageEnView1.IEBitmap.Allocate( 1000, 1000, ieCMYK );

// Create bitmap with red background
ImageEnView1.IEBitmap.Allocate( 250, 250, clRed );

// Create fully transparent bitmap
ImageEnView1.IEBitmap.Allocate( 250, 250, clWhite, 0 );


Loading contents...