|
-
May 1st, 2002, 05:24 PM
#1
Thread Starter
Lively Member
DC mem clearing
I need to know how to clear a dc that i made with a function:
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
End Function
i made a dc, then bitblt to it, now i want to clear it (like me.cls for forms) Can anyone here help me out?
Often talked of, never seen,
Ever coming, never been,
Daily looked for, never here,
Still approaching, coming near,
Thousands for its visit wait,
But alas for their fate,
Tho' they expect me to appear,
They will never find me here.
What's this about?
-
May 2nd, 2002, 04:33 AM
#2
PowerPoster
Since this is my function you're using there Sure:
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
Last edited by Fox; May 2nd, 2002 at 04:37 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|