API如何声明?结合下面的代码是,是用在条形码转换成图形时使用的????
Option Explicit
声明BitBlt、GetDesktopWindow、GetWindowDC、ReleaseDC这几个API函数略
Public RegUser As Boolean
Sub GetObjImage1(Obj As Object, OwnerForm As PictureBox, Picture1 As PictureBox)
'hDC
Dim hWndDesk As Long
Dim hDCDesk As Long
'区域表达变量
Dim x As Long
Dim y As Long
Dim w As Long
Dim h As Long
x = Obj.Left Screen.TwipsPerPixelX
y = Obj.Top Screen.TwipsPerPixelY
w = Obj.Width Screen.TwipsPerPixelX
h = Obj.Height Screen.TwipsPerPixelY
hDCDesk = OwnerForm.hdc
'取出图像
Call BitBlt(Picture1.hdc, 0, 0, w, h, hDCDesk, x, y, vbSrcCopy)
Call ReleaseDC(hWndDesk, hDCDesk)
End Sub