VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "dwDevCaps"
Attribute VB_Creatable = False
Attribute VB_Exposed = True
' Desaware API Class library
' Copyright (c) 1996 by Desaware Inc.
' All rights reserved

Option Explicit

#If Win32 Then
Private iHDC As Long
#Else
Private iHDC As Integer
#End If

Private Const iDRIVERVERSION = 0      '  Device driver version
Private Const iTECHNOLOGY = 2         '  Device classification
Private Const iHORZSIZE = 4           '  Horizontal size in millimeters
Private Const iVERTSIZE = 6           '  Vertical size in millimeters
Private Const iHORZRES = 8            '  Horizontal width in pixels
Private Const iVERTRES = 10           '  Vertical width in pixels
Private Const iBITSPIXEL = 12         '  Number of bits per pixel
Private Const iPLANES = 14            '  Number of planes
Private Const iNUMBRUSHES = 16        '  Number of brushes the device has
Private Const iNUMPENS = 18           '  Number of pens the device has
Private Const iNUMMARKERS = 20        '  Number of markers the device has
Private Const iNUMFONTS = 22          '  Number of fonts the device has
Private Const iNUMCOLORS = 24         '  Number of colors the device supports
Private Const iPDEVICESIZE = 26       '  Size required for device descriptor
Private Const iCURVECAPS = 28         '  Curve capabilities
Private Const iLINECAPS = 30          '  Line capabilities
Private Const iPOLYGONALCAPS = 32     '  Polygonal capabilities
Private Const iTEXTCAPS = 34          '  Text capabilities
Private Const iCLIPCAPS = 36          '  Clipping capabilities
Private Const iRASTERCAPS = 38        '  Bitblt capabilities
Private Const iASPECTX = 40           '  Length of the X leg
Private Const iASPECTY = 42           '  Length of the Y leg
Private Const iASPECTXY = 44          '  Length of the hypotenuse

Private Const iLOGPIXELSX = 88        '  Logical pixels/inch in X
Private Const iLOGPIXELSY = 90        '  Logical pixels/inch in Y

Private Const iSIZEPALETTE = 104      '  Number of entries in physical palette
Private Const iNUMRESERVED = 106      '  Number of reserved entries in palette
Private Const iCOLORRES = 108         '  Actual color resolution

'  Printing related DeviceCaps. These replace the appropriate Escapes
Private Const iPHYSICALWIDTH = 110 '  Physical Width in device units
Private Const iPHYSICALHEIGHT = 111 '  Physical Height in device units
Private Const iPHYSICALOFFSETX = 112 '  Physical Printable Area x margin
Private Const iPHYSICALOFFSETY = 113 '  Physical Printable Area y margin
Private Const iSCALINGFACTORX = 114 '  Scaling factor x
Private Const iSCALINGFACTORY = 115 '  Scaling factor y

'  Device Capability Masks:

'  Device Technologies
Private Const iDT_PLOTTER = 0             '  Vector plotter
Private Const iDT_RASDISPLAY = 1          '  Raster display
Private Const iDT_RASPRINTER = 2          '  Raster printer
Private Const iDT_RASCAMERA = 3           '  Raster camera
Private Const iDT_CHARSTREAM = 4          '  Character-stream, PLP
Private Const iDT_METAFILE = 5            '  Metafile, VDM
Private Const iDT_DISPFILE = 6            '  Display-file

'  Curve Capabilities
Private Const iCC_NONE = 0                '  Curves not supported
Private Const iCC_CIRCLES = 1             '  Can do circles
Private Const iCC_PIE = 2                 '  Can do pie wedges
Private Const iCC_CHORD = 4               '  Can do chord arcs
Private Const iCC_ELLIPSES = 8            '  Can do ellipese
Private Const iCC_WIDE = 16               '  Can do wide lines
Private Const iCC_STYLED = 32             '  Can do styled lines
Private Const iCC_WIDESTYLED = 64         '  Can do wide styled lines
Private Const iCC_INTERIORS = 128 '  Can do interiors
Private Const iCC_ROUNDRECT = 256 '

