CaptureCompressedImage returns null

Class library usage, coding and language questions.
Thor.Irgens
Posts: 6
Joined: Tue Sep 20, 2016 10:01 am

CaptureCompressedImage returns null

Post by Thor.Irgens » Tue Sep 20, 2016 10:13 am

Hi,

I have a problem with CaptureCompressedImage(), it returns null on an adapter that has width, height and an anchor (X,Y).

Does anyone have a similar experience and hopefully solution?

I have previously experienced that objects are sent to Garbage Collector, but that would set the height, width, X and Y values to 0. Now those values are not set to 0 but the capture still fails. The bit that should be captured is clearly visible on the screen.

I am running on Virtual Machine (Windows 8.1) using Ranorex 6.0.1.

Here is a code snippet of the code I use

Rx.CompressedImage cpi = Adapter.CaptureCompressedImage();
if (cpi == null)
{
Log.WriteLine("cpi resulted in null. Adapter info is {0},{1},{2},{3}.", Adapter.ScreenRectangle.Width, Adapter.ScreenRectangle.Height, Adapter.ScreenRectangle.X, Adapter.ScreenRectangle.Y);
return false;
}

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: CaptureCompressedImage returns null

Post by Support Team » Fri Sep 23, 2016 9:20 am

Hi Thor.Irgens,

Unfortunately I'd need additional information about the object itself. Therefore, it would be great if you could upload a Ranorex Snapshot.

PS: If you don't want to upload the snapshot to this public forum, you can send it to [email protected] for further analysis.

Thank you in advance.

Regards,
Markus (S)
.
Image