Re: NSBezierCurve and Line Width
Re: NSBezierCurve and Line Width
- Subject: Re: NSBezierCurve and Line Width
- From: "R. Scott Thompson" <email@hidden>
- Date: Fri, 3 Dec 2004 09:26:49 -0600
On Dec 3, 2004, at 4:39 AM, Jeff LaMarche wrote:
I'm drawing a line segment with rounded end caps by stroking an
NSBezierCurve I've defined. Right now, the line has a uniform
thickness, but what I'd like to be able to do is to have the line
width change from point A to point B. So, for example, instead of a
4px line all the way, I'd like it to start at 6px at point A, and end
up as 3 px in width by point B.
Is there an easy way to do this? The code to create this using
polygons is a little daunting, so I don't want to tackle it unless
absolutely necessary.
As always, Thanks in advance.
Jeff
There's no way to do this using the API directly. What you are asking
for is not part of the imaging model of Quartz 2D.
What you are going to have to do is subdivide the curve yourself to
create short line segments and use that to help you draw the line. It
sounds like you already have code to do that (the "code to create this
using polygons"). It's likely complex because either it's optimized
into obscurity (there are lots of trick folks like to use to speed up
subdivision) and/or you're just not familiar with the math involved so
it seems a lot more complicated than it really is :-).
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden