Re: Wedgies anyone?
Re: Wedgies anyone?
- Subject: Re: Wedgies anyone?
- From: Kyle Hammond <email@hidden>
- Date: Mon, 17 Jun 2002 14:46:08 -0500
Hi,
You're making it too hard. Cocoa makes it very simple to do what you
want.
Here's my code for drawing some fraction of a pie. In the code below,
maximum is the maximum value contained in the pie and value is the
portion (out of maximum) that you'd like to fill in. You can stroke or
fill the path, or use it as a clipping path for an image. I usually
have startAngle = 0, but you can easily change that.
tempPath = [ NSBezierPath bezierPath ];
[ tempPath appendBezierPathWithArcWithCenter:centerPoint
radius:radius
startAngle:startAngle
endAngle:( ( value / maximum ) * 360.0 ) +
startAngle ];
[ tempPath lineToPoint:centerPoint ];
[ tempPath closePath ];
Best of luck,
Kyle
---------------------
Kyle Hammond
email@hidden
http://www.CodeBlazer.com/ - multimedia software solutions
http://www.isd.net/dsl03002/ - my personal home page
http://cocoabudget.home.att.net/ - Budget for MacOS X home page
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.