WPF 怎么获取 鼠标坐标的颜色RGB
c# WPF 怎么获取 鼠标坐标的颜色RGB
找了半年了都找不到 请高手帮忙 写下代码
------解决方案--------------------用不着P/Invoke...GDI+的CopyScreen就可以了.
------解决方案--------------------GetPixcelColor要求传入的参数是屏幕坐标,要转换下:
private void Container_MouseMove(object sender, MouseEventArgs e)
{
var pos = e.GetPosition(null);
pos = this.PointToScreen(pos);
rectangle1.Fill = GetPixelColor(pos);
}