SaveOffset example for C++ Builder

{This example saves a TBitmapHandle as RAW data starting at offset nOffset.

The data is padded so that each line of bytes is evenly divided by 4. 

The bits in each byte are reversed before saving. The bits per pixel of the raw data is the same as the BitmapBits Property. If the Bitmap is a palletized image, the palette is not saved--only the raw data.} 

void TForm1::SaveRawData ( AnsiString szFileName, int nOffset )
{
   int nRet;

   LEADImage1->SaveLSB = true;
   LEADImage1->SavePad4 =true;
   nRet= LEADImage1->SaveOffset( szFileName,   nOffset, FILE_RAW, 0, 0, 0 );
   if ( nRet == SUCCESS )
      ShowMessage ( "SUCCESS file save: " + szFileName + "  Size Written: " + IntToStr(LEADImage1->FileSizeWritten) );
   else
      ShowMessage ( "FAILED--file save: " + szFileName );
}