RefBitmap example for Delphi
//This example demonstrates the RefBitmap property
var
MyRaster: LEADRaster;
MyRasterIO: LEADRasterIO;
begin
MyRaster:= CreateComObject (CLASS_LEADRaster) as LEADRaster;
MyRasterIO:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;
//Load an image into MyRaster object
MyRasterIO.Load (MyRaster, 'v:\images\Test.bmp', 0, 0, 1);
ShowMessage ('MyRaster.Bitmap should be non-zero: ' + IntToStr(MyRaster.Bitmap));
//Have the LEADRasterView1 control "steal" the MyRaster bitmap
LEADRasterView1.Raster.RefBitmap:= True;
LEADRasterView1.Raster.Bitmap:= MyRaster.Bitmap;
//The MyRaster Bitmap has been invalidated
ShowMessage ('MyRaster.Bitmap should be zero: ' + IntToStr(MyRaster.Bitmap));
end;