Printing NSGradient / CTGradient with alpha
Printing NSGradient / CTGradient with alpha
- Subject: Printing NSGradient / CTGradient with alpha
- From: Matthew Tonkin <email@hidden>
- Date: Wed, 21 May 2008 14:03:01 +0930
Hi All,
I'm trying to print a NSGradient or CTGradient that comprises two
colors with alpha.
It draws fine on screen, and draws fine in the print panel preview,
but when I create a PDF or print it, the alpha is not respected at all.
Here is my drawing code:
- (void)drawRect:(NSRect)rect {
// Drawing code here.
[[NSColor blueColor] set];
NSRectFill(rect);
NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:
[NSColor clearColor] endingColor:[NSColor colorWithCalibratedWhite:1.0
alpha:0.5]];
[gradient drawInRect:NSInsetRect([self bounds], 5, 5) angle:90.0];
[gradient release];
}
You can check out how it looks on screen and in print here: http://skitch.com/mattski/m78t/window
Any help would be greatly appreciated.
Thanks,
Matt Tonkin
NovaMind Software
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden