• 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: How to scroll images with NSImageView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to scroll images with NSImageView


  • Subject: Re: How to scroll images with NSImageView
  • From: Graham Cox <email@hidden>
  • Date: Wed, 14 Jul 2010 09:26:34 +1000

On 13/07/2010, at 9:43 PM, Vincenzo Morgante wrote:

> Hi,I'm a newbie and I should create a window with an image ("resource.png") from resource folder of my XCode project. I realized that I should use NSImageView and embed it in a scroll view, but the image is not entirely showed because too large: why are the scrollers not shown?

NSImageView is not for this - it is used to display icons and so on where the image is scaled to fit the view, the view does not expand to fit the image.

You can accomplish this easily in a few lines of code with  a subclass of NSView. Set the size of the view to the image size and draw the image in -drawRect:, if you put it in a scrollview it will scroll as you expect.


--Graham


_______________________________________________

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

References: 
 >How to scroll images with NSImageView (From: Vincenzo Morgante <email@hidden>)

  • Prev by Date: Re: Compiler bug?
  • Next by Date: Re: NSTextView becomes temporarily unresponsive
  • Previous by thread: How to scroll images with NSImageView
  • Next by thread: find out all domains in network
  • Index(es):
    • Date
    • Thread