欢迎光临
我们一直在努力

用vb捕捉屏幕图象_visualbasic教程

建站超值云服务器,限时71元/月

声明:
PrivateDeclareFunctionReleaseDCLib”user32″(ByValhwndAsLong,ByValhdcAsLong)AsLong
PrivateDeclareFunctionOpenClipboardLib”user32″(ByValhwndAsLong)AsLong
PrivateDeclareFunctionEmptyClipboardLib”user32″()AsLong
PrivateDeclareFunctionSetClipboardDataLib”user32″(ByValwFormatAsLong,ByValhMemAsLong)AsLong
PrivateDeclareFunctionSelectObjectLib”gdi32″(ByValhdcAsLong,ByValhObjectAsLong)AsLong
PrivateDeclareFunctionDeleteDCLib”gdi32″(ByValhdcAsLong)AsLong
PrivateDeclareFunctionBitBltLib”gdi32″(ByValhDestDCAsLong,
ByValxAsLong,ByValyAsLong,ByValnWidthAsLong,ByValnHeightAsLong,ByValhSrcDCAsLong,ByValxSrcAsLong,ByValySrcAsLong,ByValdwRopAsLong)AsLong
PrivateDeclareFunctionCreateDCLib”gdi32″Alias”CreateDCA”(ByVallpDriverNameAsString,ByVallpDeviceNameAsString,ByVallpOutputAsString,lpInitDataAsLong)AsLong
PrivateDeclareFunctionCreateCompatibleDCLib”gdi32″(ByValhdcAsLong)AsLong
PrivateDeclareFunctionCreateCompatibleBitmapLib”gdi32″(ByValhdcAsLong,ByValnWidthAsLong,ByValnHeightAsLong)AsLong
PrivateDeclareFunctionCloseClipboardLib”user32″()AsLong
函数:
SubScrnCap(Lt,Top,Rt,Bot)
rWidth=Rt-Lt
rHeight=Bot-Top
SourceDC=CreateDC(“DISPLAY”,0,0,0)
DestDC=CreateCompatibleDC(SourceDC)
BHandle=CreateCompatibleBitmap(SourceDC,rWidth,rHeight)
SelectObjectDestDC,BHandle
BitBltDestDC,0,0,rWidth,rHeight,SourceDC,Lt,Top,&HCC0020
Wnd=Screen.ActiveForm.hwnd
OpenClipboardWnd
EmptyClipboard
SetClipboardData2,BHandle
CloseClipboard
DeleteDCDestDC
ReleaseDCDHandle,SourceDC
EndSub
以下的示例把屏幕图象捕捉后,放到Picture1中。
SubCommand1_Click()
Form1.Visible=False
ScrnCap0,0,640,480
Form1.Visible=True
picture1=Clipboard.GetData()
EndSub->

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 用vb捕捉屏幕图象_visualbasic教程
分享到: 更多 (0)