Text rendered in NSImage is fuzzy
Text rendered in NSImage is fuzzy
- Subject: Text rendered in NSImage is fuzzy
- From: Dave Fernandes <email@hidden>
- Date: Sun, 27 Jun 2010 16:12:00 -0400
I'm trying to render text in System font in an NSImage as shown below. The NSImage is displayed *unscaled* in an NSImageView. However, the text does not look as good as when rendered in an NSView. Is there any way to get crisp clean text in an NSImage?
Thanks,
Dave
// Render an image into a cell of given size (edited in Mail!).
- (void)renderForCellSize:(NSSize)cellSize
{
[image release];
image = [[NSImage alloc] initWithSize:cellSize];
// Draw the image...
[image lockFocus];
[NSGraphicsContext saveGraphicsState];
[chart draw];
[NSGraphicsContext restoreGraphicsState];
[image unlockFocus];
}
The chart does some drawing such as, for example:
NSString* label = @"some text";
[label drawAtPoint:location withAttributes:labelAttributes];_______________________________________________
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