Image validation / no repository

Ask general questions here.
SanMan
Posts: 210
Joined: Tue Apr 13, 2010 9:59 am

Image validation / no repository

Post by SanMan » Thu Feb 24, 2011 2:17 pm

:oops:
I am trying to validate two Bitmap images
1. first one saved in c:\...
2. is captured during test run

:oops: As the images are not in the repository, I canot get RepoItemInfo?? :oops:

first I do
1: System.Drawing.Bitmap img1 = Imaging.Load("C:\...my_image.bmp");

2: Bitmap img2 = Ranorex.ToolTip.Current.CaptureCompressedImage();

Should I validate these images with
Validate.Contains(???) ?
Validate.CompareImage(???) ?

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

Re: Image validation / no repository

Post by Support Team » Thu Feb 24, 2011 6:25 pm

Hi,

You can use following Validate method
Validate.CompareImage(img1, img2, new Imaging.FindOptions("yourSettings"));
For your specific FindOptions take a look to following link:
http://www.ranorex.com/Documentation/Ra ... ptions.htm

Regards,
Peter
Ranorex Team

SanMan
Posts: 210
Joined: Tue Apr 13, 2010 9:59 am

Re: Image validation / no repository

Post by SanMan » Fri Feb 25, 2011 7:18 am

When trying to build ->

Argument '1': cannot convert from 'System.Drawing.Bitmap' to 'Ranorex.Core.Repository.RepoItemInfo' (CS1503) -

:oops:

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

Re: Image validation / no repository

Post by Support Team » Fri Feb 25, 2011 11:08 am

Hi,

Sorry this was my fault. :)
Please use following method to compare two images
Imaging.Compare(Bitmap, Bitmap, Similarity);
http://www.ranorex.com/Documentation/Ra ... pare_3.htm

Regards,
Peter
Ranorex Team

SanMan
Posts: 210
Joined: Tue Apr 13, 2010 9:59 am

Re: Image validation / no repository

Post by SanMan » Fri Feb 25, 2011 12:29 pm

Thank you !!!

Works great!