Article ID: 189736
Article Last Modified on 5/13/2003
Option Explicit
Private 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
Private Sub Command1_Click()
Call BitBlt(hdc, ScaleX(Width, vbTwips, vbPixels) * 0.5, _
ScaleY(Height, vbTwips, vbPixels) * 0.5, _
ScaleX(Picture1.Width, vbTwips, vbPixels), _
ScaleY(Picture1.Height, vbTwips, vbPixels), _
Picture1.hdc, 0, 0, vbSrcCopy)
'**************************************************************
'Refresh 'this line is required for Visual Basic 6.0 to
'work if Form1.AutoRedraw is TRUE
'**************************************************************
End Sub
If the above project is run in Visual Basic 5.0, everything behaves as
expected. If run under Visual Basic 6.0, the program will not run as
expected. For the above code to work in Visual Basic 6.0, you must call
Refresh (as commented above).
Additional query words: kbDSupport kbVBp500bug kbVBp600bug kbdss kbVBp kbAPI kbBitmap
Keywords: kbbug KB189736