kopernic Posted June 16, 2010 Share Posted June 16, 2010 I have following problemPrintScreen button captures desktop with app window visible.Capture with Print ScreenAutoIT seems not to see anything inside this window - PixelGetColor returns a color of the background (or some icon if it is in a way).Capture captures clear desktop.Autoit captureCaptureWindow captures a part of a desktop covered with window.Autoit window captureIs there any workaround or am I doing somethin wrong??Kopernic Link to comment Share on other sites More sharing options...
UEZ Posted June 16, 2010 Share Posted June 16, 2010 ...Is there any workaround or am I doing somethin wrong??KopernicTo see what's wrong you should post your code.BR,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
kopernic Posted June 16, 2010 Author Share Posted June 16, 2010 To see what's wrong you should post your code. code is veeery basic #Include <ScreenCapture.au3> Run("C:\Program Files\xxx.exe","C:\Program Files\xxx") sleep(10000) _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image1.jpg") sleep(1000) _ScreenCapture_CaptureWnd(@MyDocumentsDir & "\GDIPlus_Image2.jpg",WinGetHandle("xxx")) Link to comment Share on other sites More sharing options...
UEZ Posted June 16, 2010 Share Posted June 16, 2010 Hmm, this is working for me: AutoItSetOption("WinTitleMatchMode", 4) #Include <ScreenCapture.au3> $pid = Run(@SystemDir & "\mspaint.exe") sleep(2000) _ScreenCapture_Capture(@ScriptDir & "\Screenshot_full.jpg") sleep(1000) _ScreenCapture_CaptureWnd(@ScriptDir & "\Screenshot_window.jpg", WinGetHandle("classname=MSPaintApp")) ProcessClose($pid) Exit Tested on Vista x32. BR, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
kopernic Posted June 16, 2010 Author Share Posted June 16, 2010 this is working for me: AutoItSetOption("WinTitleMatchMode", 4) #Include <ScreenCapture.au3> $pid = Run(@SystemDir & "\mspaint.exe") sleep(2000) _ScreenCapture_Capture(@ScriptDir & "\Screenshot_full.jpg") sleep(1000) _ScreenCapture_CaptureWnd(@ScriptDir & "\Screenshot_window.jpg", WinGetHandle("classname=MSPaintApp")) ProcessClose($pid) Exit Tested on Vista x32. I believe that this could be caused by this specific app - MTGO launcher (exec. name: renamer.exe) Capture and getpixelcolor work for other "regular" apps like paint or firefox. No trace of such a problem on google. I thik that somehow app window must be rendered directly into display device, in "empty" window area. Empty=only size, position etc but no content at all... Any idea? Link to comment Share on other sites More sharing options...
ChrisL Posted June 16, 2010 Share Posted June 16, 2010 I think what kopernic is trying to say is that when you do a screen capture with GDI+, windows that have a transparency value are not captured [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Malkey Posted June 16, 2010 Share Posted June 16, 2010 I managed to capture an active layered window with this script. Pressing Alt+"p" captures the active window. expandcollapse popup#include <GDIPlus.au3> #include <ClipBoard.au3> ; http://www.autoitscript.com/forum/index.php?showtopic=115672&view=findpost&p=807792 HotKeySet("p", "Ps") HotKeySet("!p", "AltPS") ;Shift-Alt-d HotKeySet("{ESC}", "Terminate") While 1 Sleep(10) WEnd Func Ps() Send("{PRINTSCREEN}") ; Screen _Main() ShellExecute(@ScriptDir & "\Image.jpg") EndFunc ;==>Ps Func AltPS() Send("!{PRINTSCREEN}") ; window _Main() ShellExecute(@ScriptDir & "\Image.jpg") EndFunc ;==>AltPS Func Terminate() Exit 0 EndFunc ;==>Terminate Func _Main() Local $hBmp, $hImage If Not _ClipBoard_Open(0) Then _WinAPI_ShowError("_ClipBoard_Open failed") $hBmp = _ClipBoard_GetDataEx($CF_BITMAP) _GDIPlus_Startup() $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBmp) ; Save bitmap to file _GDIPlus_ImageSaveToFile($hImage, @ScriptDir & "\Image.jpg") ;$sNewName) _GDIPlus_BitmapDispose($hImage) _GDIPlus_Shutdown() _ClipBoard_Close() EndFunc ;==>_Main Link to comment Share on other sites More sharing options...
ChrisL Posted June 16, 2010 Share Posted June 16, 2010 That's clever Malkey [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
kopernic Posted June 16, 2010 Author Share Posted June 16, 2010 ... and it surely works, as I'm getting some bitmap to work on.Butit still is not enough to use basic functions like pixelGetColor, pixelChecksum or pixelSearch.Is there any workaround? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now