Drawling lines in JavaScript

Written by on December 11th, 2006 in Ajax News.

If you have ever wondered how to use the Bresenham algorithm to draw lines in browsers, it is your lucky day.

The article teaches us the way, and you end up with an API such as:

JAVASCRIPT:

  1.  
  2. var g = new Graphics();
  3. g.drawLine(100,50,200,70);
  4. g.paint();
  5.  

Source: Ajaxian
Original Article: http://ajaxian.com/archives/drawling-lines-in-javascript

Leave a Reply

You must be logged in to post a comment.



Site Navigation