tags:

views:

2682

answers:

2

I found that there are only can fill rectangle, but no rounded corner one, how can I do that?

+1  A: 

Canvas doesn't provide a method which draw a rounded corner rectangle.

How about using lineTo() and arc() methods ?

Or, You can also use quadraticCurveTo() method instead arc() method.

http://www.html5.jp/canvas/ref/method/sample/quadraticCurveTo2.html

For some reason, I seem to be having issues with arcTo in Firefox 3.5 and Opera 10.0. Similar to this site: http://ditchnet.org/canvas/CanvasRoundedCornerExample.html
PiPeep
+1  A: 

I needed to do the same thing and created a method to do it. http://js-bits.blogspot.com/2010/07/canvas-rounded-corner-rectangles.html

Juan Mendes