-
Bit Blt Quckie
Hey guys, im(or was) well familiar with bitblt. Just showing a friend some basic stuff, and it aint workin :P
Code:
Public Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Public Sub drawBike()
BitBlt frmMain.hDC, 0, 0, 202, 91, frmMain.picCar.hDC, 0, 0, vbSrcPaint
End Sub
Public Sub drawBikeMask()
BitBlt frmMain.hDC, 0, 0, 202, 91, frmMain.picCarMask.hDC, 0, 0, vbSrcAnd
End Sub
Public Sub drawLand()
BitBlt frmMain.hDC, 0, 0, 1280, 1024, frmMain.picLand.hDC, 0, 0, vbSrcPaint
End Sub
Public Sub Update()
frmMain.Cls
drawLand
drawBikeMask
drawBike
End Sub
I got the form/pictures autoredraw=true, and the image just wont mask. It just keeps the solid image.
-
Re: Bit Blt Quckie
Unless your form's BackColor is black, you probably want to use vbSrcCopy for drawLand. Other than that, your code is fine. Could there be a problem with the images? (I'm guessing you have the black/white of the mask reversed)