• 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 and ZoomFactors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImageView and ZoomFactors


  • Subject: Re: NSImageView and ZoomFactors
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 19 Aug 2010 11:33:15 -0700

On Aug 19, 2010, at 11:12, Brian Postow wrote:

> Ok, the NSScrollView came with an NSView in it. I changed that to NSClipView, and added an NSImageView in the clipview.

Er, no. The NSScrollView came with a NSClipView and a NSView, but IB helpfully hides the NSClipView. So you don't need to add one -- just change the NSView to an NSImageView and you're done.

> How big do I make the imageview? Currently, it's the same size as the clipview.

It doesn't matter what you do in IB, because you're going to have to do something else programmatically later. You basically have 2 modes: zoom to fit, and zoom to scale factor, and there's a difference image view size calculation for each so it must be done manually. Consequently, you probably want to prevent (in IB) the image view from autoresizing.

> The way I'm testing is by zooming in on the image with: [imageView scaleUnitSquareToSize: NSMakeSize(zoomFactor, zoomFactor)]
>
>
> Also When I do zoom to fit with 	[imageView setImageScaling: NSScaleToFit]; it zooms BOTH dimensions. Normally you want to zoom to the smaller dimension, but keeping the same aspect ratio. is there an easy way to do this?

Well, you want NSScaleProportionally instead of NSScaleToFit, except that both are deprecated in 10.6, so you *really* want NSImageScaleProportionallyUpOrDown.


_______________________________________________

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 and ZoomFactors
      • From: Brian Postow <email@hidden>
References: 
 >NSImageView and ZoomFactors (From: Brian Postow <email@hidden>)
 >Re: NSImageView and ZoomFactors (From: Quincey Morris <email@hidden>)
 >Re: NSImageView and ZoomFactors (From: Brian Postow <email@hidden>)
 >Re: NSImageView and ZoomFactors (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: NSImageView and ZoomFactors
  • Next by Date: Re: iphone large image downloading
  • Previous by thread: Re: NSImageView and ZoomFactors
  • Next by thread: Re: NSImageView and ZoomFactors
  • Index(es):
    • Date
    • Thread