javascript - canvas library for drawing images -
html5 canvas provides lots of flexibility draw images using javascript. need generate javascript code based on inputs user (say 10 balls of blue color, 5 squares of green color , of size ...). there library provides appropriate javascript api(s) easier generate canvas along javascript code requirements listed above?
with fabric.js it's quite trivial draw simple shapes (circles, rectangles, etc.) on canvas. supports image importing , manipulation.
displaying rectangle, example easy as:
var canvas = new fabric.canvas('id_of_canvas_element'); var rect = new fabric.rect({ top: 100, left: 100, width: 60, height: 70, fill: 'red' }); canvas.add(rect);
take @ demos.
Comments
Post a Comment