• 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: Custom NSImageView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom NSImageView


  • Subject: Re: Custom NSImageView
  • From: Robert Walker <email@hidden>
  • Date: Fri, 30 Dec 2005 01:34:38 -0500

Lee,

Thanks for your quick response. I've looked at core image, which is really great. It's a bit overkill for my needs. I'm basically just viewing faxed TIFF images from our document imaging server. I was just using NSAffineTransform to do the zooming, which seemed to work okay.

My problem is actually with the mechanics of adding the listed features to my custom image view. By default NSImageView draws it's content from the lower left corner (or I guess upper left if it is flipped). I don't know of any built-in support for zooming using a selection rectangle and positioning the transformed image properly in the view, switching from pan mode to zoom mode, etc. I am also having trouble figuring out how to fix the coordinate system so that it's possible to zoom a previously zoomed image. My selection marker seems to want to select the transformed image using the original image's coordinate system (which just doesn't work).

On Dec 30, 2005, at 1:09 AM, Lee Morgan wrote:

Well, assuming your target is Tiger or newer....
This seems a prime candidate for Core Image (http:// developer.apple.com/macosx/coreimage.html)

With Core Image you should only have to worry about setting it up - like mapping functions to key / mouse combinations.
Scaling, rotation, cropping, and a ton of others you get "for free."

"Do not worry about your difficulties in Mathematics. I can assure you mine are still greater."
- Albert Einstein


On Dec 30, 2005, at 12:48 AM, Robert Walker wrote:

I have been attempting to create an NSImageView subclass with the following custom features:

1: Magnifying Glass zoom mode
Ability to zoom using a "magnifying glass" style tool. Tool should work similar to Photoshop.
a) Click to zoom at a point using a fixed scale value (Option- click to zoom out).
b) Zoom by dragging a selection window. Zoom to fit view on mouse up event.

2: Hand Tool pan mode
Ability to drag the image's within the view using a mouse drag.

3: Rotation
Ability to rotate the image within the view.
a) 90 deg. rotation is required.
b) Free rotation is a plus.

4: Keyboard control of zoom and pan
Ability to perform basic zoom and pan using keyboard shortcuts. I have a pretty decent grasp of this and
can add the feature myself if necessary.

5: Mouse cursors
It would also be great to have the mouse cursor change depending on the selected tool (Magnifying Glass or Hand icons)

I realize that this must seem pretty basic, but I'm just getting started with Cocoa and would like to move this project along. I had hoped to have the time to figure all this stuff out myself, but I'd really like to get going with some of the more interesting features of my application. This has been bogging me down.

I'm sure that someone out there has already built exactly what I need, so if you're willing to share your class, or direct me on how to build what I need, I would appreciate it.

_______________________________________________
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: Custom NSImageView
      • From: Scott Anguish <email@hidden>
References: 
 >Custom NSImageView (From: Robert Walker <email@hidden>)
 >Re: Custom NSImageView (From: Lee Morgan <email@hidden>)

  • Prev by Date: Re: Custom NSImageView
  • Next by Date: Re: Custom NSImageView
  • Previous by thread: Re: Custom NSImageView
  • Next by thread: Re: Custom NSImageView
  • Index(es):
    • Date
    • Thread