ImageEn, unit iexBitmaps

TIEMultiBitmap.AppendImage

TIEMultiBitmap.AppendImage


Declaration

// General Append (blank image)
function AppendImage(): integer; overload;

// General Append (blank image of specific size and color depth)
function AppendImage(Width, Height: integer; PixelFormat: TIEPixelFormat = ie24RGB): integer; overload;

// Append from TIEBitmap source
function AppendImage(Bitmap: TIEBitmap): integer; overload;
function AppendImage(Bitmap: TIEBitmap; Rect: TRect): integer; overload;

// Append from TBitmap source
function AppendImage(Bitmap: TBitmap): integer; overload;

// Append from TIEMultiBitmap source
function AppendImage(MBitmap : TIECustomMultiBitmap): integer; overload;

// Load image from file overload
function AppendImage(const FileName: string): integer; overload;

// Load frame from video overload
function AppendImage(const FileName: string; FrameIndex: Integer): integer; overload;

// Stream loading overload
function AppendImage(Stream: TStream; FileFormat: TIOFileType = ioUnknown): integer; overload;

// Buffer overload
function AppendImage(Buffer: pointer; BufferSize: integer; FileType: TIOFileType = ioUnknown; IsResource: Boolean = False): integer; overload;

// TGraphic overload
function AppendImage(aGraphic: TGraphic): integer; overload;


Description

Appends a new image at last position in the list and returns the new image position.

Note:
In IsVirtual mode, AppendImage() will increment VirtualCount
For File/Stream overloads, if the image cannot be loaded nothing will be appended (and the result will be -1)


Examples

ImageEnView1.IO.LoadFromFile( 'C:\MyImage.tif' );
idx := MBitmap.AppendImage;
MBitmap.SetImage( idx, ImageEnView1.IEBitmap );

// Which is the same as...
MBitmap.AppendImage( 'C:\MyImage.tif' );

// Load the fifth image of MyImage.tif
MBitmap.AppendImage( 'C:\MyImage.tif', 4 );

// Append 256 x 256 bitmap
MBitmap.AppendImage( 256, 256, ie24RGB );

// Append a file from the web
MBitmap.AppendImage( 'http://www.imageen.com/graphics/imageen.gif' );

// Show the first ten frames of a video file
for i := 0 to 9 do
  ImageEnMView1.AppendImage( 'D:\Temp\Cement.avi', i );

// Append all pages of a TIFF to the current content
pageCount := EnumTIFFIm( sFileName );
for i := 0 to pageCount - 1 do
  MBitmap.AppendImage( sFileName, i );

// Append an image from a stream (letting ImageEn automatically detect the format)
MBitmap.AppendImage( MemStream, ioUnknown );

// Create an animated GIF file from ten source images
mbmp := TIEMultiBitmap.Create();
for i := 0 to 9 do
begin
  mbmp.AppendImage( format( 'D:\Source\Frame %d.bmp', [i] ));
  mbmp.Params[i].GIF_DelayTime := 10; // Display each frame for 1/10th of a second
end;
mbmp.SaveToFile( 'D:\animated.gif' );
mbmp.Free;

// Append a TGraphic (from a TImage) to a TImageEnMView
ImageEnMView1.IEMBitmap.AppendImage( Image1.Picture.Graphic );
ImageEnMView1.Update();


See Also

InsertImage
FillFromList
FillFromDirectory