Comparing Bitmaps
Posted: Thu Feb 19, 2009 1:41 am
I know this has been asked before, but I was a bit unclear on the solutions.
I have an app that I need to determine whether an area of the screen is green or red. I've noticed that it is mentioned to use CaptureBitmap to get a bitmap of the window, but I am unable to use CaptureBitmap in VS 2008, I'm not sure if it's because I am missing the correct DLL or not, I do get an option to use CaptureCompressedImage, but that is not what I am looking for. My References are
Ranorex.Core
System
System.Core
System.Data
System.Data.DataSetExtensions
System.Drawing
System.Windows.Forms
System.XML
System.XML.Linq
I'd like to do something similar to the following
repo.MainWindow.SubWindow.CaptureImage (RECT,Test.bmp);
if (CompareImages(Test.bmp,Baseline.bmp))
{
Console.WriteLine("Pass");
}
else
{
Console.WriteLine("Fail");
}
I would be very grateful if you could post a code sample. If this doesn't make sense let me know and I will try to clarify more.
Thank you,
Chris Nimnicht
btw, I think this is probably the best testing tool I have ever used and am thoroughly impressed.
I have an app that I need to determine whether an area of the screen is green or red. I've noticed that it is mentioned to use CaptureBitmap to get a bitmap of the window, but I am unable to use CaptureBitmap in VS 2008, I'm not sure if it's because I am missing the correct DLL or not, I do get an option to use CaptureCompressedImage, but that is not what I am looking for. My References are
Ranorex.Core
System
System.Core
System.Data
System.Data.DataSetExtensions
System.Drawing
System.Windows.Forms
System.XML
System.XML.Linq
I'd like to do something similar to the following
repo.MainWindow.SubWindow.CaptureImage (RECT,Test.bmp);
if (CompareImages(Test.bmp,Baseline.bmp))
{
Console.WriteLine("Pass");
}
else
{
Console.WriteLine("Fail");
}
I would be very grateful if you could post a code sample. If this doesn't make sense let me know and I will try to clarify more.
Thank you,
Chris Nimnicht
btw, I think this is probably the best testing tool I have ever used and am thoroughly impressed.