-[NSColor setBackgroundColor:] not working in 10.6
-[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