比较两个图像
我有一个图像网格,我单击一个,我在该网格“图像的二维数组”上搜索该图像 然后我想检查这张图片是否是我需要的, 网格中的图像是:
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 或源或其他任何内容,但当然我不会检查每个像素。
I have a grid of Images, I click one, I search for this image on that grid "2D array of Images"
then I want to check if this image is the one I need,
the images in the grid are:
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 is the function I want to go when click on the image.
I want to compare now the image temp with another one, I do this with it's resource uri
if(temp.source.equals(new BitmapImage(new Uri("/Mines1.2;component/Images/new.png", UriKind.Relative))))
but this does not work!
I want to check if two images are the same or not using the uri or source or anything but of course I'm not going to check each pixel.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以创建文件的哈希值,然后比较两个哈希值是否相同。
you could create a hash of the file and then compare whether the two hashes are the same.