Home > Language Reference > Classes
ScreenMode Class
+ Object
+ ScreenMode
Description
The ScreenMode class implements properties that characterize a graphic mode and methods to list the available graphic modes. This class is instantiable, derivable and cloneable.
There are two ways to use this object. The first is to use the ScreenMode or DefaultScreenMode global properties in read-only mode to obtain an instance of this class and then to access the Color and BitDepth properties to find out the graphics mode attributes. The example below illustrates this approach:
Private Sub Button1_Click() Dim sc As ScreenMode Set sc = ScreenMode MsgBox "Number of colors : " & CLng(2^sc.BitDepth) End Sub
The second way is to instantiate this class, modify the values of the Color and BitDepth properties directly or indirectly using the FindFirstMode and FindNextMode methods, then affect the object obtained to the ScreenMode global property to modify the current graphic mode. The example below illustrates this approach:
Private Sub Button1_Click() Dim sc As New ScreenMode sc.FindFirstMode Set ScreenMode = sc End Sub
Note that the ScreenMode object only describes the attributes of a graphic mode. The current graphic mode of the handheld device is not modified as long as you do not access the ScreenMode in write mode.
Members
| Members | Description |
| BitDepth | Number of bits per pixel. |
| Color | Indicates if color is supported. |
| FindFirstMode | Finds the first supported graphics modes. |
| FindNextMode | Finds the next supported graphics modes. |
| IsModeSupported | Checks if a graphics mode is supported. |
| Inherited from Object | Description |
| ClassID | Returns the type identifier corresponding to the actual class of the object. |
| Implements | Determines whether the object implements the features of a given class. |
| Iterate | Event raised to iterate over the elements of a container object. |
| Recipient | Recipient of events sent by the object. |
| Serialize | Event raised to serialize the object content into a stream. |
System requirements
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.0 | N/A |