Can I check for pixel's color in some area for validation
Can I check for pixel's color in some area for validation
I'm trying to do validation and check for some color ( red). If there is red pixel into that screenshot to fail the validation. Is there any chance to do that in Ranorex ?
Re: Can I check for pixel's color in some area for validation
Hi MGeorgiev,
Ranorex is based on the .Net framework, that means you can simply use C# methods in UserCodeModules.
Here is a little sample how this could work.
asdf
Ranorex is based on the .Net framework, that means you can simply use C# methods in UserCodeModules.
Here is a little sample how this could work.
Bitmap img = new Bitmap("YourScreenshot.bmp"); for(int j = 0; j < img.Height; j++) { for(int i = 0; i < img.Width; i++) { var color = img.GetPixel(i,j).Name; if(color == "ffff0000") Report.Failure("Fail"); else Report.Success("Success"); } }Regards,
asdf