JCMCNL Posted May 19, 2007 Share Posted May 19, 2007 Hey all, I want to use the screen capture function in the autoit3lib package, however I need it to use pixel coordinates that are relative to the active window, I've tried the autoitsetoption pixelcoordmodes (all three of them) and screen capture still does the coordinates relative to the whole screen, does anyone know how I can set it to capture based on window coords? Any help would be appreciated and if any clarification is needed let me know. Thanks in advance JCMCNL Link to comment Share on other sites More sharing options...
Gif Posted May 19, 2007 Share Posted May 19, 2007 (edited) Hey all, I want to use the screen capture function in the autoit3lib package, however I need it to use pixel coordinates that are relative to the active window, I've tried the autoitsetoption pixelcoordmodes (all three of them) and screen capture still does the coordinates relative to the whole screen, does anyone know how I can set it to capture based on window coords? Any help would be appreciated and if any clarification is needed let me know. Thanks in advance JCMCNL $window = GUICreate("screen capture", 400, 300) GUISetState() _ScreenCap_CaptureWnd(@desktopcommondir , $window) Edited May 19, 2007 by c4nm7 Link to comment Share on other sites More sharing options...
JCMCNL Posted May 19, 2007 Author Share Posted May 19, 2007 $window = GUICreate("screen capture", 400, 300) GUISetState() _ScreenCap_CaptureWnd(@desktopcommondir , $window) Thanks man... I should have seen that in the help file, only two commands down. lol. Link to comment Share on other sites More sharing options...
Gif Posted May 19, 2007 Share Posted May 19, 2007 Hey all, I want to use the screen capture function in the autoit3lib package, however I need it to use pixel coordinates that are relative to the active window, I've tried the autoitsetoption pixelcoordmodes (all three of them) and screen capture still does the coordinates relative to the whole screen, does anyone know how I can set it to capture based on window coords? Any help would be appreciated and if any clarification is needed let me know. Thanks in advance JCMCNL double posting... i didnt helped before? $hGUI = GUICreate("ScreenCap", 400, 300) GUISetState() _ScreenCap_CaptureWnd("c:\window.jpg", $hGUI) you should mention it though... Link to comment Share on other sites More sharing options...
Gif Posted May 19, 2007 Share Posted May 19, 2007 ok just saw the reply.... Link to comment Share on other sites More sharing options...
JCMCNL Posted May 19, 2007 Author Share Posted May 19, 2007 Hey Guys, Sorry but I have another question. I've tried the solution you gave me and it does work but I was wondering if it would be possible to capture only a specific section of the specified window. I tried adding coordinates to the window command but I received an error saying that I'm not using the correct number of params. So is it at all possible to specify a region of should I try and find another way around it? Thanks JCMCNL Link to comment Share on other sites More sharing options...
PaulIA Posted May 19, 2007 Share Posted May 19, 2007 Hey Guys, Sorry but I have another question. I've tried the solution you gave me and it does work but I was wondering if it would be possible to capture only a specific section of the specified window. I tried adding coordinates to the window command but I received an error saying that I'm not using the correct number of params. So is it at all possible to specify a region of should I try and find another way around it? Thanks JCMCNLThis will capture your entire GUI: #include <A3LScreenCap.au3> $hGUI = GUICreate("ScreenCap", 400, 300) GUISetState() _ScreenCap_CaptureWnd("c:\window.jpg", $hGUI)oÝ÷ Øò¢ê',Ûhqªmº·¥ªí¡ü¨º±"Ø^*.綶Ø^B¢ÝvzƧv¬²Ø^Ú-äç§ ªBjnçîبX¤zʺÚ"µÍÚ[ÛYH ÐLÓØÜY[Ø]LÉÝÂÛØ[ ÌÍÝXÝ ÌÍÚSY ÌÍÚUÜÈÜX]HÕRBÌÍÚÕRHHÕRPÜX]J ][ÝÔØÜY[Ø ][ÝË Ì BÕRTÙ]Ý]J BÈØHHÜÛYÛÜÙHÕRBÌÍÝXÝHÐTWÑÙ]Ú[ÝÔXÝ ÌÍÚÕRJBÌÍÚSYHÝXÝÙ]]J ÌÍÝXÝ ][ÝÓY ][ÝÊBÌÍÚUÜHÝXÝÙ]]J ÌÍÝXÝ ][ÝÕÜ ][ÝÈ BÔØÜY[ØÐØJ ][ÝÐÎÌLÒ[XYÙKÉ][ÝË ÌÍÚSY ÌÍÚUÜ ÌÍÚSY ÈL ÌÍÚUÜ ÈL Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
JCMCNL Posted May 19, 2007 Author Share Posted May 19, 2007 Haha, Damn you guys are fast. I'll try this out and let you know how it goes. Thanks for the information and sorry about the double posting earlier. JCMCNL Link to comment Share on other sites More sharing options...
NonoX Posted October 31, 2009 Share Posted October 31, 2009 Hello I just started using autoit and ran into the same problem. I try to capture a region of the active window. I used Client Coordinates (2) not to get problems with windows themes. when i use mousemove with x/y coordinates to see the mouse pointer and check that these are ok the region is correctly defined with those coordinates (the mouse move around the region exactly where i want). But when i use the same coordinates with _ScreenCaptureWnd I get a picture that is not exactly the same on different systems (All XP Pro) with or without themes. Is _ScreenCaptureWnd working with AutoSetItOption MouseCoords 2 ? i feel like only 0 was working. As i just started recently to use autoit I may be using these functions the wrong way Thanks NonoX AutoItSetOption("PixelCoordMode", 2) AutoItSetOption("MouseCoordMode", 2) $h = WinGetHandle($window_name) _ScreenCapture_CaptureWnd($tmp_file, $h, 443, 62, 462, 79, True) ; and MouseMove(443,62) MouseMove(462,79) ; does not match the same region 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