<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!DOCTYPE html><html lang='en' class=''>
<head><script src='//production-assets.codepen.io/assets/editor/live/console_runner-079c09a0e3b9ff743e39ee2d5637b9216b3545af0de366d4b9aad9dc87e26bfd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/events_runner-73716630c22bbc8cff4bd0f07b135f00a0bdc5d14629260c3ec49e5606f98fdd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/css_live_reload_init-2c0dc5167d60a5af3ee189d570b1835129687ea2a61bee3513dee3a50c115a77.js'></script><meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="shortcut icon" type="image/x-icon" href="//production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" /><link rel="mask-icon" type="" href="//production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" /><link rel="canonical" href="https://codepen.io/WangWeiqiang/pen/Cadyu?depth=everything&order=popularity&page=9&q=tools&show_forks=false" />
<style class="cp-pen-styles"> body {
margin: 0px;
padding: 0px;
background-image:url("http://wangweiqiang.net/demo/MagicNote/images/background.jpg");
}
a{
text-decoration:none;
}
#myCanvas{
border:solid 1px #ccc;
margin-right:auto;
margin-left:auto;
display:block;
margin-top:10px;
box-shadow:#555 0px 0px 18px;
background-color:#fff;
}
#myCanvas:active{
/*cursor: url(images/pencil-cursor.png) -80 -40;*/
}
#bottombar{
text-align:center;
font-size:2em
}
.toolbar{
position:fixed;
background-color:#fff;
width:42px;
left:0px;
box-shadow: #999 1px 1px 11px;
border-bottom-right-radius:5px;
}
#handler{
position:absolute;
top:0;
left:42px;
background-color:#fff;
padding: 5px;
border-top-right-radius: 3px;
border-bottom-right-radius: 16px;
box-shadow: #999 3px 1px 5px;
}
#handler .handler-item{
display:block;
width:10px;
height:10px;
border-radius:5px;
background-color:#999;
margin:5px 2px;
}
#handler .colorshow{
background-color:#000;
}
.show{
left:0;
}
.toolbar ul{
margin:5px;
padding:0;
}
.spliter{
height:1px;
background-color:#ddd;
margin: 5px 5px 10px 5px;
}
.toolbar ul:last{
border-bottom:none;
}
.toolbar ul li{
list-style:none;
height:42px;
}
.toolbar ul li img{
opacity:0.5
}
.toolbar ul li img:hover{
opacity:1;
}
#backgroundlist li img{
opacity:1;
}
#selectedcolor{
display:block;
width:32px;
height:32px;
border-radius:32px;
}
#colorpicker{
height:78px;
}
#colorlist{
position: relative;
margin: 0;
padding: 0;
width: 404px;
top: -38px;
left: 37px;
background-color: #fff;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
padding-left: 15px;
box-shadow: #999 5px 1px 8px
}
#colorlist li{
display: inline-block;
width: 32px;
height: 32px;
border-radius: 32px;
margin: 5px 0 0 0;
}
#backgroundlist{
position: relative;
margin: 0;
padding: 0;
width: 500px;
top: -38px;
left: 37px;
background-color: #fff;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
padding-left: 15px;
box-shadow: #999 5px 1px 8px
}
#backgroundlist li{
display: inline-block;
width: 120px;
height: 120px;
margin: 5px 0 0 0;
}
#tools{
position: relative;
margin: 0;
padding: 0;
width: 150px;
top: -38px;
left: 37px;
background-color: #fff;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
padding-left: 15px;
box-shadow: #999 5px 1px 8px
}
#tools li{
display: inline-block;
width: 32px;
height: 32px;
margin: 5px 0 0 0;
}
#opendialog{
position: relative;
margin: 0;
padding: 0;
width: 530px;
top: -38px;
left: 37px;
background-color: #fff;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
padding-left: 15px;
box-shadow: #999 5px 1px 8px;
overflow:hidden;
height:156px;
}
#opendialog li{
display: inline-block;
width: 120px;
height: 149px;
margin: 5px;
text-align: center
}</style></head><body>
<script src="https://wangweiqiang.net/demo/MagicNote/js/background.js"></script>
<script src="https://wangweiqiang.net/demo/MagicNote/js/canvas2image.js"></script>
<script src="https://wangweiqiang.net/demo/MagicNote/js/base64.js"></script>
<script src="https://wangweiqiang.net/demo/MagicNote/js/canvastoblob.js"></script>
<script src="https://wangweiqiang.net/demo/MagicNote/js/canvastoblob.js"></script>
<div class="toolbar">
<a id="handler" href="javascript:;" onclick="switchToolBar()">
<span class="handler-item"></span>
<span class="handler-item colorshow"></span>
<span class="handler-item"></span>
</a>
<ul>
<li><a href="javascript:;" onclick="myCanvas.Brush.Change('pencil')" title="Pencil"><img src="http://wangweiqiang.net/demo/MagicNote/images/pencil.png" alt="Pencil"></a></li>
<li><a href="javascript:;" onclick="myCanvas.Brush.Change('quill')" title="Quill"><img src="http://wangweiqiang.net/demo/MagicNote/images/quill.png" alt="Quill"></a></li>
<li><a href="javascript:;" onclick="myCanvas.Brush.Change('highlightmarker')" title="Highlight Marker"><img src="http://wangweiqiang.net/demo/MagicNote/images/highlightmarker.png" alt="Highlight Marker"></a></li>
<li><a href="javascript:;" onclick="myCanvas.Brush.Change('ereaser')" title="Eraser"><img src="http://wangweiqiang.net/demo/MagicNote/images/eraser.png" alt="Eraser"></a></li>
<li>
<a href="javascript:;" onclick="showTools()" title="More Tools"><img src="http://wangweiqiang.net/demo/MagicNote/images/tools.png"></a>
<ul id="tools" style="display:none">
<li><a href="javascript:;" onclick="myCanvas.Brush.Change('line')" title="Line"><img src="http://wangweiqiang.net/demo/MagicNote/images/line.png"></a></li>
<li><img src="http://wangweiqiang.net/demo/MagicNote/images/square.png"></li>
<li><img src="http://wangweiqiang.net/demo/MagicNote/images/circle.png"></li>
<li><a href="javascript:;" onclick="myCanvas.Brush.Change('coordinate')" title="Insert Coordinate"><img src="http://wangweiqiang.net/demo/MagicNote/images/chart_xy.png"></a></li>
</ul>
</li>
</ul>
<div class="spliter"></div>
<ul id="colorpicker">
<li>
<a href="javascript:;" onclick="showColorList()" id="selectedcolor" data-color="#000" style="background-color:#000;" title="Color"></a>
<ul id="colorlist" style="display:none">
<li data-color="#000000" style="background-color:#000000"></li>
<li data-color="#2e3136" style="background-color:#2e3136"></li>
<li data-color="#ae352c" style="background-color:#ae352c"></li>
<li data-color="#126a76" style="background-color:#126a76"></li>
<li data-color="#677333" style="background-color:#677333"></li>
<li data-color="#972f38" style="background-color:#972f38"></li>
<li data-color="#c4a000" style="background-color:#c4a000"></li>
<li data-color="#9b59b6" style="background-color:#9b59b6"></li>
<li data-color="#16a085" style="background-color:#16a085"></li>
<li data-color="#910000" style="background-color:#910000"></li>
<li data-color="#8f5902" style="background-color:#8f5902"></li>
</ul>
</li>
<li>
<a href="javascript:;" onclick="showBackgroundList()" data-background="" title="Background"><img src="http://wangweiqiang.net/demo/MagicNote/images/background.png"></a>
<ul id="backgroundlist" style="display:none">
<li data-img=""><img src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSgBBwcHCggKEwoKEygaFhooKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKP/AABEIAHgAeAMBEQACEQEDEQH/xAGiAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgsQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+gEAAwEBAQEBAQEBAQAAAAAAAAECAwQF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kgGgAU9x0oAUDBPPWgBfrQAEZGaAG/SgBp6j1oATrSAGBwMdzTAASD7CgB+cjJoAb/AAgmgBw659aAI2z079aABRjvQA8Lzk+lACgDgdqAHYoAUDAHagBM4oAao7noaAD6UANHBJPWgBy84I6ZoACMjFACOSCB1zQA7GeM5oAZkDA5zQAwnn3pAOHPSgCUDpTAB0NADTnNADjQA3IbmgBwGPpQAwn8KADIJFACgjpn6CgBASCeaAF6fWgBvueM+lADcjp3x1oABgp+lAD48EYxQA4daAFHvQAH2oAO1ACHqPT0oAUHrQAzGR+NACLz9aAFUcZoAFB3HPagBHYjqM96AGs2VHByfSi4CAY/KkAp6cd6ABCRnjHamBKGHA70AL2oAazYGaAHjpQAntQAdPxoABQAzaM46dqAF6fhQAmcUAN68nvQALx04xmlYBVy2SenamAsa7Qc8mgBWGM+poAai9M8GgB5IzQAGgBRQAhNAAcHrQADIFADd2CDg0AIG5PHWgBAcnPegBXPTFADVOW55oAfnkc0AKOD0yKAHDORzwKAEHXgcDvQAHHrQAdaAEHBIFABg4oAUHmgBaAG9AOpoAZ3yaAG5+tACrkgCgCVUBXNACAHpQAuQMk0AJkHBoAcTnOKAGHp70AIOo5oAfnPTigAGT+FACKNpoAVjQB//9k="></li>
<li data-img=""><img src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSgBBwcHCggKEwoKEygaFhooKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKP/AABEIAHgAeAMBEQACEQEDEQH/xAGiAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgsQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU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YncAo5PPWgBCGxjJz6+tAEXIODQA37wwVIoAjlY8DP40AG89/rQAuCMkEE0APjG0gsePrQBJ5nzgdeelAEuOehGaAHhudoPegAIO7g5GKAF3DuQDQAA5zQBGzc9eh6UAIXO7p06UAIxOQB0JoAQjjODnNAEbE5zngUAQDJJyRkCgAYYGQcYOKAHDcRk0AOD5I+XNACK4zkjHOKALCHcvPHOBzQA8AbicnrQAGTLDI4oAG+bHTrxQA9cjj9aAEKr+J6+9ADV4GPWgBo4PNACHI6/lQAzGCCfyoAqjCmgBxbPBOAaAJNvyDBoAh53HkE9hQA5OhBx+FAEkJO0hcEigCZe/P1oAfkk49O9ADvmIGSOuaAEyRkg8UAICdvtQAm4jkYNACYJbrkdaAFGMnIH5UANPQgUAUj2oAUnKjj8qAJA2BuFAB1UjPagBVXcQSOKAJVTbjHWgCQCgB/THGTQAh6E/nQAgHHHSgBNh5Pt0oAb1PHUUAIWx9fegBAcA0ADkLyCMnpQBSDY7DJ45oAUdDyRQA6MZ/GgCcJyufpQBIuduP1xQAfxewoAkUdwaAJOAc+1ADGHNACEgHHSgBBnGM84oATncCwOcevSgBhbMlAD8ZHPU9qAI3TJyxzjtQBWKdKAFKY/GgBAMEUASoeeR75zQBNkgYz2oAdjofagBw+uDjpQA4jv14xQAkhwBigBj8Ant70ACEkZPagAJzgqQKAECjcfxzQAKADjr70ANY/MQD1oAiQDbuJ7c0AO2+9ADEHz4IwM5oAkwM/hQA4FQvbpQA5W44oAfxnGe1AC5wuTQAx+nGeRQAbhswAM0AHDH+HcfXmgBQgGRtxz0zQAmeaAGuccUAMfPBHY0Af/2Q=="></li>
</ul>
</li>
</ul>
<div class="spliter"></div>
<ul>
<li><a href="javascript:;" onclick="myCanvas.Clear()" title="New"><img src="http://wangweiqiang.net/demo/MagicNote/images/new.png" alt="New"></a></li>
<li>
<a href="javascript:;" onclick="showOpenDialog()" title="Open"><img src="http://wangweiqiang.net/demo/MagicNote/images/open.png" alt="Open"></a>
<ul id="opendialog" style="display:none">
</ul>
</li>
<li><a href="javascript:;" onclick="myCanvas.Save()" title="Save"><img src="http://wangweiqiang.net/demo/MagicNote/images/save.png" alt="Save"></a></li>
<li><a href="javascript:;" onclick="myCanvas.DownloadPngImage()" title="Export PNG Image"><img src="http://wangweiqiang.net/demo/MagicNote/images/download.png" alt="Download Image"></a></li>
<li><a href="javascript:;" onclick="shareImage()" title="Share"><img src="http://wangweiqiang.net/demo/MagicNote/images/share.png" alt="Share"></a></li>
<li><a href="http://wangweiqiang.net" target="_blank" title="About"><img src="http://wangweiqiang.net/demo/MagicNote/images/information.png" alt="About"></a></li>
</ul>
</div>
<canvas id="myCanvas" data-backgroundimg="" width="1880" height="980" style="cursor: url(http://wangweiqiang.net/demo/MagicNote/images/pencil-cursor.png) 0 0, auto;"></canvas>
<div id="bottombar"><a href="javascript:myCanvas.ExtandHeight(500)"><img src="http://wangweiqiang.net/demo/MagicNote/images/expand-down.png"></a></div>
<script src='//production-assets.codepen.io/assets/common/stopExecutionOnTimeout-b2a7b3fe212eaa732349046d8416e00a9dec26eb7fd347590fbced3ab38af52e.js'></script><script src='//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script >var ProjectList=[];
function Canvas(domid){
var canvasobj=this;
this.canvas=document.getElementById(domid);
this.canvas.width=screen.width-40;
this.canvas.height=screen.height-100;
this.Context=this.canvas.getContext('2d');
this.mouse={x:0,y:0};
this.Brush=new Brush(this.Context,0,0);
this.Saved=false;
this.Data={
filename:"Untitled",
thum:"",
background:"",
content:"",
createdate:new Date(),
lastmodify:new Date()
};
this.SetBackground=function(img){
$("#"+domid).css("background-image","url(data:image/jpg;base64,"+img+")");
$("#"+domid).data().backgroundimg=img;
};
this.ExtandHeight=function(height){
var buffer=document.createElement("canvas");
buffer.width=canvasobj.canvas.width;
buffer.height=canvasobj.canvas.height;
var bufferCtx=buffer.getContext('2d');
bufferCtx.drawImage(canvasobj.canvas,0,0);
canvasobj.canvas.height+=height;
canvasobj.Context.drawImage(buffer,0,0);
};
this.Clear=function(){
canvasobj.canvas.width=screen.width-40;
canvasobj.canvas.height=screen.height-100;
canvasobj.Context.clearRect(0,0,canvasobj.canvas.width,canvasobj.canvas.height);
canvasobj.Data.filename="Untitled";
canvasobj.Data.thum="";
canvasobj.Data.background="";
canvasobj.Data.content="";
canvasobj.Data.createdate=new Date();
canvasobj.Data.lastmodify=new Date();
};
this.DownloadPngImage=function(){
var buffer=document.createElement("canvas");
buffer.width=canvasobj.canvas.width;
buffer.height=canvasobj.canvas.height;
var bufferCtx=buffer.getContext('2d');
//draw background
var imageObj = new Image();
imageObj.onload = function() {
var pattern = bufferCtx.createPattern(imageObj, 'repeat');
bufferCtx.rect(0, 0, buffer.width, buffer.height);
bufferCtx.fillStyle = pattern;
bufferCtx.fill();
//draw front
bufferCtx.drawImage(canvasobj.canvas,0,0);
//save as png img
buffer.toBlob(function (blob) {
saveAs(blob, "exported_image.png");
}, "image/png");
};
imageObj.src ="data:image/jpg;base64,"+ $("#"+domid).data().backgroundimg;
}
this.Load=function(data){
canvasobj.Data=data;
var img=new Image();
img.onload=function(){
canvasobj.canvas.width=img.width;
canvasobj.canvas.height=img.height;
canvasobj.Context.clearRect(0,0,canvasobj.canvas.width,canvasobj.canvas.height);
canvasobj.Context.drawImage(img,0,0);
canvasobj.SetBackground(data.background);
};
img.src=data.content;
};
this.Save=function(){
if(canvasobj.Data.filename=="Untitled" && canvasobj.Data.thum=="" && canvasobj.Data.content==""){ //new document
var filename=prompt("Please input a name:");
if(filename==""){
alert("Name can not be empty!");
return false;
}
//update canvasobj.Data
canvasobj.Data.filename=filename;
canvasobj.Data.background=$(myCanvas.canvas).data().backgroundimg;
canvasobj.Data.content=myCanvas.canvas.toDataURL();
resizeImage(canvasobj.Data.content, 120, 120, function(url,f){
canvasobj.Data.thum=url;
if(ProjectList==null || ProjectList.length==0){
ProjectList=[];
ProjectList.push(canvasobj.Data);
}
else
{
ProjectList.push(canvasobj.Data);
}
localStorage.setItem("magicnote",JSON.stringify(ProjectList));
canvasobj.Saved=true;
}, canvasobj.Data);
}
else //exist document
{
$.each(ProjectList,function(i,n){
if(n.filename==canvasobj.Data.filename){
n.content=myCanvas.canvas.toDataURL();
n.background=$(myCanvas.canvas).data().backgroundimg;
resizeImage(n.content, 120, 120, function(url,f){
n.thum=url;
localStorage.setItem("magicnote",JSON.stringify(ProjectList));
canvasobj.Saved=true;
}, n);
}
});
}
};
this.mouseDown=function(e){
var xy=canvasobj.ev_canvas(e);
canvasobj.mouse.x=xy.x;
canvasobj.mouse.y=xy.y;
canvasobj.Brush.x=canvasobj.mouse.x;
canvasobj.Brush.y=canvasobj.mouse.y;
canvasobj.Brush.StartStroke();
};
this.mouseMove=function(e){
var xy=canvasobj.ev_canvas(e);
canvasobj.mouse.x=xy.x;
canvasobj.mouse.y=xy.y;
canvasobj.Brush._latest.x=canvasobj.mouse.x;
canvasobj.Brush._latest.y=canvasobj.mouse.y;
if(canvasobj.Brush._isStroke){
canvasobj.Saved=false;
}
canvasobj.Brush.render();
};
this.mouseUp=function(e){
var xy=canvasobj.ev_canvas(e);
canvasobj.mouse.x=xy.x;
canvasobj.mouse.y=xy.y;
canvasobj.Brush.EndStroke();
};
this.ev_canvas=function(ev) {
if (false) {
ev._x = ev.touches[0].clientX;
ev._y = ev.touches[0].clientY; // CH: Is there a better way to do this?
}
else if (ev.layerX || ev.layerX == 0) { // Firefox
ev._x = ev.layerX;
ev._y = ev.layerY;
}
else if (ev.offsetX || ev.offsetX == 0) { // Opera
ev._x = ev.offsetX;
ev._y = ev.offsetY;
}
ev._x = ev._x + 0.5;
return {x:ev._x,y:ev._y};
};
this.canvas.addEventListener("mousedown",canvasobj.mouseDown,false);
this.canvas.addEventListener("mousemove",canvasobj.mouseMove,false);
this.canvas.addEventListener("mouseup",canvasobj.mouseUp,false);
}
function Brush(ctx,x,y){
var brushObj=this;
this.Name="pencil";
this.Color={r:0,g:0,b:0,a:0};
this.Opacity=1;
this.Size=1;
this.DrawMode="source-over";
this.LineJoin="round";
this.LineCap="round";
this.InkAmount=0;
this.ShadowBlur=0.5;
this.ShadowColor="#000000";
this.SplashRange=0;
this.SplashInkSize=0;
this._currentLineWidth=1;
this._strokeId=null;
this._isStroke=false;
this._strokeRenderCount=0;
this._hairs=null;
this._latest={x:0,y:0};
this.x=x;
this.y=y;
this.StartStroke=function(){
brushObj.resetTip();
brushObj._strokeId = new Date().getTime();
brushObj._isStroke = true;
};
this.EndStroke=function() {
brushObj._isStroke = false;
brushObj._strokeRenderCount = 0;
brushObj._strokeId = null;
};
this.resetTip=function() {
var hairs = brushObj._hairs = [];
var inkAmount = brushObj.InkAmount;
var hairNum = brushObj.Size * 10;
var range = brushObj.Size / 4;
var rx, ry, c0, x0, y0;
var c = random(Math.PI * 4), cv, sv, x, y;
for (var i = 0, r; i < hairNum/3; i++) {if (window.CP.shouldStopExecution(1)){break;}
rx = random(range);
ry = rx / 4;
c0 = random(Math.PI * 4);
x0 = rx * Math.sin(c0);
y0 = ry * Math.cos(c0);
cv = Math.cos(c);
sv = Math.sin(c);
x = brushObj.x;
y = brushObj.y;
hairs[i] = new Hair(x, y, brushObj);
}
window.CP.exitedLoop(1);
//this.color.h += 140;
};
this.render=function() {
brushObj._strokeRenderCount++;
if (!brushObj._latest) {
brushObj._latest = { x: brushObj.x, y: brushObj.y };
} else {
//brushObj._latest.x = brushObj.x;
//brushObj._latest.y = brushObj.y;
}
var dx = brushObj._latest.x-brushObj.x ;
var dy = brushObj._latest.y-brushObj.y ;
var dist = brushObj._latestStrokeLength = Math.sqrt(dx * dx + dy * dy);
var hairs = brushObj._hairs;
var i, len;
for (i = 0, len = hairs.length; i < len; i++) {if (window.CP.shouldStopExecution(2)){break;}
hairs[i].update(dx, dy, dist,brushObj);
}
window.CP.exitedLoop(2);
if (brushObj._isStroke) {
for (i = 0, len = hairs.length; i < len; i++) {if (window.CP.shouldStopExecution(3)){break;}
hairs[i].draw(ctx);
}
window.CP.exitedLoop(3);
}
brushObj.x=brushObj._latest.x;
brushObj.y=brushObj._latest.y;
};
this.Change=function(type){
switch(type){
case "pencil":
myCanvas.Brush.Name="pencil";
myCanvas.Brush.Opacity=0.8;
myCanvas.Brush.Size=1;
myCanvas.Brush.DrawMode="source-over";
myCanvas.Brush.LineJoin="round";
myCanvas.Brush.LineCap="round";
myCanvas.Brush.InkAmount=1;
myCanvas.Brush.ShadowBlur=2;
myCanvas.Brush.ShadowColor="#000000";
myCanvas.Brush.SplashRange=0;
myCanvas.Brush.SplashInkSize=0;
$("#myCanvas").css("cursor","url(http://wangweiqiang.net/demo/MagicNote/images/pencil-cursor.png) 0 0,auto")
break;
case "quill":
myCanvas.Brush.Name="quill";
myCanvas.Brush.Opacity=1;
myCanvas.Brush.Size=1;
myCanvas.Brush.DrawMode="source-over";
myCanvas.Brush.InkAmount=5;
myCanvas.Brush.ShadowBlur=2;
myCanvas.Brush.ShadowColor="#000000";
myCanvas.Brush.SplashRange=2;
myCanvas.Brush.SplashInkSize=2;
$("#myCanvas").css("cursor","url(http://wangweiqiang.net/demo/MagicNote/images/quill-cursor.png) 0 0,auto")
break;
case "highlightmarker":
myCanvas.Brush.Name="highlightmarker";
myCanvas.Brush.Opacity=0.005;
myCanvas.Brush.Size=40;
myCanvas.Brush.DrawMode="source-over";
myCanvas.Brush.InkAmount=50;
myCanvas.Brush.ShadowBlur=50;
myCanvas.Brush.SplashRange=20;
myCanvas.Brush.SplashInkSize=20;
$("#myCanvas").css("cursor","url(http://wangweiqiang.net/demo/MagicNote/images/highlightmarker-cursor.png) 0 0,auto");
break;
case "ereaser":
myCanvas.Brush.Name="ereaser";
myCanvas.Brush.Opacity=1;
myCanvas.Brush.Size=20;
myCanvas.Brush.DrawMode="destination-out";
myCanvas.Brush.LineJoin="round";
myCanvas.Brush.LineCap="round";
myCanvas.Brush.InkAmount=0;
myCanvas.Brush.ShadowBlur=0;
myCanvas.Brush.ShadowColor="#000000";
myCanvas.Brush.SplashRange=0;
myCanvas.Brush.SplashInkSize=0;
$("#myCanvas").css("cursor","url(http://wangweiqiang.net/demo/MagicNote/images/eraser-cursor.png) 0 0,auto")
break;
case "coordinate":
gPenMode="coordinate";
$("#myCanvas").css("cursor","url(http://wangweiqiang.net/demo/MagicNote/images/chart_xy.png) 0 0,auto")
break;
}
};
this.resetTip();
}
function Hair(x, y, brush) {
this.x = x || 0;
this.y = y || 0;
this.brush=brush;
this._latest = { x: this.x, y: this.y };
}
Hair.prototype = {
update: function(strokeX, strokeY, strokeLength,brush) {
this._latest.x = this.x;
this._latest.y = this.y;
this.x += strokeX;
this.y += strokeY;
this.brush=brush;
this.opacity=brush.Opacity;
this.shadowblur=brush.ShadowBlur;
this.drawmode=brush.DrawMode;
this.name=brush.Name;
this.linecap=brush.LineCap;
this.linejoin=brush.LineJoin;
switch(brush.Name){
case "pencil":
case "quill":
case "highlightmarker":
this._currentLineWidth=brush.Size* Math.min(brush.InkAmount / strokeLength, 1);
break;
default:
this._currentLineWidth=brush.Size;
break;
}
},
draw: function(ctx) {
ctx.save();
line(ctx, this,this._latest, this._currentLineWidth,this.brush);
ctx.restore();
}
};
function line(ctx, p1, p2,lineWidth,brush) {
ctx.shadowColor='rgba('+brush.Color.r+','+brush.Color.g+','+brush.Color.b+','+brush.Opacity+')';
ctx.strokeStyle='rgba('+brush.Color.r+','+brush.Color.g+','+brush.Color.b+','+brush.Opacity+')';
ctx.lineWidth = lineWidth;
ctx.lineCap=brush.LineCap;
ctx.lineJoin=brush.LineJoin;
ctx.beginPath();
ctx.moveTo(p1.x, p1.y);
ctx.lineTo(p2.x, p2.y);
//ctx.arcTo(p1.x + lineWidth, p1.y, p1.x + lineWidth,p1.y + lineWidth/2, lineWidth/2);
ctx.shadowBlur=brush.ShadowBlur;
ctx.globalCompositeOperation=brush.DrawMode
ctx.stroke();
}
function random(max, min) {
if (typeof max !== 'number') {
return Math.random();
} else if (typeof min !== 'number') {
min = 0;
}
return Math.random() * (max - min) + min;
}
function hexToRgb(hex) {
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null;
}
function resizeImage(url, width, height, callback, file) {
var sourceImage = new Image();
sourceImage.onload = (function (f) {
return function (evt) {
var canvas = document.createElement("canvas");
canvas.width = width;
canvas.height = height;
if (sourceImage.width == sourceImage.height) {
canvas.getContext("2d").drawImage(sourceImage, 0, 0, width, height);
} else {
minVal = Math.min(sourceImage.width, sourceImage.height);
if (sourceImage.width > sourceImage.height) {
canvas.getContext("2d").drawImage(sourceImage, (sourceImage.width - minVal) / 2, 0, minVal, minVal, 0, 0, width, height);
} else {
canvas.getContext("2d").drawImage(sourceImage, 0, (sourceImage.height - minVal) / 2, minVal, minVal, 0, 0, width, height);
}
}
callback(canvas.toDataURL(), f);
}
})(file);
sourceImage.src = url;
}
function switchToolBar(){
if($(".toolbar").hasClass("show")){
$("#colorlist").fadeOut('slow',function(){
$(".toolbar").animate({
left:'-42px'
},500,function(){
$(".toolbar").removeClass("show")
});
});
}
else
{
$(".toolbar").animate({
left:'0'
},500,function(){
$(".toolbar").addClass("show");
});
}
}
function showColorList(){
$("#colorlist").fadeToggle();
}
function showBackgroundList(){
$("#backgroundlist").fadeToggle();
}
function showOpenDialog(){
$("#opendialog").fadeToggle();
}
function showTools(){
$("#tools").fadeToggle();
}
function saveImage(canvas){
var buffer=document.createElement("canvas");
buffer.width=canvas.width;
buffer.height=canvas.height;
var bufferCtx=buffer.getContext('2d');
bufferCtx.drawImage(canvas,0,0);
var context = canvas.getContext('2d');
var imageObj = new Image();
imageObj.onload = function() {
var pattern = context.createPattern(imageObj, 'repeat');
context.rect(0, 0, canvas.width, canvas.height);
context.fillStyle = pattern;
context.fill();
canvas.getContext('2d').drawImage(buffer,0,0);
};
imageObj.src = gBackground;
var oCanvas = document.getElementById("myCanvas");
Canvas2Image.saveAsPNG(oCanvas);
}
function open(){
}
var myCanvas;
$(function(){
ProjectList=JSON.parse(localStorage.getItem("magicnote"));
if(ProjectList!=null){
var filelist="";
$.each(ProjectList,function(i,n){
filelist+="<li data-filename='"+n.filename+"'><img src='"+n.thum+"' style='background-image:url(data:image/png;base64,"+n.background+")'/><br/>"+n.filename+"</li>";
});
$("#opendialog").html(filelist);
$("#opendialog li").click(function(){
var item=this;
$.each(ProjectList,function(i,n){
if(n.filename==$(item).data().filename){
myCanvas.Load(n);
}
});
showOpenDialog();
});
}
myCanvas=new Canvas("myCanvas");
myCanvas.Brush.Change('pencil');
$("#colorlist li").click(function(){
gColor=$(this).data().color;
gHighLightColor=gColor;
myCanvas.Brush.Color=hexToRgb(gColor);
$("#selectedcolor").css("background-color",gColor);
$("#handler span.colorshow").css("background-color",gColor);
$("#colorlist").fadeOut();
});
$.each($("#backgroundlist li"),function(i,n){
$(n).data().img=Background[i].bg;
$(n).find("img").attr("src","data:image/jpg;base64,"+Background[i].thum);
});
$("#backgroundlist li").click(function(){
gBackground=$(this).data().img;
myCanvas.SetBackground(gBackground);
$("#backgroundlist").fadeOut();
});
document.onselectstart=function(){return false;}
});
//# sourceURL=pen.js
</script>
</body></html>