TImageEnMView.InsertImage
Declaration
// General Insert (blank image) overload;
procedure InsertImage(Index: Integer); overload;
// General Insert (blank image of specific size and color depth)
procedure InsertImage(Index: Integer; Width, Height: Integer; PixelFormat: TIEPixelFormat = ie24RGB; FillColor: TColor = clBlack); overload;
// Insert from TIEBitmap source
procedure InsertImage(Index: Integer; Bitmap: TIEBitmap); overload;
// Insert from TBitmap source
procedure InsertImage(Index: Integer; Bitmap: TBitmap); overload;
// Load image from file overload
procedure InsertImage(Index: Integer; const FileName: string); overload;
// Load frame from video overload
procedure InsertImage(Index: 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(Index: Integer; Stream: TStream; FileType: TIOFileType = ioUnknown); overload;
Description
Inserts a new image at position,
Index (0 is the first).
FileType specifies the
file format of the image. If
ioUnknown is specified, the file extension is used to determine the format (e.g. ioJPEG for "Image.jpg").
Note:
◼First overload of InsertImage(Index: Integer) does NOT create the bitmap. You can initialize an empty bitmap with InsertImage( Index, 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