• 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: NSImageView Will Not Alias Images
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImageView Will Not Alias Images


  • Subject: Re: NSImageView Will Not Alias Images
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 6 Apr 2010 14:58:32 -0700


On Apr 6, 2010, at 1:17 PM, Chris Tracewell wrote:

I am trying to get NSImageView to alias dropped images, but it refuses.

Nitpick: you mean "antialias". Aliasing is what creates the jaggies, antialiasing smooths them away.


Just spent an hour looking and trying several variations to no avail. Here's what I have done in a subclass of NSImageView.

I remember having to deal with this too, years ago. It's too bad AppKit hasn't added support for this yet :(


The problem is that NSImageView internally keeps a scaled copy of the image. So the actual scaling that creates the aliasing isn't done in the drawRect: method at all.

I can't remember now how I solved this. I may hve re-implemented - drawRect: completely, i.e. added the code to draw [self image] into [self bounds] and not called super. Another possibility is to override -setImage: and keep the original image yourself in a new ivar, scale it down smoothly, and call [super setImage:] with the smooth-scaled version.

—Jens_______________________________________________

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


  • Follow-Ups:
    • Re: NSImageView Will Not Alias Images
      • From: Ken Ferry <email@hidden>
References: 
 >NSImageView Will Not Alias Images (From: Chris Tracewell <email@hidden>)

  • Prev by Date: Re: Implied use of Properties
  • Next by Date: Re: Trying to get data from the AB
  • Previous by thread: NSImageView Will Not Alias Images
  • Next by thread: Re: NSImageView Will Not Alias Images
  • Index(es):
    • Date
    • Thread