Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > in Firefox 2 Beta 1

Thread Tools in Firefox 2 Beta 1
Posts: n/a
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

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?



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


<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[i*4+0]=127;//r[i*4+1]=128;//g //kind of grey.[i*4+2]=129;//b[i*4+3]=130;//a


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


Reply With Quote

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 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