Return image size in FindImagePos function

Ideas for new features & functions

Moderators: JRL, Dorian (MJT support)

Post Reply
bossydog9
Junior Coder
Posts: 29
Joined: Wed Jan 08, 2020 12:46 pm

Return image size in FindImagePos function

Post by bossydog9 » Thu Jan 30, 2020 6:23 pm

Suggestion: A return_offset value 9 that returns the width and height of the image.

Whilst not actually an offset, I think an exception could be made and it wouldn't be out of place. Also, since the top-left position (return_offset=0) and the bottom-right position (return_offset=4) can be returned, it's an easy calculation of the return values of return_offset 4 minus the return values of return_offset 0.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 583
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Return image size in FindImagePos function

Post by Dorian (MJT support) » Thu Jan 30, 2020 7:17 pm

bossydog9 wrote:
Thu Jan 30, 2020 6:23 pm
Since the top-left position (return_offset=0) and the bottom-right position (return_offset=4) can be returned, it's an easy calculation of the return values of return_offset 4 minus the return values of return_offset 0.
That's a very good point!

I'll pass this on to Dev
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Marcus Tettmar
Site Admin
Posts: 7122
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Return image size in FindImagePos function

Post by Marcus Tettmar » Wed Feb 05, 2020 9:41 am

I'm confused. Width and height is always the width and height of the needle image. Which you already know.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

bossydog9
Junior Coder
Posts: 29
Joined: Wed Jan 08, 2020 12:46 pm

Re: Return image size in FindImagePos function

Post by bossydog9 » Wed Feb 05, 2020 1:37 pm

Yes, but the script doesn't...I know you can get the size, programmatically, using an image object on a dialog, but that's a bit convoluted, don't you think? Given that a significant part of MS concerns images, it's odd that it doesn't have a size function, or does it?

User avatar
Marcus Tettmar
Site Admin
Posts: 7122
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Return image size in FindImagePos function

Post by Marcus Tettmar » Thu Feb 06, 2020 10:09 am

But the needle image is not dynamic. It's created at design time. It's not created at runtime. It's a known quantity. We create all kinds of variables and initialise them at design time. Why not create variables for width and height in the same way. Am I missing something?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Marcus Tettmar
Site Admin
Posts: 7122
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Return image size in FindImagePos function

Post by Marcus Tettmar » Thu Feb 06, 2020 11:12 am

BTW - I'm not against the idea of a new function which returns the dimensions - and maybe other properties - of an image file. Something like:

GetImageDimensions>filename,height,width

But doesn't make sense to me to make this part of FindImagePos which uses a known needle anyway.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

bossydog9
Junior Coder
Posts: 29
Joined: Wed Jan 08, 2020 12:46 pm

Re: Return image size in FindImagePos function

Post by bossydog9 » Thu Feb 06, 2020 5:25 pm

..that'll do nicely... :D

Post Reply