简体   繁体   English

Android-从屏幕上提取像素颜色

[英]Android - extract pixel color from screen

I can't seem to find a good answer for this anywhere. 我似乎在任何地方都找不到很好的答案。

Is it possible to extract the a single pixel rgb directly from an android screen? 是否有可能直接从android屏幕中提取单个像素rgb? (Not by taking a screen dump) (不是通过屏幕转储)

I need direct access to what's on the screen. 我需要直接访问屏幕上的内容。

Any thoughts? 有什么想法吗?

Thanks. 谢谢。

If you are using custom views and canvases, you definitely can: 如果您使用的是自定义视图和画布,则绝对可以:

have a look: http://developer.android.com/reference/android/graphics/Bitmap.html#getPixel(int,int ) 看看: http : //developer.android.com/reference/android/graphics/Bitmap.html#getPixel(int,int

I don't know exactly but I can give you an approach. 我不确定,但我可以给你一个方法。 if the view's drawingCache enabled you can get bitmap from getDrawingCache and you can get pixel data from that. 如果启用了视图的drawingCache,则可以从getDrawingCache获取位图,并可以从中获取像素数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM