Declaration
property IsVirtual: Boolean;
Description
Specifies the object does not contain actual images, but is an array of indexed references.
In
IsVirtual mode, the number of images in the TIEMultiBitmap is specified by
VirtualCount.
The content of each TIEMultiBitmap frame is specified by
OnGetVirtual.
// Create a 100-frame TIFF file, where each frame shows its index
mbmp := TIEMultiBitmap.Create();
mbmp.OnGetVirtual := GetVirtualImage;
mbmp.VirtualCount := 100;
mbmp.IsVirtual := True;
mbmp.SaveToFile( 'D:\NumberedTIFF.tiff' );
mbmp.Free;
// Event to supply each virtual frame
procedure TMainForm.GetVirtualImage(Sender: TObject; idx: integer; var Width, Height: Integer; Image: TIEBitmap; Params: TIOParams);
const
Image_Width = 800;
Image_Height = 600;
var
proc: TImageEnProc;
begin
// Seeking bitmap?
if Image <> nil then
begin
// Create our bitmap for image idx
// Allocate size and fill with background color
Image.Allocate( Image_Width, Image_Height, clYellow );
// Draw text (image number)
proc := TImageEnProc.CreateFromBitmap( Image );
proc.TextOut( Align_Text_Horz_Center, Align_Text_Vert_Center, IntToStr( idx ), 'Arial', 128, clRed, [fsBold]);
proc.Free;
end
else
// Seek IO Parameters?
if Params <> nil then
begin
// Specify the image properties of image idx
Params.TIFF_Compression := ioTIFF_JPEG;
Params.TIFF_JPEGQuality := 85;
end
else
// Image Dimensions
if Params <> nil then
begin
// Specify the size of image idx
Width := Image_Width;
Height := Image_Height;
end;
end;
// Displaying a virtual multi-bitmap in a TImageEnMView
TIEMultiBitmap( ImageEnMView1.IEMBitmap ).OnGetVirtual := GetVirtualImage;
TIEMultiBitmap( ImageEnMView1.IEMBitmap ).VirtualCount := 10000;
TIEMultiBitmap( ImageEnMView1.IEMBitmap ).IsVirtual := True;
See Also
◼VirtualCount◼OnGetVirtual