Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About troido

  • Rank

Previous Fields

  • Languages
    HTML, CSS, javascript
  1. Yes, i meant getImageData(...).In the code I use I had this, but i made a mistake in the post.I corrected the post now. The loop will probably work (if var i starts as 3 instead of 0) but i wanted to know if there is also an solution that works a little faster.
  2. Hello,I want to make a script to check if there is anything drawn on a canvas.I tried to use this script: [/font][font=arial,helvetica,sans-serif]var ctx = document.getElementById("canvas").getContext("2d");[/font][font=arial,helvetica,sans-serif]/* Some other code, including some drawing code[/font][font=arial,helvetica,sans-serif]All drawings are black, with alpha value 255 */[/font] [font=arial,helvetica,sans-serif]var a = ctx.[color=#000000][size=1]getImageData(0,0,room.width,room.height)[/size][/color].data.indexOf(255); // to see if anything is drawn[/font][font=arial,helvetica,sans-ser
  • Create New...