Blurry view from cacheDispalyInRect:toBitmapImageRep:
Blurry view from cacheDispalyInRect:toBitmapImageRep:
- Subject: Blurry view from cacheDispalyInRect:toBitmapImageRep:
- From: Greg Hoover <email@hidden>
- Date: Tue, 28 Aug 2007 16:11:38 -0700
I have a WebView I'm trying to print with page numbers. I call the
NSPrintOperation with a temporary view which implements the
drawPageBorderWithSize. To move my target view into this custom view
I've subclassed NSImageView in the following way:
- (id)initWithView:(NSView *)view {
self = [super initWithFrame: [view frame]];
if (self) {
[self setImageAlignment: NSImageAlignTopLeft];
[self setImageFrameStyle: NSImageFrameNone];
[self setImageScaling: NSScaleNone];
NSBitmapImageRep *imageRep = [view
bitmapImageRepForCachingDisplayInRect: [view frame]];
[view cacheDisplayInRect: [view frame]
toBitmapImageRep: imageRep];
NSImage *image = [[[NSImage alloc] initWithSize: [view frame].size]
autorelease];
[image addRepresentation: imageRep];
[self setImage: image];
}
return self;
}
The resulting view is exactly what I want, except that the original
view contents are blurry (the header / footer text looks great
though). I found a mention to drawing alignment and the integer axis
since Tiger draws with fractional offsets, but since I'm using the
cacheDispalyInRect:toBitmapImageRep: method, I'm not sure how to test
that hypothesis.
Any help would be much appreciated.
Greg
_______________________________________________
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