On Dec 19, 2009, at 6:21 PM, BravoBug Software wrote:
> [[NSColor selectedMenuItemColor] set];
> NSRectFill(someRect);
This works because the selectedMenuItemColor is a pattern that happens to draw
a gradient. You could just as easily draw nearly anything with a pattern, and
Quartz treats patte
The method I use goes like this:
1. Create a CGContext (maskContext);
2. Draw the original text into maskContext;
3. Create another CGContext (gradientContext);
4. Use CGContextClipToMask() to mask gradientContext using the CGImage
generated from CGBitmapContextCreateImage(maskContext)
On 20/12/2009, at 1:21 PM, BravoBug Software wrote:
>> Why would you even expect that to work? NSGradient is not a colour. At
>> present there is no supported attribute for gradients.
>
> Oh? You might want to let the folks at Apple know that ;)
>
> [[NSColor selectedMenuItemColor] set];
> NSR
> Why would you even expect that to work? NSGradient is not a colour. At
> present there is no supported attribute for gradients.
Oh? You might want to let the folks at Apple know that ;)
[[NSColor selectedMenuItemColor] set];
NSRectFill(someRect);
-matt
On Thu, Dec 17, 2009 at 3:50 PM, Grah
There's a far easier way to do it than that, which is to use
compositing instead of clipping.
On Dec 17, 2009, at 9:49 PM, Gordon Apple wrote:
If you capture the entire laid-out text string as a single Bezier
path,
then you can fill it with whatever you want -- gradient, image,
burning fir
If you capture the entire laid-out text string as a single Bezier path,
then you can fill it with whatever you want -- gradient, image, burning fire
QTMovie, more text, etc. I've done it and it works. Of course, all of that
takes a significant amount of effort. In my case, I already had all the
On 18/12/2009, at 4:31 AM, Chris Purcell wrote:
> I've tried setting the gradient as NSForegroundColorAttributeName in the
> attributes dictionary when creating the string but as I expected that didn't
> work. How would I go about filling the string with a gradient?
Why would you even expect t
I've tried setting the gradient as NSForegroundColorAttributeName in the
attributes dictionary when creating the string but as I expected that didn't
work. How would I go about filling the string with a gradient?
Thanks!
--Chris
___
Cocoa-dev mailing