static bool CompareImages(string expected, string actual, string diff)
{
var startInfo = new ProcessStartInfo
{
CreateNoWindow = true,
UseShellExecute = false,
FileName = "pdiff.exe",
WindowStyle = ProcessWindowStyle.Hidden,
RedirectStandardOutput = true,
Arguments = string.Format(
"\"{0}\" \"{1}\" -output \"{2}\" -verbose", expected,
actual, diff)
};
using (var exeProcess = Process.Start(startInfo))
{
exeProcess.WaitForExit();
var output = exeProcess.StandardOutput.ReadToEnd();
return output.Contains("PASS");
}
}