CaptureImage vs CaptureCompressedImage

Class library usage, coding and language questions.
User avatar
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark

CaptureImage vs CaptureCompressedImage

Post by artur_gadomski » Mon Sep 10, 2012 8:27 am

Is there a difference in CaptureImage and CaptureCompressedImage? I have tried following code:
Bitmap img = Imaging.CaptureImage(Host.Local);

Bitmap img2 = Imaging.CaptureCompressedImage(Host.Local);
Bitmap b = Host.Local.CaptureCompressedImage();
And all files have the same size. Am I using the methods wrong or is there a bug in Ranorex?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12169
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA

Re: CaptureImage vs CaptureCompressedImage

Post by Support Team » Tue Sep 11, 2012 10:06 am


Yes there is a difference. Although the difference in size appears only during runtime.
To get a compressed image during runtime you have to use a CompressedImage object instead of an Bitmap object. After saving or storing the image or compressed image,respectively, they have the same size (provided that you do not specify another ImageFormat than PNG as second argument to the Bitmap.Save method).

Kind Regards,
Ranorex Support Team