Jump to content

Autoit3Lib Help Needed


Recommended Posts

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

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 by c4nm7
Link to comment
Share on other sites

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

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

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

This will capture your entire GUI:

#include <A3LScreenCap.au3>

$hGUI = GUICreate("ScreenCap", 400, 300)
GUISetState()
_ScreenCap_CaptureWnd("c:\window.jpg", $hGUI)oÝ÷ Øò¢ê',Ûhqªmº·¥ªí¡ü¨º±"Ø^*.綶Ø^B¢Ýv­zƧ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

  • 2 years later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...