Imaging.CaptureDesktopImage: additional Parameter

Class library usage, coding and language questions.
IceT
Posts: 4
Joined: Fri May 09, 2014 2:39 pm

Imaging.CaptureDesktopImage: additional Parameter

Post by IceT » Fri Dec 05, 2014 10:58 am

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
Attachments
2014-12-05_1042.png
2014-12-05_1042.png (20.22 KiB) Viewed 933 times
2014-12-05_1041.png
2014-12-05_1041.png (29.35 KiB) Viewed 933 times

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

Re: Imaging.CaptureDesktopImage: additional Parameter

Post by Support Team » Wed Dec 10, 2014 10:44 am

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
.
Image