• 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
-[NSColor setBackgroundColor:] not working in 10.6
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-[NSColor setBackgroundColor:] not working in 10.6


  • Subject: -[NSColor setBackgroundColor:] not working in 10.6
  • From: Hamish Sanderson <email@hidden>
  • Date: Wed, 6 Oct 2010 08:34:13 +0100

Hi,

I have a simple test app that reads a PDF file into an NSImage, sets its background color to white, and draws it into an NSView subclass:

@implementation CTView

- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (self) {
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"img" ofType:@"pdf"]];
img = [[NSImage alloc] initWithContentsOfURL: url];
[img setBackgroundColor: [NSColor whiteColor]];
}
return self;
}


- (void)drawRect:(NSRect)rect {
NSRect bounds = {{0,0}, {[img size].width * 1.5, [img size].height * 1.5}};
[[NSColor blueColor] drawSwatchInRect:rect];
[img drawInRect:rect fromRect:bounds operation:NSCompositeCopy fraction:1];
}


@end

When run on 10.5, the transparent portions of the PDF are filled with white as intended. On 10.6, however, the transparent portions appear black (or transparent if the view is CA-enabled). Any ideas why it's not behaving on 10.6?

Thanks,

Hamish
--

Hamish Sanderson
Production Workflow Developer
Sun Branding Solutions Ltd
Tel: +44(0)1274 200 700
www.sunbrandingsolutions.com





_______________________________________________

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


  • Follow-Ups:
    • Re: -[NSColor setBackgroundColor:] not working in 10.6
      • From: Manfred Schwind <email@hidden>
    • Re: -[NSColor setBackgroundColor:] not working in 10.6
      • From: Ken Ferry <email@hidden>
  • Prev by Date: Re: Problem with MakeKeyandOrderFront
  • Next by Date: Re: NSOutlineView multi cell type binding query
  • Previous by thread: Re: Problem connecting to Oracle with app run from XCode
  • Next by thread: Re: -[NSColor setBackgroundColor:] not working in 10.6
  • Index(es):
    • Date
    • Thread