Maximßlnφ poΦet barev

Postup:
V modulu deklarujte:
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal nIndex As Long) As Long

Private Const BITSPIXEL = 12
Private Const PLANES = 14

Private Function MaxColors() As Variant
'Vracφ maximum barev podporovan²ch systΘmem
'256, 16,777,216

   Dim lngBits As Long
   Dim lngPlanes As Long
   Dim lwndHandle As Long
   Dim dblAns As Double

   lwndHandle = Me.hDC

   lngBits = GetDeviceCaps(lwndHandle, BITSPIXEL)
   lngPlanes = GetDeviceCaps(lwndHandle, PLANES)
   MaxColors = (2 ^ (lngBits * lngPlanes))

End Function

Zp∞t

Autor: The Bozena