从位图获取RGB值 [英] Get RGB values from a bitmap

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

问题描述





我想从位图数组的每个像素中获取RGB值(5 6 5格式)。

可以有人指导我如何做到这一点。



谢谢



[已添加]



我得到了解决方案。



谢谢大家.. !!

[/ added]

推荐答案

您是否阅读过文档[ ^ ]?



例如 BITMAPINFO struct 文档很有前途:



Did you read the documentation [^]?

for instance the following section of BITMAPINFO struct documentation looks promising:

A DIB由两个不同的部分组成:描述位图的尺寸和颜色的BITMAPINFO结构,以及a n定义位图像素的字节数组。数组中的位被打包在一起,但每个扫描行必须用零填充以在LONG数据类型边界上结束。如果位图的高度为正,则位图是自下而上的DIB,其原点是左下角。如果高度为负,则位图是自上而下的DIB,其原点是左上角。
A DIB consists of two distinct parts: a BITMAPINFO structure describing the dimensions and colors of the bitmap, and an array of bytes defining the pixels of the bitmap. The bits in the array are packed together, but each scan line must be padded with zeroes to end on a LONG data-type boundary. If the height of the bitmap is positive, the bitmap is a bottom-up DIB and its origin is the lower-left corner. If the height is negative, the bitmap is a top-down DIB and its origin is the upper left corner.



:)


:)


亲爱的,



我希望这可能是你问题的答案。



Dear,

I wish this could be the answer of your question.

System.Drawing.Bitmap b = new Bitmap(Image.FromFile("@C:\abc.jpg"));
b.GetPixel(0, 0).R ;
b.GetPixel(0, 0).G;
b.GetPixel(0, 0).B;





谢谢



Thanks


您能提供更多信息吗?当你说位图时,你可能会有很多意思。
Can you provide more information? There are many things that you could mean when you say "bitmap".


这篇关于从位图获取RGB值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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