【问题标题】:Compare two images比较两张图片
【发布时间】:2011-05-29 08:29:26
【问题描述】:

我有一个图像网格,我点击一个,我在那个网格“二维图像数组”上搜索这个图像 然后我想检查这张图片是否是我需要的, 网格中的图像是:

BitmapImage img = new BitmapImage(new Uri("/Mines1.2;component/Images/new.png", UriKind.Relative));

Image temp = new Image();
temp.Height = 50;
temp.Width = 40;
temp.Source = img;
temp.Name = i.ToString() + j.ToString();
temp.MouseLeftButtonDown += new MouseButtonEventHandler(this.explore);

explore是我点击图片时想要去的功能。

我现在想将图像 temp 与另一个比较,我用它的资源 uri 来做这个

if(temp.source.equals(new BitmapImage(new Uri("/Mines1.2;component/Images/new.png", UriKind.Relative))))

但这不起作用! 我想检查两个图像是否相同或不使用 uri 或源或任何东西,但我当然不会检查每个像素。

【问题讨论】:

    标签: c# .net windows-phone-7 mobile windows-mobile


    【解决方案1】:

    您可以创建文件的哈希值,然后比较两个哈希值是否相同。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-28
      • 1970-01-01
      • 1970-01-01
      • 2019-07-17
      • 2014-09-08
      相关资源
      最近更新 更多