public static DiffResult Diff(Bitmap left, Bitmap right, DiffOptions options) { DiffResult result = new DiffResult(); NativeDiffResult nr = DiffARGB(left.nativeImage, right.nativeImage, NativeDiffOptions.FromManaged(options)); result.Similarity = nr.Similarity; result.Image = new Bitmap(nr.Image.Width, nr.Image.Height, nr.Image.Data); return(result); }
public static NativeDiffOptions FromManaged(DiffOptions options) { NativeDiffOptions result = new NativeDiffOptions(); result.ErrorColor = NativeColor.FromManaged(options.ErrorColor); result.Tolerance = options.Tolerance; result.OverlayTransparency = options.OverlayTransparency; result.OverlayType = options.OverlayType; result.WeightByDiffPercentage = (byte)(options.WeightByDiffPercentage ? 1 : 0); result.IgnoreColor = (byte)(options.IgnoreColor ? 1 : 0); return result; }
public static NativeDiffOptions FromManaged(DiffOptions options) { NativeDiffOptions result = new NativeDiffOptions(); result.ErrorColor = NativeColor.FromManaged(options.ErrorColor); result.Tolerance = options.Tolerance; result.OverlayTransparency = options.OverlayTransparency; result.OverlayType = options.OverlayType; result.WeightByDiffPercentage = (byte)(options.WeightByDiffPercentage ? 1 : 0); result.IgnoreColor = (byte)(options.IgnoreColor ? 1 : 0); return(result); }
private static extern NativeDiffResult DiffARGB(NativeImage left, NativeImage right, NativeDiffOptions options);
private static extern NativeDiffResult DiffARGB(NativeImage left, NativeImage right, NativeDiffOptions options);