Indica la profundidad de color y la resolución actual del dispositivo de Pantalla.
Crea un proyecto e inserta este código.
Option Explicit
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long
' Parámetros de dispositivos para GetDeviceCaps()
Const HORZRES = 8 ' Ancho horizontal en píxeles
Const VERTRES = 10 ' Ancho vertical en píxeles
Const BITSPIXEL = 12 ' Número de bits por píxel
Const PLANES = 14 ' Número de planos
Private Sub Form_Load()
Dim Col As Long, Bit As Long, Largo As Long, Alto As Long, Txt As String
Col = GetDeviceCaps(Form1.hdc, BITSPIXEL)
If Col = 1 Then
Bit = GetDeviceCaps(Form1.hdc, PLANES)
If Bit = 1 Then
Txt = "Resolucion de 1 bit / 2 colores"
ElseIf Bit = 4 Then
Txt = "Resolucion de 4 bits / 16 colores"
End If
ElseIf Col = 8 Then
Txt = "Resolucion de 8 bits / 256 colores"
ElseIf Col = 16 Then
Txt = "Resolucion de 16 bits / 65000 colores"
Else
Txt = "Resolucion de 32 bits"
End If
Largo = GetDeviceCaps(Form1.hdc, HORZRES)
Alto = GetDeviceCaps(Form1.hdc, VERTRES)
MsgBox Txt & " " & Largo & "x" & Alto & " pixels"
End Sub
Posted
dom, ene 16 2000 23:14
by
Maverick