比较两个图像

时间:2011-05-29 08:29:26

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

我有一个图像网格,我点击一个,我在该网格上搜索这个图像“2D图像阵列” 然后我想检查这个图像是否是我需要的图像, 网格中的图像是:

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);

探索是我在点击图片时想要去的功能。

我想现在将图像温度与另一个进行比较,我用它的资源uri

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

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

1 个答案:

答案 0 :(得分:3)

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

相关问题