Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > canvas.imagedata.data in Firefox 2 Beta 1

Reply
Thread Tools

canvas.imagedata.data in Firefox 2 Beta 1

 
 
mrc.gran@gmail.com
Guest
Posts: n/a
 
      08-08-2006
Hello,
below is some javascript code using getIimageData() and putImageData()
that doesn't seem to do what it is supposed to do (to draw a thick
horizontal line inside a <canvas> element) in Firefox2 (Mozilla/5.0
(X11; U; Linux i686; en-US; rv:1.8.1b1) Gecko/20060710 Firefox/2.0b1).
I'm using the specs at http://whatwg.org/specs/web-apps/current-work/
..

The result is just a blank box. No error is displayed. I tried several
variations without success.

Am I missing something or putImageData() is still just a stub?
Thanks,
Mg.

--

<html>
<body>

<canvas id="canvas" width="200" height="100" style="border:solid">
</canvas>

</body>

<script language="JavaScript">
var mycanvas = document.getElementById('canvas').getContext("2d") ;

var imagedata = mycanvas.getImageData(0,0,200,100); // read from canvas

for(i=2000;i<2000+1000;i++) { //modifies 5 lines starting at the 10th
line
imagedata.data[i*4+0]=127;//r
imagedata.data[i*4+1]=128;//g //kind of grey.
imagedata.data[i*4+2]=129;//b
imagedata.data[i*4+3]=130;//a

}

mycanvas.putImageData(imagedata,0,0); //write back to canvas

</script>
</html>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox 1.0.7 or Firefox 1.5 Beta New releases are out Wild Will Computer Support 0 09-29-2005 07:00 AM
Request.Browser.MajorVersion.ToString() returns null on ASP.NET 2.0 Beta 1 and Beta 2 ocn0248@hotmail.com ASP .Net 1 05-02-2005 11:46 PM
Yahoo! Toolbar Beta for Firefox - Not Compatible with Firefox 1.0.2? NA Firefox 6 04-02-2005 06:13 PM
install Beta 2 after Beta 1? Mark Oliver ASP .Net 3 01-25-2005 01:39 PM
Beta 70-298 Beta Exam Romila MCSE 1 09-07-2003 11:38 PM



Advertisments