Home > Language Reference > Classes > Bitmap

BitDepth Property

Bit depth of the image.

Syntax

Public Property Get BitDepth() As Integer

Remarks

The BitDepth property indicates the number of bits used to store each pixel of the image. If the object does not contain an image and is associated with a resource, it is loaded. Otherwise, a runtime error occurs.

It is not possible to associate a custom palette to an image. Therefore, the bit depth also indicates which system palette the bitmap uses. The following table lists the possible values this property can return, and describes the color model they correspond to:

ValueDescription
1The bitmap uses a monochrome black and white palette.
2The bitmap uses a 4 grey levels palette.
4The bitmap uses a 16 grey levels palette.
8The bitmap uses a 256 colors palette.
16The bitmap does not have a palette, and uses true colors.

This property is read-only. The bit depth of an image is either specified when creating the bitmap using the Create method, or either automatically determined according to the current graphic mode when the bitmap is loaded from a resource.

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.0N/A