ImageEn, unit iemview

TImageEnMView.InsertImage

TImageEnMView.InsertImage


Declaration

// General Insert (blank image) overload;
procedure InsertImage(Idx: integer); overload;

// General Insert (blank image of specific size and color depth)
procedure InsertImage(Idx: integer; Width, Height: integer; PixelFormat: TIEPixelFormat = ie24RGB); overload;

// Insert from TIEBitmap source
procedure InsertImage(Idx: integer; Bitmap: TIEBitmap); overload;

// Insert from TBitmap source
procedure InsertImage(Idx: integer; Bitmap: TBitmap); overload;

// Load image from file overload
procedure InsertImage(Idx: integer; const FileName: string); overload;

// Load frame from video overload
procedure InsertImage(Idx: integer; const FileName: string; FrameIndex: Integer); overload;

// Advanced loading overload
procedure InsertImage(const FileName: String;
                      LoadOnDemand: boolean;
                      DefaultTopText: TIEImageEnMViewDefaultText = iedtNone;
                      DefaultInfoText: TIEImageEnMViewDefaultText = iedtNone;
                      DefaultBottomText: TIEImageEnMViewDefaultText = iedtFilename;
                      bSelectIt : Boolean = true); overload;

// Stream loading overload
procedure InsertImage(Idx: integer; Stream: TStream; FileFormat: TIOFileType = ioUnknown); overload;


Description

Inserts a new image at position, idx (0 is the first).

Note:
First overload of InsertImage(idx: integer) does NOT create the bitmap. You can initialize an empty bitmap with InsertImage( idx, 0, 0, ie24RGB )
With TIEBitmap overload, the source bitmap may be modified
The inserted image will become selected. To prevent selection add iemoDontSelectOnAdd to MultiSelectionOptions

The parameters for the final overload are as follows:
Parameter Description
Filename A file or folder available on the system, or an HTTP or FTP link to a remote file
LoadOnDemand If True, the image will not be loaded from disk until it is displayed (i.e. when it is scrolled into view)
DefaultTopText Specify the text that is applied to ImageTopText
DefaultInfoText Specify the text that is applied to ImageInfoText
DefaultBottomText Specify the text that is applied to ImageBottomText (defaults to the filename)
bSelectIt If True, the new image will be selected in the control


Examples

ImageEnView1.IO.LoadFromFile('C:\000.tif');
ImageEnMView1.InsertImage(0);
ImageEnMView1.SetImage(0, ImageEnView1.IEBitmap);

// Which is the same as...
ImageEnMView1.InsertImage(0, 'C:\000.tif');

// Insert 256 x 256 bitmap
ImageEnMView1.InsertImage(0, 256, 256, ie24RGB);

// Insert a file from the web
ImageEnMView1.InsertImage(0, 'http://www.imageen.com/graphics/imageen.gif');

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

// Insert an image from a stream (letting ImageEn automatically detect the format)
ImageEnMView1.InsertImage( 0, MemStream, ioUnknown );

// Insert a JPEG that is Base64 encoded
ms := TMemoryStream.Create();
try
  IEDecode64( SourceStream, ms);
  ms.Position := 0;
  ImageEnMView1.InsertImage( 0, ms, ioJPEG );
finally
  ms.Free();
end;


See Also

InsertImageEx
AppendImage
FillFromList
FillFromDirectory
FillFromZip