• 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: Question about NSImage and NSImageView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about NSImage and NSImageView


  • Subject: Re: Question about NSImage and NSImageView
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Tue, 16 Nov 2004 14:49:54 +0100

At 22:02 Uhr -0500 15.11.2004, Joe Chan wrote:
- What is the correct way for me to display the image in some arbitrary dimension? Use [NSImageView setFrame:] and let NSImage fill the frame, or use [NSImageRep setSize:] to change the size of the image? And why doesn't the first method work when it's in a NSScrollView?

I think your NSImageView is set to scale the image. When you change the size of an NSImageRep, it's basically the equivalent of creating a PICT at a particular size (i.e. OpenPicture(imageRepRect)). When you resize the NSImageView, depending on what you've set it up to, it will be equivalent to calling DrawPicture() with a rect other than the NSImageRep's rect.


 So, set the image view to not scale, and your image will be clipped.

- Is NSImageRep roughly equal to a GWorld in the good old days? For example, can I change the interpolation and anti-alias setting and create a new NSImageRep at new dimensions, and stick the new one into the same NSImage?

NSImage and the various NSImageRep's together are usually used where Carbon would have used an offscreen GWorld. However, an NSImageRep has different semantics. An NSImageRep also includes functionality that QuickTime Graphics Importers did in Carbon (i.e. encapsulate various image formats without converting them to pixels until they're actually drawn -- there's an NSPDFImageRep, NSPICTImageRep etc.), and is used for cacheing different sizes of an image to provide faster drawing.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Question about NSImage and NSImageView
      • From: Joe Chan <email@hidden>
References: 
 >Question about NSImage and NSImageView (From: Joe Chan <email@hidden>)

  • Prev by Date: Re: A framework for parsing HTML?
  • Next by Date: Re: Issues with sleep();
  • Previous by thread: Question about NSImage and NSImageView
  • Next by thread: Re: Question about NSImage and NSImageView
  • Index(es):
    • Date
    • Thread