Color c = new Color();//创建颜色对象
            Bitmap bitmap = new Bitmap(this.BackgroundImage);//创建BITMAP对象
            int x = Cursor.Position.X;//鼠标x坐标
            int y = Cursor.Position.Y;//鼠标y坐标
            c = bitmap.GetPixel(x, y);//鼠标位置的颜色
            this.Text = string.Format("R={0},G={1},B={2}", c.R, c.G, c.B);//显示
            bitmap.Dispose();//释放

 

相关文章:

  • 2021-12-23
  • 2021-06-18
  • 2022-12-23
  • 2021-12-07
  • 2021-11-29
猜你喜欢
  • 2022-12-23
  • 2022-03-01
  • 2022-01-05
  • 2021-05-30
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案