如何从图像中提取位图代码?

编程入门 行业动态 更新时间:2024-10-27 21:24:55
本文介绍了如何从图像中提取位图代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

更多推荐

如何从图像中提取位图代码?

本文发布于:2023-10-29 22:48:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1540991.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:位图   图像   代码

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!