Javascript getImageData for html5 canvas

I tore my hair! I got this work, I thought: “I can afford not to save a version of this,” and then I broke the “assembly”.

The line myImageData = context.getImageData(0, 0, canvas.width, canvas.height);seems to violate this, as the warning will work earlier, but not after it.

Downloading the image itself.

Any suggestions are welcome ^ _ ^ I am at the end of the cable and am going to get RSI from myself.

var myImageData;

var image_var = new Image();
image_var.onload  = function () {
    canvas.width  = image_var.width;
    canvas.height = image_var.height;
    context.drawImage(image_var, 0, 0, image_var.width, image_var.height);
    myImageData   = context.getImageData(0, 0, canvas.width, canvas.height);
    alert('');
}
image_var.src = "example1.jpeg";
+5
source share
2 answers

Add below code code to your actual code, firefoxallows you to work locally

netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");

what is he really doing?

script , , . , , . Communicator 4.x, Mozilla Java, , . . , , .

. , . script , .

alt text

+6

- , ( ), (, ip ), -, W3C + , getImageData() , , javascript.

, , , , . ( appCache websql HTML5 , ). , - , ( ). !

0

All Articles