Get the color a pixel on the screen in objective-c cocoa app

后端 未结 2 1453
情话喂你
情话喂你 2020-12-08 08:47

I am trying to create a color picker cocoa app in objective-c so I can get the color of any pixel on my screen. Is there a way to get the color a certain screen pixel in obj

2条回答
  •  隐瞒了意图╮
    2020-12-08 09:37

    Try NSReadPixel. You'll need to get the current mouse location and convert it to the appropriate coordinate reference frame. Once you have the color, you might need to convert it to a different color space, depending on your needs.

提交回复
热议问题