Page 1 of 1

Imaging.CaptureDesktopImage: additional Parameter

Posted: Fri Dec 05, 2014 10:58 am
by IceT
Hi Forum,

I´ve a question about the Imaging-Class in the Ranorex API. Are there any possibilities to add additional parameter (like resolution or compression) to the CaptureDesktopImage-Function? I ask because the quality of the captured screenshots is very weak (i think because of resolution and compression reasons) and differ from screenshot to screenshot. here is my code

Code: Select all

Bitmap image = Imaging.CaptureDesktopImage(new Rectangle(1280, 73, 1261, 698));
image.Save(path + "\\" + browserName +"/" + filename + "_" + filenameSuffix + ".tif" ,System.Drawing.Imaging.ImageFormat.Tiff); 
        	
The object-screenshots with differences are in the attachments.
What I further recognised was that screenshot from a flash-component taken with the same code, are looking really good. We need Screenshots in relatively high quality, because we do some compare-processes after ranorex....

Thanks for any advice,
Simon

Re: Imaging.CaptureDesktopImage: additional Parameter

Posted: Wed Dec 10, 2014 10:44 am
by Support Team
Hello IceT,

Currently, it is possible to:
  • • capture a screenshot using CaptureDesktopImage() which returns a bitmap.
    • re-size the image using Imaging.Resize()
    • set the format and compression of a bitmap file using bitmap.Save()
Hope this information helps.

Regards,
Robert