Click here to Skip to main content
13,249,504 members (35,720 online)
Click here to Skip to main content
Add your own
alternative version


5 bookmarked
Posted 31 Mar 2014

jqEziDraw: Vector Drawing Application

, 31 Mar 2014
Rate this:
Please Sign up or sign in to vote.
jqEziDraw is a drawing control


jqEziDraw is a jQuery drawing control with these features:

  • 5 predefined shapes (line, rectangle, rounded corner rectangle, ellipse)
  • You can defined new shapes.
  • Selecting Shapes by click in drawing board or by using shapes history.
  • Shapes History with the ability to reorder, move, resize and delete them.
  • Hide/Show shapes.
  • Very basic shape style support (Line colour, Fill colour, Line Size).
  • Multiple draw board in a page.


I wanted to learn how to deal with canvas in JavaScript for a long time and I decided to build a tiny control to get familiar with canvas. jqEziDraw is not a complete and wellformed code and I want to complete it before published it.

I also haven’t made much progress in the last few months because I haven’t had as much time for it, so I decide to published it (as is).

Using the Code


You need to include 4 files to your page:

  1. jQuery
  2. jqEziDraw.js
  3. jqEziDrawShapes.js
  4. jqEziDraw.css
<link rel="stylesheet" type="text/css" href="jqEziDraw.css" />
<script type="text/javascript" src="../common/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="jqEziDraw.js"></script>
<script type="text/javascript" src="jqEziDrawShapes.js"></script>

Full Featured Sample

To create draw board with Toolbox, Shapes history and Shape style, you need to call the eziDraw plugin with these parameters:


You need one <canvas> element and 3 <div> elements like these:

<div class='ToolsBox' id='tools'></div>
<canvas class='CanvasBox' id="myCanvas" width="600" height="600"></canvas>
<div style='display:inline-block;width:210px;vertical-align:top;'>
    <div class='HistoryBox' style='border:1px solid #000;'>
        <div style='color:#FFFFFF;text-align:center'>Shapes</div>
        <div id='history' style='height:350px;vertical-align:top;overflow-y:scroll;overflow-x:none;'></div>
    <div class='StyleBox' style='border:1px solid #000;' >
        <div style='color:#FFFFFF;text-align:center'>Shape Style</div>
        <div id='ShapeStyle' style='height:70px;vertical-align:top;overflow-y:none;overflow-x:none;'></div>

All 3 options (shapeStyle, tools and history) are optional.

Create New Shape

All shapes are defined in jqEziDrawShape.js and you can easily create a new shape.

Shapes defined in JSON format:

    icon:'<img alt="" src="icon.png" />',
        //draw method defined how shape must rendered
        //for example the below code render a simple line

What's Next?

  • Add comments to code
  • Each shape accepts customised properties
  • Edit shape style (properties)
  • Save/Load settings and drawings in Local Storage
  • Export to image
  • Rotate shapes


  • 2014/03/31 First release (version 0.1)


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Pooya Paridel
Team Leader
Canada Canada
No Biography provided

You may also be interested in...


Comments and Discussions

QuestionMy vote of 4 Pin
Giannakakis Kostas31-Mar-14 4:00
memberGiannakakis Kostas31-Mar-14 4:00 
AnswerRe: My vote of 4 Pin
Pooya Paridel31-Mar-14 8:36
memberPooya Paridel31-Mar-14 8:36 
QuestionSVG format? Pin
thatraja31-Mar-14 3:16
protectorthatraja31-Mar-14 3:16 
AnswerRe: SVG format? Pin
Pooya Paridel31-Mar-14 8:34
memberPooya Paridel31-Mar-14 8:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171114.1 | Last Updated 31 Mar 2014
Article Copyright 2014 by Pooya Paridel
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid