• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Printing NSGradient / CTGradient with alpha
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Printing NSGradient / CTGradient with alpha


  • Subject: Re: Printing NSGradient / CTGradient with alpha
  • From: Andrew Merenbach <email@hidden>
  • Date: Tue, 20 May 2008 21:48:26 -0700

Hi, Matt,

Check out these posts -- it appears that you may not actually be doing anything wrong after all:

<http://www.cocoabuilder.com/archive/message/cocoa/2004/8/4/113656>
<http://www.cocoabuilder.com/archive/message/cocoa/2004/8/9/114100>

and this thread:

<http://www.cocoabuilder.com/archive/message/cocoa/2002/10/31/7501>

Good luck!

Cheers,
	Andrew

On May 20, 2008, at 9:33 PM, Matthew Tonkin wrote:

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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >Printing NSGradient / CTGradient with alpha (From: Matthew Tonkin <email@hidden>)

  • Prev by Date: Printing NSGradient / CTGradient with alpha
  • Next by Date: Re: Cocoa et al as HCI usability problem
  • Previous by thread: Printing NSGradient / CTGradient with alpha
  • Next by thread: NSTextView embedded audio/video not loading
  • Index(es):
    • Date
    • Thread