如何从图像中提取位图代码? [英] How can i extract the bitmap code from image?

查看:82
本文介绍了如何从图像中提取位图代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想比较两个图像以找到相同的图像。

I want to compare two images to find that is same image or not.

在window7(C#)中,我可以使用getpixel()方法并提取位图颜色,这很容易比较图像。

In window7(C#), I can use the getpixel() method and extract bitmap color, that's very easy to compare images.

但在window8(c#),   WriteableBitmap aa = new WriteableBitmap(a.PixelWidth,a.PixelHeight);   Stream stream = aa.PixelBuffer.AsStream();

but in window8(c#),   WriteableBitmap aa = new WriteableBitmap(a.PixelWidth, a.PixelHeight);  Stream stream = aa.PixelBuffer.AsStream();

如果我使用这些代码,我可以知道图像大小,但我不知道如何找到颜色代码。 .so我无法比较不同的图像...

If i use those code, i can know the image size but i don't know how can i find the color code..so i can't compare the different images...

我该怎么办?

推荐答案

PixelBuffer包含BRGA顺序中每个像素的颜色。您可以比较每个位图的流,看它们是否相同。

The PixelBuffer contains the colors for each pixel in BRGA order. You can compare the streams for each bitmap to see if they are the same.

- Rob


这篇关于如何从图像中提取位图代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