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?
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
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
i know that directx is the most used in VB6, by it's speed and power. but, for me, it's very complicate to startd
i need a tutorial for Introdution\basics, at least for i start
can you help me on that friend?
thanks for all
Bookmarks