'  Line Capabilities
Private Const iLC_NONE = 0                '  Lines not supported
Private Const iLC_POLYLINE = 2            '  Can do polylines
Private Const iLC_MARKER = 4              '  Can do markers
Private Const iLC_POLYMARKER = 8          '  Can do polymarkers
Private Const iLC_WIDE = 16               '  Can do wide lines
Private Const iLC_STYLED = 32             '  Can do styled lines
Private Const iLC_WIDESTYLED = 64         '  Can do wide styled lines
Private Const iLC_INTERIORS = 128 '  Can do interiors

'  Polygonal Capabilities
Private Const iPC_NONE = 0                '  Polygonals not supported
Private Const iPC_POLYGON = 1             '  Can do polygons
Private Const iPC_RECTANGLE = 2           '  Can do rectangles
Private Const iPC_WINDPOLYGON = 4         '  Can do winding polygons
Private Const iPC_TRAPEZOID = 4           '  Can do trapezoids
Private Const iPC_SCANLINE = 8            '  Can do scanlines
Private Const iPC_WIDE = 16               '  Can do wide borders
Private Const iPC_STYLED = 32             '  Can do styled borders
Private Const iPC_WIDESTYLED = 64         '  Can do wide styled borders
Private Const iPC_INTERIORS = 128 '  Can do interiors

'  Polygonal Capabilities
Private Const iCP_NONE = 0                '  No clipping of output
Private Const iCP_RECTANGLE = 1           '  Output clipped to rects
Private Const iCP_REGION = 2              '

'  Text Capabilities
Private Const iTC_OP_CHARACTER = &H1              '  Can do OutputPrecision   CHARACTER
Private Const iTC_OP_STROKE = &H2    '  Can do OutputPrecision   STROKE
Private Const iTC_CP_STROKE = &H4                 '  Can do ClipPrecision     STROKE
Private Const iTC_CR_90 = &H8                     '  Can do CharRotAbility    90
Private Const iTC_CR_ANY = &H10                   '  Can do CharRotAbility    ANY
Private Const iTC_SF_X_YINDEP = &H20              '  Can do ScaleFreedom      X_YINDEPENDENT
Private Const iTC_SA_DOUBLE = &H40                '  Can do ScaleAbility      DOUBLE
Private Const iTC_SA_INTEGER = &H80               '  Can do ScaleAbility      INTEGER
Private Const iTC_SA_CONTIN = &H100               '  Can do ScaleAbility      CONTINUOUS
Private Const iTC_EA_DOUBLE = &H200               '  Can do EmboldenAbility   DOUBLE
Private Const iTC_IA_ABLE = &H400                 '  Can do ItalisizeAbility  ABLE
Private Const iTC_UA_ABLE = &H800                 '  Can do UnderlineAbility  ABLE
Private Const iTC_SO_ABLE = &H1000                '  Can do StrikeOutAbility  ABLE
Private Const iTC_RA_ABLE = &H2000                '  Can do RasterFontAble    ABLE
Private Const iTC_VA_ABLE = &H4000                '  Can do VectorFontAble    ABLE
Private Const iTC_RESERVED = &H8000
Private Const iTC_SCROLLBLT = &H10000             '  do text scroll with blt

'  Raster Capabilities
Private Const iRC_NONE = 0
Private Const iRC_BITBLT = 1                  '  Can do standard BLT.
Private Const iRC_BANDING = 2                 '  Device requires banding support
Private Const iRC_SCALING = 4                 '  Device requires scaling support
Private Const iRC_BITMAP64 = 8                '  Device can support >64K bitmap
Private Const iRC_GDI20_OUTPUT = &H10             '  has 2.0 output calls
Private Const iRC_GDI20_STATE = &H20
Private Const iRC_SAVEBITMAP = &H40
Private Const iRC_DI_BITMAP = &H80                '  supports DIB to memory
Private Const iRC_PALETTE = &H100                 '  supports a palette
Private Const iRC_DIBTODEV = &H200                '  supports DIBitsToDevice
Private Const iRC_BIGFONT = &H400                 '  supports >64K fonts
Private Const iRC_STRETCHBLT = &H800              '  supports StretchBlt
Private Const iRC_FLOODFILL = &H1000              '  supports FloodFill
Private Const iRC_STRETCHDIB = &H2000             '  supports StretchDIBits
Private Const iRC_OP_DX_OUTPUT = &H4000
Private Const iRC_DEVBITS = &H8000

