-
January 15th, 2013, 01:23 PM
#1
[VB6] - about DC's
i did 1 class for working with DC's(double buffering):
Code:
Option Explicit
Private Type DC
handleDC As Long
handleBMP As Long
handleRefBMP As Long
End Type
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Dim SourceDC As DC
Dim lngWidth As Long
Dim lngHeight As Long
Public Sub GetImage(ByRef hdc As Long, ByRef Width As Long, ByRef Height As Long)
SourceDC.handleDC = CreateCompatibleDC(hdc)
SourceDC.handleBMP = CreateCompatibleBitmap(SourceDC.handleDC, Width, Height)
SourceDC.handleRefBMP = SelectObject(SourceDC.handleDC, SourceDC.handleBMP)
BitBlt SourceDC.handleDC, 0, 0, Width, Height, hdc, 0, 0, vbSrcCopy
lngHeight = Height
lngWidth = Width
End Sub
Public Sub DrawImage(ByRef hdc As Long)
BitBlt hdc, 0, 0, lngWidth, lngHeight, SourceDC.handleDC, 0, 0, vbSrcCopy
End Sub
Private Sub Class_Terminate()
DeleteObject SelectObject(SourceDC.handleDC, SourceDC.handleRefBMP)
DeleteObject SourceDC.handleBMP
DeleteDC SourceDC.handleDC
End Sub
why instead copy\draw the image, copy a mask image?
-
January 15th, 2013, 04:43 PM
#2
Re: [VB6] - about DC's
It gets copied to the GPU rather than use the CPU that VB6 uses. There is video memory that can be accessed faster than pc memory, and draw it to the screen. It stores data in its buffer
-
January 15th, 2013, 05:20 PM
#3
Re: [VB6] - about DC's
Originally Posted by dglienna
It gets copied to the GPU rather than use the CPU that VB6 uses. There is video memory that can be accessed faster than pc memory, and draw it to the screen. It stores data in its buffer
what you are talking about?
i need a double buffer faster, for avoid 1 flicker
-
January 15th, 2013, 09:44 PM
#4
Re: [VB6] - about DC's
Look up DirectDraw. Back in the day, VB6 had a lot of great people supporting it. http://www.oocities.org/vbasicprogramming/DDTut1.htm Now, you get what's left!
-
January 16th, 2013, 07:00 AM
#5
-
January 16th, 2013, 01:05 PM
#6
Re: [VB6] - about DC's
Not from this decade. See if you can track down an old version . VBForums.com might have some of my old stuff still around...
http://externalweb.exhedra.com/Direc...DA_SoundFx.asp
-
January 16th, 2013, 01:10 PM
#7
Re: [VB6] - about DC's
Originally Posted by dglienna
sorry.. server error
-
January 16th, 2013, 03:15 PM
#8
Re: [VB6] - about DC's
Told you that. It worked fine in 2006
-
January 16th, 2013, 03:26 PM
#9
Re: [VB6] - about DC's
Originally Posted by dglienna
Told you that. It worked fine in 2006
hey... my engish isn't 100%, but i try hehehe
can you give me another link?
thanks
-
January 16th, 2013, 06:11 PM
#10
Re: [VB6] - about DC's
VBForums.com was the hang out back then...
-
January 17th, 2013, 07:30 AM
#11
Re: [VB6] - about DC's
Originally Posted by dglienna
VBForums.com was the hang out back then...
i'm register there hehehe
but thanks for all
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
|