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
method to check element is not covered by others
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: method to check element is not covered by others
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.
Peter
Ranorex Support Team
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
Re: method to check element is not covered by others
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)
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)