• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Blurry view from cacheDispalyInRect:toBitmapImageRep:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: NSOutlineView change a textfield for an NSButton (switch)
  • Next by Date: NSView scaling
  • Previous by thread: Re: NSTask setStandardOutput: then stringWithContentsOfFile
  • Next by thread: NSView scaling
  • Index(es):
    • Date
    • Thread