• 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
Re: NSImage display quality and zooming
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage display quality and zooming


  • Subject: Re: NSImage display quality and zooming
  • From: Heinrich Giesen <email@hidden>
  • Date: Wed, 28 May 2008 14:54:49 +0200


On 28.05.2008, at 03:16, also wrote:

I've created a custom NSView that displays an image and allows the
user to zoom in and out.  The view works in general, but the quality
of the image displayed is not what I expect.  When I zoom in even
slightly on a high resolution image (300 dpi, 500x500) the image is
grainy and pixelated.

this is one of the FAQ in this list. The solution is:

    image = [[NSImage alloc] initWithContentsOfURL:url];
    [image setDataRetained:YES];  // <------

The docs say:

- (void)setDataRetained:(BOOL)flag

Retention of the source image data is important if the source of the image data could change, be moved, or be deleted. Data retention is also useful if you plan to resize an image frequently; otherwise, resizing occurs on a cached copy of the image, which can lose image quality during successive scaling operations. With data retention enabled, the image is resized from the original source data.



good luck


-- Heinrich Giesen email@hidden


_______________________________________________

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: DO problems
  • Next by Date: Re: Crashes related to garbage collection?
  • Previous by thread: Re: NSImage display quality and zooming
  • Next by thread: Storing miscellaneous singleton data in CoreData app?
  • Index(es):
    • Date
    • Thread