Created
August 26, 2014 04:07
-
-
Save Arnoldnuo/d890516e489dd71a3897 to your computer and use it in GitHub Desktop.
通过canvas获取图片的像素数据,可以用浏览器做一个markman功能的插件
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var canvas = document.createElement('canvas'); | |
var ctx = canvas.getContext('2d'); | |
var img = new Image(); | |
img.src=""; | |
ctx.drawImage(img, 0 ,0); | |
var imageData = ctx.getImageData(0,0,canvas.width,canvas.height); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment