Re: NSTableView and NSImageCell
Re: NSTableView and NSImageCell
- Subject: Re: NSTableView and NSImageCell
- From: David Dauer <email@hidden>
- Date: Mon, 12 Apr 2004 16:27:44 +0200
Hi again,
The code wasn't really the problem... The problem was the table view does
not simply draws the image, but it uses "- (NSImageRep
*)bestRepresentationForDevice:(NSDictionary *)deviceDescription;"
When I draw in my image, it seems i've got two representations, but the
tableview fetches only the original one. So I did:
- (NSImage *)applyBadge:(NSImage *)badge withAlpha:(float)alpha
{
NSImage *new = [[self copy] autorelease];
[new lockFocus];
[[NSGraphicsContext currentContext] setImageInterpolation:
NSImageInterpolationHigh];
[badge compositeToPoint:NSMakePoint([self size].width - [badgeImage
size].width, 0)
operation:NSCompositeSourceOver
fraction:alpha];
[new unlockFocus];
return [[[NSImage alloc] initWithData: [new TIFFRepresentation]]
autorelease];
}
Greetings
David
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.