如何按每个像素显示颜色值? [英] How can I display color values by each pixel?

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

问题描述

大家好,

当我在C#windows窗体应用程序上双击或鼠标移动时,我想显示每个像素的颜色值。请帮助我任何建议和代码。



问候,

A.Myint Myat

解决方案

这是一种罕见的情况,当你真的可以使用 System.Drawing.Bitmap.GetPixel

http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.getpixel .aspx [ ^ ]。



请注意,对于任何或多或少的大量读取或写入像素操作 GetPixel / SetPixel 不能使用,因为它们非常慢。你需要使用 System.Drawing.Bitmap.LockBits



-SA

Hi all,
I would like to present the color values by each pixel when I double clicked or mouse moved on my C# windows form application. Help me please any suggestion and codes.

With regards,
A.Myint Myat

解决方案

This is the rare case when you can really use System.Drawing.Bitmap.GetPixel:
http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.getpixel.aspx[^].

Note that for any more or less massive read or write pixel operations GetPixel/SetPixel cannot be used, as they are prohibitively slow. You would need to use System.Drawing.Bitmap.LockBits instead.

—SA


这篇关于如何按每个像素显示颜色值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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