'05-Apr-2002 First Release to PSC *(Deleted by Hacker)
'09-Apr-2002 Improved speed, more comments and error handling
'11-Apr-2002 Added 3D clock hands
'12-Apr-2002 Improved clock timer event handler
'14-Apr-2002 Added Circle/Ellipse draw
'16-Apr-2002 Circle/Ellipse draw by Quadrants
'19-Apr-2002 Changed to RGBQuad (easier to understand DIBits)
'22-Apr-2002 Added circle thick/thin
'26-Apr-2002 Pass hDC together with LineGP/CircleGp
'........... Simplified blending code
'........... Common SetRGBComponents Sub
'28-Apr-2002 Added Arc drawing
'........... Several tweaks/speedups
'30-May-2002 Added Rounded Rectangle
'01-Jun-2002 Bevel/3D Rounded Rectangle
Public Enum cThickness
Thin
Thick
End Enum
Private Type RGBQUAD
Blue As Byte
Green As Byte
Red As Byte
Reserved As Byte
End Type
Private Type BITMAPINFOHEADER
biSize As Long
biWidth As Long
biHeight As Long
biPlanes As Integer
biBitCount As Integer
biCompression As Long
biSizeImage As Long
biXPelsPerMeter As Long
biYPelsPerMeter As Long
biClrUsed As Long
biClrImportant As Long
End Type
Private Type BITMAPINFO
bmiHeader As BITMAPINFOHEADER
End Type
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Const DIB_RGB_COLORS As Long = 0
Private Const Pi As Single = 3.141592
Private Const HalfPi As Single = Pi / 2
Private Const cThin As Single = Pi * 0.34
Private Const cThick As Single = Pi * 0.17
Private Const Rads As Single = Pi / 180
Private Const PS_SOLID As Long = 0
Private Binfo As BITMAPINFO
Private buf() As RGBQUAD
Private InDIBits As Boolean
Private Red As Long
Private Green As Long
Private Blue As Long
Private m_Color As Long
Private m_hDC As Long
Private m_W1 As Long
Private m_H1 As Long
Private m_Handle As Long
Private Declare Function Arc Lib "gdi32" (ByVal hdc As Long, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal X3 As Long, ByVal Y3 As Long, ByVal X4 As Long, ByVal Y4 As Long) As Long
Private Declare Function OleTranslateColor Lib "olepro32.dll" (ByVal OLE_COLOR As Long, ByVal HPALETTE As Long, pccolorref As Long) As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function SetPixelV Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long
Private Declare Function GetDIBits Lib "gdi32" (ByVal hdc As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BITMAPINFO, ByVal wUsage As Long) As Long
Private Declare Function SetDIBits Lib "gdi32" (ByVal hdc As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BITMAPINFO, ByVal wUsage As Long) As Long
'Public Sub Widget(rct As RECT)
'End Sub
Private Function TranslateColour(ByVal clr As OLE_COLOR, _
Optional hPal As Long = 0) As Long
If OleTranslateColor(clr, hPal, TranslateColour) Then
TranslateColour = vbBlack 'CLR_INVALID
End If
End Function
Public Sub DIB(ByVal hdc As Long, ByVal Handle As Long, ByVal W1 As Long, ByVal H1 As Long)