[已解决]关于用CameraDll鼠标截图,双击无法保存的问题.
本帖最后由 雨林GG 于 2010-8-10 07:49 编辑在论坛找的代码,想添加到自己的局域网聊天中,但不管是用1.0还是7.0哪个版本的都出现了无法保存的问题,请各位帮忙看看,哪个地方出问题了?#include <ScreenCapture.au3>
#include <GUIConstantsEx.au3>
#include <Clipboard.au3>
#include <GDIPlus.au3>
$hGUI = GUICreate("截屏工具", 400, 180)
$Button1 = GUICtrlCreateButton("鼠标截图", 150, 95, 100, 30)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $Button1
Camera()
EndSwitch
WEnd
GUIDelete()
Func Camera()
WinSetState($hGUI, "", @SW_HIDE)
;RunWait("rundll32.exe CameraDll.dll,CameraSubArea",'',@SW_HIDE)
DllCall(@ScriptDir & '\CameraDll.dll', 'int', 'CameraSubArea', 'hwnd', 0)
$hBitmap = _ClipBoard_GetData($CF_BITMAP)
_ScreenCapture_SaveImage(@ScriptDir & '\Capture.jpg', $hBitmap)
WinSetState($hGUI, "", @SW_SHOW)
EndFunc ;==>Camera 本帖最后由 republican 于 2010-8-10 07:41 编辑
回复 1# 雨林GG
Camera代码杂糅在一起了......该DLL已经截了图,就不要再用ScreenCapture函数了,应该用GDI的函数。
应该这样用的。#include <ScreenCapture.au3>
#include <GUIConstantsEx.au3>
#include <Clipboard.au3>
#include <GDIPlus.au3>
$hGUI = GUICreate("截屏工具", 400, 180)
$Button1 = GUICtrlCreateButton("鼠标截图", 150, 95, 100, 30)
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $Button1
Camera()
EndSwitch
WEnd
GUIDelete()
Func Camera()
WinSetState($hGUI, "", @SW_HIDE)
;RunWait("rundll32.exe CameraDll.dll,CameraSubArea",'',@SW_HIDE)
DllCall(@ScriptDir & '\CameraDll.dll', 'int', 'CameraSubArea', 'hwnd', 0)
_GDIPlus_Startup()
_ClipBoard_Open(0)
$iVerifyPics = _ClipBoard_GetDataEx($CF_BITMAP)
$iVerifyPics = _GDIPlus_BitmapCreateFromHBITMAP($iVerifyPics)
_GDIPlus_ImageSaveToFile ($iVerifyPics, @ScriptDir& "\GDIPlus_Image.jpg")
_ClipBoard_Close()
WinSetState($hGUI, "", @SW_SHOW)
EndFunc ;==>Camera 回复 2# republican
谢谢您了!!~~ 回复 2# republican
_ClipBoard_Open(0)
$hBitmap = _ClipBoard_GetDataEx($CF_BITMAP)
_ScreenCapture_SaveImage(@ScriptDir & '\Capture.jpg', $hBitmap)
_ClipBoard_Close()
这样好像也可以啊! 回复 4# 雨林GG
这个倒是没留意..... 谢谢楼主分享这个dll 留个印记可以记 谢谢楼主提供
页:
[1]