Public Sub Blt(ByVal img As Image, ByVal e As Graphics, ByVal rct As Rectangle)
Dim graph As Graphics = Graphics.FromImage(img)
Dim imgHDC As Long = graph.GetHdc.ToInt64
Dim hdc As Long = e.GetHdc.ToInt64
Dim retval As Long
retval = BitBlt(hdc, CRD_AREA.X, CRD_AREA.Y, CRD_AREA.Width, CRD_AREA.Height, imgHDC, 0, 0, &HCC0020)
graph.Dispose()
End Sub
Public Sub Blt(ByVal img As Image, ByVal e As Graphics, ByVal rct As Rectangle)
Dim graph As Graphics = Graphics.FromImage(img)
Dim imgHDC As Integer = graph.GetHdc.ToInt32
Dim hdc As Integer = e.GetHdc.ToInt32
Dim retval As Integer
retval = BitBlt(hdc, CRD_AREA.X, CRD_AREA.Y, CRD_AREA.Width, CRD_AREA.Height, imgHDC, 0, 0, &HCC0020)
graph.ReleaseDC(imgHDC)
graph.Dispose()
e.ReleaseDC(hdc)
End Sub
Declare Function BitBlt Lib "gdi32.dll" (ByVal hDestDC As IntPtr, ByVal x As Int32, _
ByVal y As Int32, ByVal nWidth As Int32, ByVal nHeight As Int32, ByVal hSrcDC As IntPtr, _
ByVal xSrc As Int32, ByVal ySrc As Int32, ByVal dwRop As Int32) As Int32
Public Sub Blt(ByVal img As Image, ByVal e As Graphics, ByVal rct As Rectangle)
Dim graph As Graphics = Graphics.FromImage(img)
Dim imgHDC As IntPtr = graph.GetHdc
Dim hdc As IntPtr = e.GetHdc
Dim retval As Integer
retval = BitBlt(hdc.ToInt32, CRD_AREA.X, CRD_AREA.Y, CRD_AREA.Width, CRD_AREA.Height, imgHDC.ToInt32, 0, 0, &HCC0020)
graph.ReleaseDC(imgHDC)
graph.Dispose()
e.ReleaseDC(hdc)
End Sub