|
|
Title | Get the system's color depth and screen size in pixels |
Keywords | color depth, pits per pixel, screen size |
Categories | Graphics |
|
|
To get screen size, use:
- width in pixels = Screen.Width / Screen.TwipsPerPixelX
- height in pixels = Screen.Height / Screen.TwipsPerPixelY
To get the color depth, use GetObject to initialize a BITMAP structure. Then look at its bmBitsPixel field.
|
|
Private Sub Form_Load()
Dim bm As BITMAP
AutoRedraw = True
GetObject Image, Len(bm), bm
MsgBox "The screen is " & _
Format$(Screen.Width / Screen.TwipsPerPixelX) & _
" pixels by " & _
Format$(Screen.Height / Screen.TwipsPerPixelY) & _
" pixels, using " & _
Format$(bm.bmBitsPixel) & _
" bits per pixel"
Unload Me
End Sub
|
|
|
|
|
|