弱弱的问一下,Winform中怎么取到窗体中某一像素点的颜色代码
winform吧
全部回复
仅看楼主
level 1
如题如题。。
2017年03月06日 07点03分 1
level 1
程序调用photoshop,并找到钢笔,鼠标自动聚焦像素点右键复制颜色代码。妥妥的。[酷][酷][酷][呼~][呼~][呼~]
2017年03月08日 10点03分 2
level 1
private Color GetScrPixel(Point pt)
{
Rectangle scrBound = Screen.PrimaryScreen.Bounds;
using (Bitmap bmp = new Bitmap(scrBound.Width, scrBound.Height))
{
using (Graphics g = Graphics.FromImage(bmp))
{
g.CopyFromScreen(scrBound.Location, scrBound.Location, scrBound.Size);
}
return bmp.GetPixel(pt.X, pt.Y);
}
}
2017年03月12日 07点03分 3
1