Пример #1
0
        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);
        }
Пример #2
0
 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;
 }
Пример #3
0
        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);
        }
Пример #4
0
        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;
        }