Tag: canvas

Draw text along the bezier curve in paper.js

Is it possible to easily draw text along the bezier curve using paper.js? I know it is possible to attach text to a line path and then rotate it, but I am interested specifically in drawing text along the curve. Something like http://www.w3.org/TR/SVG11/images/text/toap02.svg I understand this may be achieved by printing text a letter by […]

Draw a square in javascript using canvas

I am using the following code to draw a square. I am new to javascript. Can anyone please tell me what’s wrong with the following code? It doesn’t draw an exact/correct square. The side/length of the square must be the one that is longer between x & y. I think there are some dimension issues. […]

Canvas FPS artificially limited to 100fps?

In this page that counts the number of frames rendered and prints the FPS onto the canvas, we can see that it tops out at 100fps, which seems suspicious at the least. Why is this? <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”utf-8″> <title>Canvas FPS artificial limiting</title> </head> <body> <canvas id=”c” width=”320″ height=”240″></canvas> <script> var c […]

How to clear a rectangle area in WebGL?

WebGL has a clear method that clears an entire surface. What’s the best way to clear just a particular rectangle of the surface? For example I want to set a 100×100 box of pixels starting at (50, 50) to all zeroes (ARGB 0, 0, 0, 0). All I can think of right now is drawing […]

Javascript Game Loop

I have some questions concerning JavaScript loops. Questions : Why does a JavaScript loop freeze the browser Why is the drawing slow even do it’s running at 1 draw every 1ms and it’s drawing the simplest thing! What’s the solution? flash is dying, what do we do now? Here is the canvas code to try […]

Efficient milliseconds display in HTML

The goal: find the most CPU efficient way to display the current milliseconds in HTML. My current solution takes up to 10% CPU computation on my laptop. My current solution: http://dev.timerintab.appspot.com/test/ms My final goal is to display the milliseconds on a timer. UpdateI changed the test to take an argument for the interval: http://dev.timerintab.appspot.com/test/ms?interval=x where […]

Quick Print HTML5 Canvas

I want to send/print the canvas image directly to the default printer. That means a quick printing. Anyone can give a hint. Javascript or jQuery.

Canvas drawimage with round corners

I’m using this coverflow script on my website and I don’t know how to output the canvas with rounded corners. This is the code that draws the image ctx.drawImage(image, cropLeft, cropTop, wid-2*cropLeft, hei-2*cropTop, 0, 0, newWidth, newHeight); I read some tutorials using arc() or arcTo() functions but none of them we’re using an image as […]

how to fill certain percentage area of circle in color in html canvas?

I have some 9 circles in my html page.Each circle has to be filled with certain color with certain percentage.I have drawn the circles using html5 canvas element.But i was only able to fill the enitre circle with a color and not certain percantage area.How can i achieve that?

Canvas Element and IE

Well not just IE, any browser that doesn’t currently support it I want to start using the processing.js framework. It’s used for making images with the canvas element. However I’m reluctant to use it due to the fact that it’s not widely supported. So what’s the best way for me to give the user an […]