如何获取Form上某一点像素的颜色(RGB)?

zyca 2007-09-05 01:14:15
rt.
...全文
154 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
scottckt 2007-09-05
  • 打赏
  • 举报
回复
up
北京的雾霾天 2007-09-05
  • 打赏
  • 举报
回复
Bitmap bmp = new Bitmap(this.Width, this.Height);
this.DrawToBitmap(bmp, Rectangle.FromLTRB(0,0,this.Width, this.Height));
Color col = bmp.GetPixel(10, 10);
Console.WriteLine(col);
daizhenbest 2007-09-05
  • 打赏
  • 举报
回复
from http://www.80diy.com/home/20051127/05/4420725.html

SendKeys.SendWait("%{PRTSC}");
//Get the current form and store it to Bitmap.
Bitmap image = (Bitmap)Clipboard.GetDataObject().GetData(DataFormats.Bitmap);
//Get the color.
Color color = image.GetPixel(X, Y);
zhchg6666 2007-09-05
  • 打赏
  • 举报
回复
up

110,532

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