Need more documentation for image manipulation methods
I use a lot of image comparisons and validations in my tests. And documentation is lacking some essential info. For example:
This page explains details about FindOptions method:
http://www.ranorex.com/Documentation/Ra ... ctor_4.htm
So, i need to set Imaging..Preprocessings and clipping (Rectangle) arguments. How i do that?
Clicking on Image_Preprocessings link brings me here:
http://www.ranorex.com/Documentation/Ra ... ssings.htm
where i can get some idea about that parameter, but still can't get clear understanding how to use it.
Even worse with Rectangle Clipping. It brings me to totally non-informative page, where i can't get any useful info, how to implement it:
http://www.ranorex.com/Documentation/Ra ... ipping.htm
Please, add more info.
Also, would be nice, if you add examples, how to call or use methods. Just like on MSDN:
http://msdn.microsoft.com/en-us/library ... indow.aspx
Another nice feature to copy from MSDN is "Community content" - mini-forum on every-method page, where developers can put their comments/questions/examples. I know MySQL has same feature, too.
Need more documentation for image manipulation methods
Re: Need more documentation for image manipulation methods
Oh, and please, provide me with example of calling FindOptions method with 3 arguments, mentioned above. I looked in user guide - found nothing on that matter... 
public FindOptions(
double similarity,
Imaging..Preprocessings preprocessing,
Rectangle clipping
)

public FindOptions(
double similarity,
Imaging..Preprocessings preprocessing,
Rectangle clipping
)
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: Need more documentation for image manipulation methods
Hello,
thanks for the hints regarding documentation.
For now when you need an example, you could have a look at the code that is generated by the recorder.
For .net, c# or VB specific information please consult Microsoft's documentation. You can also find a lot of examples in the internet.
A call to FindOptions could look like this:
http://www.ranorex.com/support/user-gui ... ition.html
Regards,
Roland
Ranorex Team
thanks for the hints regarding documentation.
For now when you need an example, you could have a look at the code that is generated by the recorder.
For .net, c# or VB specific information please consult Microsoft's documentation. You can also find a lot of examples in the internet.
A call to FindOptions could look like this:
new Imaging.FindOptions(0.95,Imaging.Preprocessings.Edges | Imaging.Preprocessings.Grayscale, new Rectangle(0,0,20,20));Some samples are in the user guide, like this:
http://www.ranorex.com/support/user-gui ... ition.html
Regards,
Roland
Ranorex Team
Re: Need more documentation for image manipulation methods
Hm, found strange behavior:
In the code below, i expect that element "repo.FormOIS_WinStation_11_EyeSca.Element59648Info" appears to be same as bitmap in "imageOrig", except that one or two pixels on the edges (frames). So i need to exclude edges. So:
This code FAILS:
Seems like there is a bug in API...
In the code below, i expect that element "repo.FormOIS_WinStation_11_EyeSca.Element59648Info" appears to be same as bitmap in "imageOrig", except that one or two pixels on the edges (frames). So i need to exclude edges. So:
This code FAILS:
Validate.ContainsImage ( repo.FormOIS_WinStation_11_EyeSca.Element59648Info, imageOrig, new Imaging.FindOptions(1.0,Imaging.Preprocessings.None, new Rectangle (5,5,imageOrig.Width-10,imageOrig.Height-10)), "TC204: Validation: Original image restored after UNDO operation", false);And this PASS:
Bitmap imageOrigPart=imageOrig.Clone( new Rectangle (5,5,imageOrig.Width-10,imageOrig.Height-10),imageOrig.PixelFormat); Validate.ContainsImage ( repo.FormOIS_WinStation_11_EyeSca.Element59648Info, imageOrigPart, new Imaging.FindOptions(1.0), "TC204: Validation: Original image restored after UNDO operation", false);However, i understand that should be equal!
Seems like there is a bug in API...
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: Need more documentation for image manipulation methods
No, the code snippets do different things (obviouslyslavikf wrote:However, i understand that should be equal!

By the way, you can also use the Imaging.Crop method to cut out the desired part of the imageOrig bitmap.
Regards,
Alex
Ranorex Team