RawSave Example for C++ Builder
//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.
void TForm1::SaveRawData (AnsiString szFileName, long uOffset)
{
int nRet;
LEADRasterIO* pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->SaveLSB = True;
pRasterIO->SavePad4 = True;
nRet= pRasterIO->SaveOffset (LEADRasterView1->Raster, AnsiToOLESTR(szFileName.c_str()), uOffset, (RasterFileConstants)FILE_RAW, 0, (QFactorConstants)0, 0);
if (nRet == 0)
ShowMessage ("SUCCESS file save: " + szFileName + " Size Written: " + IntToStr((int)pRasterIO->FileSizeWritten));
else
ShowMessage ("FAILED--file save: " + szFileName);
pRasterIO-> Release( );
}