Home > Language Reference > Classes > Bitmap
SaveToBMP Method
Saves the bitmap to a BMP file.
Syntax
Public Sub SaveToBMP(ByRef objStream As Stream)
| Parameter | Description |
| objStream | Stream where data are to be written. |
Remarks
The SaveToBMP method writes the bitmap into the specified stream in the BMP format. If the object does not contain an image and is associated with a resource, it is loaded. Otherwise, a runtime error occurs.
The objStream parameter is the stream where data are to be written. It can be any properly initialized stream object. After the operation completes, the stream pointer is always set to the first byte after the image. The following example saves a bitmap to a file:
Public Sub Export(ByRef bm As Bitmap, ByRef sFilename As String, ByVal iVolRef As Integer) Dim f As New StreamFile f.Open iVolRef, sFilename, hbModeCreateAlways+hbModeReadWrite bm.SaveToBMP f f.Close End Sub
The resulting BMP file is a standard Windows bitmap file. If the object contains a true color bitmap, the resulting file will be a 24-bit bitmap; otherwise, it is a color indexed bitmap. Note that Windows bitmaps are not supported by Palm OS®. This function is primarily intended to export bitmap from the device to a desktop computer, for example as an attachment to a mail.
System requirements
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.0 | - |
| Windows CE | Windows CE 3.0 | - |