#If Win32 Then
Private Declare Function GetDeviceCaps& Lib "gdi32" (ByVal hDC As Long, ByVal nIndex As Long)
Attribute GetDeviceCaps.VB_HelpID = 2551
Attribute GetDeviceCaps.VB_Description = "Help available in Visual Basic Programmer's Guide to Win32 API CD ROM"
#Else
Private Declare Function GetDeviceCaps% Lib "gdi" (ByVal hDC%, ByVal nIndex%)
#End If

' Hold on to the device context handle
Public Sub InitDevCaps(newHDC)
    iHDC = newHDC
End Sub

' This is the general version, in case you want to get
' the capability with the constant number instead of
' just calling the property directly.
Public Function GetCapability(cap As Long) As Long
    GetCapability = GetDeviceCaps(iHDC, cap)
End Function

Public Property Get DRIVERVERSION() As Long
    DRIVERVERSION = GetDeviceCaps(iHDC, iDRIVERVERSION)
End Property

Public Property Get DT_PLOTTER() As Long
    DT_PLOTTER = GetDeviceCaps(iHDC, iDT_PLOTTER)
End Property

Public Property Get TECHNOLOGY() As Long
    TECHNOLOGY = GetDeviceCaps(iHDC, iTECHNOLOGY)
End Property

Public Property Get HORZSIZE() As Long
     HORZSIZE = GetDeviceCaps(iHDC, iHORZSIZE)
End Property

Public Property Get VERTSIZE() As Long
    VERTSIZE = GetDeviceCaps(iHDC, iVERTSIZE)
End Property

Public Property Get HORZRES() As Long
    HORZRES = GetDeviceCaps(iHDC, iHORZRES)
End Property

Public Property Get VERTRES() As Long
    VERTRES = GetDeviceCaps(iHDC, iVERTRES)
End Property

Public Property Get BITSPIXEL() As Long
    BITSPIXEL = GetDeviceCaps(iHDC, iBITSPIXEL)
End Property

Public Property Get PLANES() As Long
    PLANES = GetDeviceCaps(iHDC, iPLANES)
End Property

Public Property Get NUMBRUSHES() As Long
    NUMBRUSHES = GetDeviceCaps(iHDC, iNUMBRUSHES)
End Property

Public Property Get NUMPENS() As Long
    NUMPENS = GetDeviceCaps(iHDC, iNUMPENS)
End Property

Public Property Get NUMMARKERS() As Long
    NUMMARKERS = GetDeviceCaps(iHDC, iNUMMARKERS)
End Property

Public Property Get NUMFONTS() As Long
    NUMFONTS = GetDeviceCaps(iHDC, iNUMFONTS)
End Property

Public Property Get NUMCOLORS() As Long
    NUMCOLORS = GetDeviceCaps(iHDC, iNUMCOLORS)
End Property

Public Property Get PDEVICESIZE() As Long
    PDEVICESIZE = GetDeviceCaps(iHDC, iPDEVICESIZE)
End Property

Public Property Get CURVECAPS() As Long
    CURVECAPS = GetDeviceCaps(iHDC, iCURVECAPS)
End Property

Public Property Get LINECAPS() As Long
    LINECAPS = GetDeviceCaps(iHDC, iLINECAPS)
End Property

Public Property Get POLYGONALCAPS() As Long
    POLYGONALCAPS = GetDeviceCaps(iHDC, iPOLYGONALCAPS)
End Property

Public Property Get TEXTCAPS() As Long
    TEXTCAPS = GetDeviceCaps(iHDC, iTEXTCAPS)
End Property

Public Property Get CLIPCAPS() As Long
    CLIPCAPS = GetDeviceCaps(iHDC, iCLIPCAPS)
End Property

Public Property Get RASTERCAPS() As Long
    RASTERCAPS = GetDeviceCaps(iHDC, iRASTERCAPS)
End Property

Public Property Get ASPECTX() As Long
    ASPECTX = GetDeviceCaps(iHDC, iASPECTX)
End Property

Public Property Get ASPECTY() As Long
    ASPECTY = GetDeviceCaps(iHDC, iASPECTY)
End Property

Public Property Get ASPECTXY() As Long
    ASPECTXY = GetDeviceCaps(iHDC, iASPECTXY)
End Property

