method to check element is not covered by others : Automation API

method to check element is not covered by others

Class library usage, coding and language questions.

method to check element is not covered by others

Postby hobli » Thu Apr 29, 2010 5:20 am

Hi,

sorry if my question is a little stupid, but this is what I need:
I want to capture screen-shot for an element without force it to "foreground" by using 'ensurevisible()'.
So I need to check if the element is really visible --- not covered by (or overlapping with) any other elements.
Before I write a function to scan through all elements on the screen and examine their location and size, I would like to see if there are any simple to use.

The "visible" property of an element does not guarantee it is not covered by/overlapped with other elements.

thanks
hobli
 
Posts: 57
Joined: Thu Jul 30, 2009 2:15 am

Re: method to check element is not covered by others

Postby Support Team » Thu Apr 29, 2010 1:39 pm

Hi!

Ranorex has a method called CaptureImageHidden(). This method provides you the functionality to catch a screenshot of an element, when it's for example in the background of another application (but not minimized). Please take attention to work with this method, because not all technologies support this feature.
Bitmap bmp = Imaging.CaptureImageHidden("yourPath");
bmp.Save("myBmp.bmp");

Regards,
Peter
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: method to check element is not covered by others

Postby hobli » Thu May 06, 2010 3:17 am

Thanks for your reply. But my intention is to capture the screen the same as human seeing on the screen.
In a case where the element is 'covered' by other elements, then the image captured should truly reflect this fact. Calling function "CaptureImageHidden()" is not doing this.

I have an solution now:
dim bmpImg as BitMap

bmpImg = imaging.CaptureDesktopImage(anelement.ScreenRectangle)
bmpImg.Save("imgfile.bmp", system.Drawing.Imaging.ImageFormat.Bmp)
hobli
 
Posts: 57
Joined: Thu Jul 30, 2009 2:15 am


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests