VB Code:
Public Type tRect
x as Long
y as Long
x2 as Long
y2 as Long
End Type
Declare Function FillRect Lib "user32" Alias "FillRect" (ByVal hdc As Long, lpRect As RECT, ByVal hBrush As Long) As Long
Public Function CreateDC(iH As Long, iW As Long) As Long
Dim Temp As Long
CreateDC = CreateCompatibleDC(frmMain.hdc)
Temp = CreateCompatibleBitmap(frmMain.hdc, iW, iH)
SelectObject CreateDC, Temp
DeleteObject Temp
'Clear the DC
Dim Rect as tRect
Rect.x2 = iw
Rect.y2 = ih
FillRect CreateDC, Rect, 0
End Function