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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to