cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve coordinates of an image inside another one

SOLVED
Highlighted
Occasional Contributor

How to retrieve coordinates of an image inside another one

Hi all,

 

I'm new with Test Complete, and I'm trying to undestand how to compare images within my desktop app using the RegionObj.Check method. I hope that you can help me. I'll attach an image just to better explain.

 

image.png

 

I've got this issue: the image contains itself another image, and, using for example Object Spy or the CheckPoint Image recording, I can retrieve only all the image, with all its background (the one that I've highlighted with red color) and I cannot retrieve the image that I want (the one that I've highlighted with green color).

I've got the Regions image that contains only the image highlighted with green color, so in this way I'm not able to do the image comparison.

 

I've found the Regions.CreateRegionInfo method that could be used as first parameter for the Check method to select a specific area within the image, using the ClientX-Y coordinates and Width and Height parameters; but I don't find how I can retrieve these coordinates for the image highlighted in green, so I don't understand which coordinates insert on it! (maybe if the coordinates could be relative within the red one it will be better).

 

I hope you can help me, it is rather urgent.

 

Thanks!

Simona

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Manager

Re: How to retrieve coordinates of an image inside another one

@simonaferrara Is this still an issue for you? Here, I found the article that should answer your query:

 

https://support.smartbear.com/testcomplete/docs/testing-with/checkpoints/regions/finding-image-withi...


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

9 REPLIES 9
Community Hero

Re: How to retrieve coordinates of an image inside another one

What is your app written in?

Highlighted
Community Leader

Re: How to retrieve coordinates of an image inside another one

What are the differences between the pictures?

Just a small img inside a big one?

Why not compare it all, that is, with a green background. It will also compare the little picture inside the big one

Highlighted
Occasional Contributor

Re: How to retrieve coordinates of an image inside another one

@Wamboo 

Yes, it's just a small img inside a big one.

I could compare it all, but I want also to understand if it should be possible to consider only the smaller one to compare it, for example, with a selection of only the (smaller) image that might be displayed, without considering the background.

Highlighted
Occasional Contributor

Re: How to retrieve coordinates of an image inside another one

@Marsha_R 

It should be developed in C or C++, while the TestComplete project is developed in VBScript.

Highlighted
Community Hero

Re: How to retrieve coordinates of an image inside another one

Take a look at the Advanced version of the Object Spy results for the big image.  Drill down in all the options and see if you find the little image hidden as a value in there somewhere.

Highlighted
Community Leader

Re: How to retrieve coordinates of an image inside another one

If this image is added to the application as a whole, it will be very difficult to identify the internal content of the image (i.e. outside the background).

 

If you add this yao two separate photos, you should identify it with object spy.

 

If not...

 

You can combine by trying to calculate the coordination from e.g. upper left corner and left side.

 

But these operations will be expensive so it will come to one and the same thing from the question of at least optimization

Highlighted
Community Manager

Re: How to retrieve coordinates of an image inside another one

Hi @simonaferrara ! Looks like you got some valuable suggestions from the Community! Have you tried using them? Please share your results🙂

 


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Community Manager

Re: How to retrieve coordinates of an image inside another one

@simonaferrara Is this still an issue for you? Here, I found the article that should answer your query:

 

https://support.smartbear.com/testcomplete/docs/testing-with/checkpoints/regions/finding-image-withi...


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

Highlighted
Occasional Contributor

Re: How to retrieve coordinates of an image inside another one

Thanks a lot @sonya_m  , I'll try this solution.

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors