• 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
Scaling images and coordinate transformations.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scaling images and coordinate transformations.


  • Subject: Scaling images and coordinate transformations.
  • From: Kyle Mandli <email@hidden>
  • Date: Tue, 26 Jun 2001 14:55:28 -0500

I have an app that scales images to fit inside my implementation of NSView. It uses the NSImage drawRect call to write the image into the space which can resize to whatever the user wants. This works fine but I also need to implement a zoom in feature that will zoom in centered on the spot that the user clicks on in the scaled image. My question then is what is the easiest way to create a transformation for the coordinates so that I can transform where the user clicks in the NSView to the coordinates of the original image so I can crop and zoom in using drawRect again. My intuition says to just create a transformation between the current bounds of the view and the size of the image but it seems like there should be an easier way to do this. If someone could either point me in the direction of something in the API or a better suggestion I would appreciate it. Thanks in advance.

Kyle

It will be done tomorrow...

**********************
email@hidden
**********************


  • Prev by Date: Re: Cocoa Template Type
  • Next by Date: ZoomRects in Cocoa?
  • Previous by thread: Re: Reading plists
  • Next by thread: ZoomRects in Cocoa?
  • Index(es):
    • Date
    • Thread