It is currently Sat Dec 02, 2017 4:22 pm
Advanced search
Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.
by zcorpan » Tue Jul 06, 2010 6:57 pm
You mean like destination-out?
-
zcorpan
- <article>
-
- Posts: 807
- Joined: Tue Feb 06, 2007 8:29 pm
- Location: Sweden
by connor » Mon Jul 12, 2010 5:42 pm
- Code: Select all
...
gContext.beginPath();
// draw a circle
gContext.arc(centerX, centerY, boxWidth/2, 0, Math.PI*2, false);
// draw a box around that circle as part of the same path
gContext.moveTo(centerX-boxWidth/2, centerY-boxWidth/2);
gContext.lineTo(centerX-boxWidth/2, centerY+boxWidth/2);
gContext.lineTo(centerX+boxWidth/2, centerY+boxWidth/2);
gContext.lineTo(centerX+boxWidth/2, centerY-boxWidth/2);
gContext.lineTo(centerX-boxWidth/2, centerY-boxWidth/2);
gContext.closePath();
gContext.clip();
Results in a clipping path consisting of a square region centered at (centerX, centerY) with sides of length boxWidth which excludes a circular region at the center with radius boxWidth/2.
-
connor
- <h6>
-
- Posts: 1
- Joined: Mon Jul 12, 2010 5:32 pm
- Location: Wisconsin
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 0 guests