On Oct 1, 2008, at 5:46 AM, Michael Robinson wrote:

Unsurprisingly, I need my hand held again.

1. how do I initialize a CGShading object, with my two colours (left right/top bottom)

See the Quartz 2D Shadings sample at <http://developer.apple.com/samplecode/Quartz2DShadings/index.html > The sample code runs on 10.5, but the shadings code should work on 10.4 as well (the sample only runs on 10.5 because it also uses the CGGradientRef APIs).

2. how do I fill my NSBitmapImageRep with this pretty gradient?


Create an NSGraphicsContext with the image rep, then get the CGContext from the NSGraphicsContext. The latter is shown in the sample above, although the former is not.
--
David Duncan
Apple DTS Animation and Printing

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to