RawSave Example for Delphi
//This example saves a LEAD bitmap as RAW data starting at offset uOffset
//The data is padded so that each line of bytes is evenly divides 4
//The bits in each byte are reversed before saving
//The Bits per pixel of the raw data is the same as the bits per pixel of pBitmap
//If pBitmap is a palettized image, the palette is not saved--only the raw data
// This example considers that you added this methos to the Form’s private section.
Procedure TForm1.SaveRawData (szFileName: String; uOffset: Longint);
var
nRet: Integer;
RasterIO: LEADRasterIO;
begin
RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
RasterIO.SaveLSB:= True;
RasterIO.SavePad4:= True;
nRet:= RasterIO.SaveOffset (LEADRasterView1.Raster, szFileName, uOffset, FILE_RAW, 0, 0, 0);
if (nRet = 0) then
ShowMessage ('SUCCESS file save: ' + szFileName + ' Size Written: ' + IntToStr(RasterIO.FileSizeWritten))
else
ShowMessage ('FAILED--file save: ' + szFileName);
end;