by Karthikeyan (187 Submissions)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 1st November 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
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
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
No comments have been posted about Get current resolution,number of colors and bits/pixels using GetDeviceCaps API. Why not be the first to post a comment about Get current resolution,number of colors and bits/pixels using GetDeviceCaps API.