Public Property Get LOGPIXELSX() As Long
    LOGPIXELSX = GetDeviceCaps(iHDC, iLOGPIXELSX)
End Property

Public Property Get LOGPIXELSY() As Long
    LOGPIXELSY = GetDeviceCaps(iHDC, iLOGPIXELSY)
End Property

Public Property Get SIZEPALETTE() As Long
    SIZEPALETTE = GetDeviceCaps(iHDC, iSIZEPALETTE)
End Property

Public Property Get NUMRESERVED() As Long
    NUMRESERVED = GetDeviceCaps(iHDC, iNUMRESERVED)
End Property

Public Property Get COLORRES() As Long
    COLORRES = GetDeviceCaps(iHDC, iCOLORRES)
End Property

Public Property Get PHYSICALWIDTH() As Long
    PHYSICALWIDTH = GetDeviceCaps(iHDC, iPHYSICALWIDTH)
End Property

Public Property Get PHYSICALHEIGHT() As Long
    PHYSICALHEIGHT = GetDeviceCaps(iHDC, iPHYSICALHEIGHT)
End Property

Public Property Get PHYSICALOFFSETX() As Long
    PHYSICALOFFSETX = GetDeviceCaps(iHDC, iPHYSICALOFFSETX)
End Property

Public Property Get PHYSICALOFFSETY() As Long
    PHYSICALOFFSETY = GetDeviceCaps(iHDC, iPHYSICALOFFSETY)
End Property

Public Property Get SCALINGFACTORX() As Long
    SCALINGFACTORX = GetDeviceCaps(iHDC, iSCALINGFACTORX)
End Property

Public Property Get SCALINGFACTORY() As Long
    SCALINGFACTORY = GetDeviceCaps(iHDC, iSCALINGFACTORY)
End Property

Public Property Get DT_RASDISPLAY() As Long
    DT_RASDISPLAY = GetDeviceCaps(iHDC, iDT_RASDISPLAY)
End Property

Public Property Get DT_RASPRINTER() As Long
    DT_RASPRINTER = GetDeviceCaps(iHDC, iDT_RASPRINTER)
End Property

Public Property Get DT_RASCAMERA() As Long
    DT_RASCAMERA = GetDeviceCaps(iHDC, iDT_RASCAMERA)
End Property

Public Property Get DT_CHARSTREAM() As Long
    DT_CHARSTREAM = GetDeviceCaps(iHDC, iDT_CHARSTREAM)
End Property

Public Property Get DT_METAFILE() As Long
    DT_METAFILE = GetDeviceCaps(iHDC, iDT_METAFILE)
End Property

Public Property Get DT_DISPFILE() As Long
    DT_DISPFILE = GetDeviceCaps(iHDC, iDT_DISPFILE)
End Property

Public Property Get CC_NONE() As Long
    CC_NONE = GetDeviceCaps(iHDC, iCC_NONE)
End Property

Public Property Get CC_CIRCLES() As Long
    CC_CIRCLES = GetDeviceCaps(iHDC, iCC_CIRCLES)
End Property

Public Property Get CC_PIE() As Long
    CC_PIE = GetDeviceCaps(iHDC, iCC_PIE)
End Property

Public Property Get CC_CHORD() As Long
    CC_CHORD = GetDeviceCaps(iHDC, iCC_CHORD)
End Property

Public Property Get CC_ELLIPSES() As Long
    CC_ELLIPSES = GetDeviceCaps(iHDC, iCC_ELLIPSES)
End Property

Public Property Get CC_WIDE() As Long
    CC_WIDE = GetDeviceCaps(iHDC, iCC_WIDE)
End Property

Public Property Get CC_STYLED() As Long
    CC_STYLED = GetDeviceCaps(iHDC, iCC_STYLED)
End Property

Public Property Get CC_WIDESTYLED() As Long
    CC_WIDESTYLED = GetDeviceCaps(iHDC, iCC_WIDESTYLED)
End Property

Public Property Get CC_INTERIORS() As Long
    CC_INTERIORS = GetDeviceCaps(iHDC, iCC_INTERIORS)
End Property

Public Property Get CC_ROUNDRECT() As Long
    CC_ROUNDRECT = GetDeviceCaps(iHDC, iCC_ROUNDRECT)
End Property

Public Property Get LC_NONE() As Long
    LC_NONE = GetDeviceCaps(iHDC, iLC_NONE)
