如何快速从屏幕获取RGB? [英] How to fast get RGB from screen ?

查看:156
本文介绍了如何快速从屏幕获取RGB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想从屏幕上获得最受欢迎的RGB和平均值RGB.现在,我使用这种方法来获取屏幕:

Hello, I want to get most popular RGB and mean value RGB from screen. Now i using this methods to get the screen :

Bitmap printscreen = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
Graphics graphics = Graphics.FromImage(printscreen as Image);
graphics.CopyFromScreen(0, 0, 0, 0, printscreen.Size);




但这还不够快.我想每50-100毫秒获取一次此参数.有任何想法吗?

感谢您的帮助:)




but this is not enough fast. I would like to get this parameters every 50-100ms. Any Idea ?

Thanks for any help :)

推荐答案

我怀疑C#中有没有更快的方法,您也许可以使用C ++或互操作来更快地完成某些工作.归根结底,我能看到的唯一更快的方法是,您可以直接访问用于屏幕的内存,还是直接复制它而无需沿途创建Image对象.
I doubt there''s any faster way in C#, you may be able to do something faster using C++ or interop. At the end of the day, the only faster way I can see is if you can access the memory used for the screen directly, or just copy it directly without creating an Image object along the way.


这篇关于如何快速从屏幕获取RGB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