是这个意思吗?#NoTrayIcon
#include <ScreenCapture.au3>
#include <Memory.au3>
_GDIPlus_Startup()
Local $hBmp = _ScreenCapture_Capture()
Local $Bitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBmp)
Local $sImgCLSID = _GDIPlus_EncodersGetCLSID("jpg") ;create CLSID for a JPG image file type
Local $tGUID = _WinAPI_GUIDFromString($sImgCLSID) ;convert CLSID GUID to binary form and returns $tagGUID structure
Local $pEncoder = DllStructGetPtr($tGUID) ;get pointer of $tagGUID structure
Local $tParams = _GDIPlus_ParamInit(1) ;initialize an encoder parameter list and return $tagGDIPENCODERPARAMS structure
Local $tData = DllStructCreate("int Quality") ;create struct to set JPG quality setting
DllStructSetData($tData, "Quality", 30) ;quality 0-100 (0: lowest, 100: highest)
Local $pData = DllStructGetPtr($tData) ;get pointer from quality struct
_GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) ;add a value to an encoder parameter list
Local $pParams = DllStructGetPtr($tParams) ;get pointer of encoder parameter list
Local $pStream = _WinAPI_CreateStreamOnHGlobal() ;create stream
_GDIPlus_ImageSaveToStream($Bitmap, $pStream, $pEncoder, $pParams) ;save the bitmap in JPG format in memory
Local $hStream = _WinAPI_GetHGlobalFromStream($pStream)
Local $iSize = _MemGlobalSize($hStream)
Local $PMem = _MemGlobalLock($hStream)
Local $tStream = DllStructCreate("byte[" & $iSize & "]", $PMem)
Local $bData = DllStructGetData($tStream, 1)
_WinAPI_ReleaseStream($pStream)
_MemGlobalFree($hStream)
_GDIPlus_Shutdown()
MsgBox(0, 0, $bData)
|