• 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 drawing the NSImage...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImageView drawing the NSImage...


  • Subject: Re: NSImageView drawing the NSImage...
  • From: Allan Dushan <email@hidden>
  • Date: Thu, 11 Mar 2004 17:42:59 -0800

John,

Thanks again. This is starting to work out a lot easier then I thought it would be.

As long as your train of thought is on this subject, the last thing I realized I need to know is where to start drawing, once I have the size of the image being drawn in the NSImageView. I know I can compute a starting point once I have the size of the image drawn and the frame of the NSImageView, but is there a way to get the origin of where the image was drawn in the view? My end goal is to be able to draw lines around the image that was drawn in the view.

Allan


On Mar 11, 2004, at 5:29 PM, John Randolph wrote:

Oh, wait a sec.. I just remembered that NSImageView will make its own cached image, which you can get to by looking at its cell's _scaledImage ivar..

-jcr

On Mar 11, 2004, at 4:31 PM, Allan Dushan wrote:

John,

Thank you for the help. This appears to be exactly what I need, but I am not sure how to get an NSCachedImageRep.

Do I call NSImage's -representations method to retrieve an array of NSImageReps, and then enumerate through the NSImageRep's until I find one that is of the class NSCachedImageRep and ask for its -size? Or, do I get the first NSImageRep in the array and ask for it's -size?

Thanks,

Allan


On Mar 11, 2004, at 2:38 PM, John Randolph wrote:


On Mar 11, 2004, at 12:49 PM, Allan Dushan wrote:

Does anyone know how to retrieve the size of the NSImage AFTER it has been scaled proportionally and drawn in the NSImageView?

You can look through the image reps in the NSImage, and ask for their size. You probably want the first NSCachedImageRep that you come across.

-jcr

John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: NSImageView drawing the NSImage...
      • From: John Randolph <email@hidden>
References: 
 >NSImageView drawing the NSImage... (From: Allan Dushan <email@hidden>)
 >Re: NSImageView drawing the NSImage... (From: John Randolph <email@hidden>)
 >Re: NSImageView drawing the NSImage... (From: Allan Dushan <email@hidden>)
 >Re: NSImageView drawing the NSImage... (From: John Randolph <email@hidden>)

  • Prev by Date: Re: NSImageView drawing the NSImage...
  • Next by Date: Re: creating files to write data to?
  • Previous by thread: Re: NSImageView drawing the NSImage...
  • Next by thread: Re: NSImageView drawing the NSImage...
  • Index(es):
    • Date
    • Thread