Get current resolution,number of colors and bits/pixels using GetDeviceCaps API
Get current resolution,number of colors and bits/pixels using GetDeviceCaps API
API Declarations
Const HORZRES = 8 ' X axis in pixels
Const VERTRES = 10 ' Y axis in pixels
Const BITSPIXEL = 12 ' Number of bits per pixel
Rate Get current resolution,number of colors and bits/pixels using GetDeviceCaps API
(1(1 Vote))
Dim x, y, bp, ncol As Long
x = GetDeviceCaps(Me.hdc, HORZRES)
y = GetDeviceCaps(Me.hdc, VERTRES)
MsgBox "Current Resolution is " & x & " X " & y & " Pixels"
bp = GetDeviceCaps(Me.hdc, BITSPIXEL)
MsgBox "Current Resolution has " & bp & " Bits / Pixels"
ncol = 1
For i = 1 To bp
ncol = ncol * 2
Next
MsgBox "Number of Colors is " & ncol
End
End Sub
Get current resolution,number of colors and bits/pixels using GetDeviceCaps API Comments
No comments yet — be the first to post one!
Post a Comment