Terenz Posted December 3, 2015 Posted December 3, 2015 (edited) CaptureWnd of ScreenCapture UDF can't capture offscreen and i don't care. But i don't like the result of the output image, example with this script:#include <ScreenCapture.au3> Run("notepad.exe") $hNot = WinWait("[CLASS:Notepad]") WinMove($hNot, "", -180, 0, 300, 300) ; just for test of a window in offscreen position! _ScreenCapture_CaptureWnd("Test.jpg", $hNot) WinClose($hNot)This is the image:With all that black background, instead i prefer something like this ( edited image )The UDF use _WinAPI_GetDesktopWindow and _WinAPI_GetDC so probabily but i don't know how to do is possible to use region ( CreateRectRgn \ SetWindowRgn? ) to subtract the "un-visible" area for get the result like the second image. Please show me how to do, thanks Or are welcome any suggestion Edited December 3, 2015 by Terenz Nothing is so strong as gentleness. Nothing is so gentle as real strength
UEZ Posted December 3, 2015 Posted December 3, 2015 #include <ScreenCapture.au3> Run("notepad.exe") $hNot = WinWait("[CLASS:Notepad]") WinMove($hNot, "", -180, 0, 300, 300) Sleep(500) _ScreenCapture_Capture("Test.jpg", 0, 0, -180 + 300, 300) WinClose($hNot) 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Terenz Posted December 3, 2015 Author Posted December 3, 2015 UEZ,Thanks for the answer but don't take the example too serious I'll clarify, the question is:CaptureWnd for offscreen window add that ugly black background. Instead i want to have in the saved image only the visible part of the window. I have think to use region but that was just an idea. The expected result is the second image on the first post. Thanks again Nothing is so strong as gentleness. Nothing is so gentle as real strength
UEZ Posted December 3, 2015 Posted December 3, 2015 That's what the code is doing. It captures only the visible part of the window. 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Terenz Posted December 3, 2015 Author Posted December 3, 2015 Yes but with that code i can cover if the window is moved on the left, but if is offscreen on top-left, top-right, bottom, bottom-left, bottom-right and so on there are many situation. Regions wasn't a good idea? Nothing is so strong as gentleness. Nothing is so gentle as real strength
UEZ Posted December 3, 2015 Posted December 3, 2015 You can check for the coordinate of the window and check afterwards which part is off the screen. That shouldn't be a big deal. 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
johnmcloud Posted December 3, 2015 Posted December 3, 2015 Make a copy of CaptureWnd function and add a couple of new variable for check SM_CXSCREEN - $SM_CYSCREEN using _WinAPI_GetSystemMetrics. Than compare the original variable of the Window with that and if is > than use the value reported from GetSystemMetrics. In this case you have always a good image I don't know if it work in a multi monitor configuration, i don't have one. Maybe UEZ know.
UEZ Posted December 3, 2015 Posted December 3, 2015 I've one in my office (3 screens). If I find a slot I will code a function. 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
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