RawSave Example for Visual Basic

'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
Private Sub SaveRawData(szFileName As String, uOffset As Long)
Dim nRet As Integer
Dim RasterIO As New LEADRasterIO
RasterIO.SaveLSB = True
RasterIO.SavePad4 = True
nRet = RasterIO.SaveOffset (LEADRasterView1.Raster, szFileName, uOffset, FILE_RAW, 0, 0, 0)
If (nRet = 0) Then
    MsgBox ("SUCCESS file save: " & szFileName & "  Size Written: " & RasterIO.FileSizeWritten)
Else
    MsgBox ("FAILED--file save: " & szFileName)
End If
End Sub