End Property

Public Property Get LC_POLYLINE() As Long
    LC_POLYLINE = GetDeviceCaps(iHDC, iLC_POLYLINE)
End Property

Public Property Get LC_MARKER() As Long
    LC_MARKER = GetDeviceCaps(iHDC, iLC_MARKER)
End Property

Public Property Get LC_POLYMARKER() As Long
    LC_POLYMARKER = GetDeviceCaps(iHDC, iLC_POLYMARKER)
End Property

Public Property Get LC_WIDE() As Long
    LC_WIDE = GetDeviceCaps(iHDC, iLC_WIDE)
End Property

Public Property Get LC_STYLED() As Long
    LC_STYLED = GetDeviceCaps(iHDC, iLC_STYLED)
End Property

Public Property Get LC_WIDESTYLED() As Long
    LC_WIDESTYLED = GetDeviceCaps(iHDC, iLC_WIDESTYLED)
End Property

Public Property Get LC_INTERIORS() As Long
    LC_INTERIORS = GetDeviceCaps(iHDC, iLC_INTERIORS)
End Property

Public Property Get PC_NONE() As Long
    PC_NONE = GetDeviceCaps(iHDC, iPC_NONE)
End Property

Public Property Get PC_RECTANGLE() As Long
    PC_RECTANGLE = GetDeviceCaps(iHDC, iPC_RECTANGLE)
End Property

Public Property Get PC_WINDPOLYGON() As Long
    PC_WINDPOLYGON = GetDeviceCaps(iHDC, iPC_WINDPOLYGON)
End Property

Public Property Get PC_TRAPEZOID() As Long
    PC_TRAPEZOID = GetDeviceCaps(iHDC, iPC_TRAPEZOID)
End Property

Public Property Get PC_SCANLINE() As Long
    PC_SCANLINE = GetDeviceCaps(iHDC, iPC_SCANLINE)
End Property

Public Property Get PC_WIDE() As Long
    PC_WIDE = GetDeviceCaps(iHDC, iPC_WIDE)
End Property

Public Property Get PC_STYLED() As Long
    PC_STYLED = GetDeviceCaps(iHDC, iPC_STYLED)
End Property

Public Property Get PC_WIDESTYLED() As Long
    PC_WIDESTYLED = GetDeviceCaps(iHDC, iPC_WIDESTYLED)
End Property

Public Property Get PC_INTERIORS() As Long
    PC_INTERIORS = GetDeviceCaps(iHDC, iPC_INTERIORS)
End Property

Public Property Get CP_NONE() As Long
    CP_NONE = GetDeviceCaps(iHDC, iCP_NONE)
End Property

Public Property Get CP_RECTANGLE() As Long
    CP_RECTANGLE = GetDeviceCaps(iHDC, iCP_RECTANGLE)
End Property

Public Property Get CP_REGION() As Long
    CP_REGION = GetDeviceCaps(iHDC, iCP_REGION)
End Property

Public Property Get TC_OP_CHARACTER() As Long
    TC_OP_CHARACTER = GetDeviceCaps(iHDC, iTC_OP_CHARACTER)
End Property

Public Property Get TC_OP_STROKE() As Long
    TC_OP_STROKE = GetDeviceCaps(iHDC, iTC_OP_STROKE)
End Property

Public Property Get TC_CP_STROKE() As Long
    TC_CP_STROKE = GetDeviceCaps(iHDC, iTC_CP_STROKE)
End Property

Public Property Get TC_CR_90() As Long
    TC_CR_90 = GetDeviceCaps(iHDC, iTC_CR_90)
End Property

Public Property Get TC_CR_ANY() As Long
    TC_CR_ANY = GetDeviceCaps(iHDC, iTC_CR_ANY)
End Property

Public Property Get TC_SF_X_YINDEP() As Long
    TC_SF_X_YINDEP = GetDeviceCaps(iHDC, iTC_SF_X_YINDEP)
End Property

Public Property Get TC_SA_DOUBLE() As Long
    TC_SA_DOUBLE = GetDeviceCaps(iHDC, iTC_SA_DOUBLE)
End Property

Public Property Get TC_SA_INTEGER() As Long
    TC_SA_INTEGER = GetDeviceCaps(iHDC, iTC_SA_INTEGER)
