Save screen shot of region located relative to mouse?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
OffScript
Posts: 1
Joined: 26 Jul 2021, 14:57

Save screen shot of region located relative to mouse?

Post by OffScript » 26 Jul 2021, 15:09

I will explain what I'm trying to do. I have a lot of data that is being held hostage by company that won't provide a way for me to export it. I can view it on the website of course. Imagine a line chart with a timeline on the x-axis and value on the y-axis. When you move the cursor over the chart a small box follows the cursor showing the exact value at that time point. The box is always in the same location relative the mouse. What I hope to do is make a script that slowly moves the mouse across the chart and takes a screen shot of just the region of that value box along the way. The main thing I just can't find the right solution for is a way to define the size of the region and location of where I'd like the screen shot. Does anyone know of any tools that would work with AHK to accomplish this. I plan to use machine vision to process the images and give me MY data back in useable form (ironically I've already got this seemingly complex part in place), I just need to scrape my data now.

User avatar
boiler
Posts: 16705
Joined: 21 Dec 2014, 02:44

Re: Save screen shot of region located relative to mouse?

Post by boiler » 26 Jul 2021, 15:20

Use the function CaptureScreen as posted by Linear Spoon in this thread. You can determine the position of where to capture by using MouseGetPos. There are also OCR routines that can be used by AHK which would allow you to capture the info as text instead of images, which it sounds like you are planning to do separately, but could be integrated into your AHK script.

Post Reply

Return to “Ask for Help (v1)”