Ian
New Member
Posts: 5
|
Post by Ian on Feb 6, 2018 6:00:07 GMT
What I've been trying to test:
saveRegion = Region(79,345,2375,925) saveRegion:save("test.png") The progam executes without any errors, but no image is saved. By default the image is supposed to save to the same directory as the script, right?
The more complicated program I'm trying to get working:
imgnum = 0 saveRegion = Region(79,345,2375,925) while(1) do toast(imgnum .. ".png") saveRegion:save(tostring(imgnum) .. ".png") swipe(Location(100,1200),Location(100,700)) wait(1) imgnum = imgnum + 1 end I want it to take a picture of the area, scroll, then take a new picture. The program toasts and swipes correctly but no image is saved.
SaveRegion:highlight() does work and highlights the area I expect.
|
|
|
Post by AnkuLua on Feb 6, 2018 7:02:00 GMT
|
|
Ian
New Member
Posts: 5
|
Post by Ian on Feb 6, 2018 7:54:59 GMT
Isn't that how I used it in my first example?
|
|
|
Post by AnkuLua on Feb 6, 2018 8:34:16 GMT
You said "By default the image is supposed to save to the same directory as the script, right?"
No. It will save the image to fileName under the directory of "imagePath". That's "image" directory by default.
|
|
Ian
New Member
Posts: 5
|
Post by Ian on Feb 6, 2018 9:05:14 GMT
My assumption was based off the line: "The default image path is image directory of the starting script file." found here: ankulua.boards.net/thread/7/settings#setImagePathI added the line "setImagePath(scriptPath())" and an image is now being captured correctly, though the image is in black and white. It probably doesn't matter for my application, but I'm still curious why that is.
|
|