End Property

Public Property Get TC_SA_CONTIN() As Long
    TC_SA_CONTIN = GetDeviceCaps(iHDC, iTC_SA_CONTIN)
End Property

Public Property Get TC_EA_DOUBLE() As Long
    TC_EA_DOUBLE = GetDeviceCaps(iHDC, iTC_EA_DOUBLE)
End Property

Public Property Get TC_IA_ABLE() As Long
    TC_IA_ABLE = GetDeviceCaps(iHDC, iTC_IA_ABLE)
End Property

Public Property Get TC_UA_ABLE() As Long
    TC_UA_ABLE = GetDeviceCaps(iHDC, iTC_UA_ABLE)
End Property

Public Property Get TC_SO_ABLE() As Long
    TC_SO_ABLE = GetDeviceCaps(iHDC, iTC_SO_ABLE)
End Property

Public Property Get TC_RA_ABLE() As Long
    TC_RA_ABLE = GetDeviceCaps(iHDC, iTC_RA_ABLE)
End Property

Public Property Get TC_VA_ABLE() As Long
    TC_VA_ABLE = GetDeviceCaps(iHDC, iTC_VA_ABLE)
End Property

Public Property Get TC_RESERVED() As Long
    TC_RESERVED = GetDeviceCaps(iHDC, iTC_RESERVED)
End Property

Public Property Get TC_SCROLLBLT() As Long
    TC_SCROLLBLT = GetDeviceCaps(iHDC, iTC_SCROLLBLT)
End Property

Public Property Get RC_NONE() As Long
    RC_NONE = GetDeviceCaps(iHDC, iRC_NONE)
End Property

Public Property Get RC_BITBLT() As Long
    RC_BITBLT = GetDeviceCaps(iHDC, iRC_BITBLT)
End Property

Public Property Get RC_BANDING() As Long
    RC_BANDING = GetDeviceCaps(iHDC, iRC_BANDING)
End Property

Public Property Get RC_SCALING() As Long
    RC_SCALING = GetDeviceCaps(iHDC, iRC_SCALING)
End Property

Public Property Get RC_BITMAP64() As Long
    RC_BITMAP64 = GetDeviceCaps(iHDC, iRC_BITMAP64)
End Property

Public Property Get RC_GDI20_OUTPUT() As Long
    RC_GDI20_OUTPUT = GetDeviceCaps(iHDC, iRC_GDI20_OUTPUT)
End Property

Public Property Get RC_GDI20_STATE() As Long
    RC_GDI20_STATE = GetDeviceCaps(iHDC, iRC_GDI20_STATE)
End Property

Public Property Get RC_SAVEBITMAP() As Long
    RC_SAVEBITMAP = GetDeviceCaps(iHDC, iRC_SAVEBITMAP)
End Property

Public Property Get RC_DI_BITMAP() As Long
    RC_DI_BITMAP = GetDeviceCaps(iHDC, iRC_DI_BITMAP)
End Property

Public Property Get RC_PALETTE() As Long
    RC_PALETTE = GetDeviceCaps(iHDC, iRC_PALETTE)
End Property

Public Property Get RC_DIBTODEV() As Long
    RC_DIBTODEV = GetDeviceCaps(iHDC, iRC_DIBTODEV)
End Property

Public Property Get RC_BIGFONT() As Long
    RC_BIGFONT = GetDeviceCaps(iHDC, iRC_BIGFONT)
End Property

Public Property Get RC_STRETCHBLT() As Long
    RC_STRETCHBLT = GetDeviceCaps(iHDC, iRC_STRETCHBLT)
End Property

Public Property Get RC_FLOODFILL() As Long
    RC_FLOODFILL = GetDeviceCaps(iHDC, iRC_FLOODFILL)
End Property

Public Property Get RC_STRETCHDIB() As Long
    RC_STRETCHDIB = GetDeviceCaps(iHDC, iRC_STRETCHDIB)
End Property

Public Property Get RC_OP_DX_OUTPUT() As Long
    RC_OP_DX_OUTPUT = GetDeviceCaps(iHDC, iRC_OP_DX_OUTPUT)
End Property

Public Property Get RC_DEVBITS() As Long
    RC_DEVBITS = GetDeviceCaps(iHDC, iRC_DEVBITS)
End Property

