如何从摄像头图片访问像素颜色? [英] how can i access pixel color from webcam picture?

查看:105
本文介绍了如何从摄像头图片访问像素颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从网络摄像头图片中访问细微像素的颜色,并在网络摄像头图片中使用该像素拖曳轴.

I want to access a perticuler pixel color from webcam pictur .and also drow axis using this pixel in webcam picture .

推荐答案

你好朋友,

您想将图像存储在位图中.然后可以使用bitmap.GetPixel(x,y)来获取每个像素的颜色.

位图是从图像派生的,因此可以将图片框图像设置为位图.

编辑添加:
有一个带图像参数的Bitmap构造函数:
位图bm =新位图(pb.Image);

您如何从网络摄像头获取数据?获取数据后是否可以将其直接存储到位图对象中?那可能是一个更好的解决方案. :)
hello friend,

You want to store your image in a Bitmap. Then you can use bitmap.GetPixel(x,y) to get the color of each pixel.

Bitmap is derived form Image, so you can set the picturebox image to be the bitmap.

Edit to add:
There is a Bitmap constructor that takes an image parameter:
Bitmap bm = new Bitmap(pb.Image);

How do you get the data from the Webcam? Is it possible to store it directly into a bitmap object when you get the data? That would probably be a better solution. :)


这篇关于如何从摄像头图片访问像素颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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