如何获取网页上任何指定像素的颜色? [英] How can I get the color of any specified pixel on a web page?

查看:104
本文介绍了如何获取网页上任何指定像素的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的最初搜索表明,出于安全原因,我可能无法执行此操作,但是无论如何我都会询问.如何获得网页上任何个指定像素的颜色?
更具体地说,这是我自己的网页,其中包含背景色,图像,css-modified-elements.我需要知道完全渲染的网页上特定像素的颜色.该信息不能来自屏幕抓取,因为我想修改我完全渲染的页面.

My initial searching indicates that for security reasons I might not be able to do this, but I'll ask anyway. How can I get the color of any specified pixel on a web page?
To be more specific, this is my own web page which contains background-color, images, css-modified-elements. I need to know the color of a specific pixel on the fully rendered web page. The info can't be from a screen-grab, because I want to modify my fully rendered page.

哎呀! 有人真的问我真正的问题吗? 艰难的人群!

Ouch !!! Did someone really "minus 1" me for asking genuine question? Tough crowd!

更具体地说: 我想在网页上添加一个用户可移动的canvas元素,以可视方式更改画布悬停在其上的网页部分.将canvas元素视为一个放大镜,用户可以在网页上移动它.但是我希望canvas元素产生的实际效果是滤色器(因此需要基础颜色).

To be more specific: I want to add a user-moveable canvas element to the web page that visually alters the part of the web page that the canvas is hovering over. Think of the canvas element as a magnifying glass that the user can move across the web page. But the actual effect I want the canvas element to produce is a color-filter (hence the need for the underlying colors).

推荐答案

使用脚本和技巧无法完成.也许通过插件

Can't be done w/ script+tricks. Maybe via a plugin

如果您可以设置服务器端浏览器来为您呈现页面,则可能会起作用.

If you can set up a server-side browser to render pages for you - that might work.

这篇关于如何获取网页上任何指定像素的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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