knockout and html5 canvas in durandal
i am trying to use the html5 canvas element to draw in durandal without
success can anybody help?
the markup
<body>
<canvas id="canvas"></canvas>
</body>
the js
define(function() {
function viewAttached() {
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
var buffer = document.createElement('canvas');
buffer.width = buffer.height = 60;
var bctx = buffer.getContext('2d');
bctx.translate(30, 30);
bctx.rotate(0.5);
bctx.fillStyle = 'rgb(255, 0, 0)';
bctx.fillRect(-15, -15, 30, 30);
ctx.fillStyle = 'rgb(0, 255, 0)';
ctx.fillRect(30, 30, 30, 30);
ctx.drawImage(buffer, 50, 50);
}
var ctor = function () {
this.viewAttached = viewAttached();
return ctor;
};
});
The most recent five years have not been thoughtful to the lodging business. Moreover, there have been numerous reports about the land business sector being not doing so great.
ReplyDeletehttp://www.hometownnationalwa.com |
http://www.horsebaktour.com |
http://www.hotel-travel-america.com |
http://www.iranadventuretours.com |
http://www.kentbusinessclinic.com |