如何获取窗口客户区每个像素的 RGB 值数组
有没有办法使用 gdi 接收窗口客户区中每个像素的颜色值?
Is there a way to receive the colour values for each pixel in the client area of a window, with gdi?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如@JerryCoffin 的评论中所指出的。下面是一个简单的示例
您应该在内存 DC 中选择一个位图对象,您可以使用 GetPixel GDI 函数,然后您还可以使用
GetRValue()
、GetGValue()
提取颜色值和GetBValue()
宏。As noted in comment by @JerryCoffin. Here's a simple example
You should have a bitmap object selected into memory DC for which you can use GetPixel GDI function and then you can also extract the color values using
GetRValue()
,GetGValue()
, andGetBValue()
macros.