• 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: Getting selection of IKImageView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting selection of IKImageView?


  • Subject: Re: Getting selection of IKImageView?
  • From: Jamie Phelps <email@hidden>
  • Date: Wed, 16 Apr 2008 18:13:17 -0500

On Apr 16, 2008, at 12:38 PM, Colin Cornaby wrote:

The issue is that I really need a rect. Getting the actual image of what is selected will tell me the width and height of the rect, but not the x and y.

So, you're after the origin of the rect in addition to the dimensions? Since IKImageView inherits from NSResponder, you can capture the mouse coordinates in the -mouseDown: event and then again using - mouseDragged:. Off the cuff, you'll then need to set the origin to the minimum x value and minimum y value of the two points and set the size to the max x-min x and max y-min y. (There's a good example of this in Hillegass, Cocoa Programming for Mac OS X, 2nd ed if you have it handy.)


All that being said, I have to ask what functionality you are using from IKImageView that you couldn't get from NSImageView? The above would apply to NSImageView, too, but you wouldn't be including all the IK goodness of IKImageView such as editing and NSImageView is supported on more than just Leopard. Just a thought.

HTH
Jamie
_______________________________________________

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: 
 >Getting selection of IKImageView? (From: Colin Cornaby <email@hidden>)

  • Prev by Date: Re: binary search trees & binning
  • Next by Date: Re: Drawing a 1 pixel-perfect wide bordered NSBezierPath
  • Previous by thread: Re: Getting selection of IKImageView?
  • Next by thread: Resizing NSView with CABasicAnimation
  • Index(es):
    • Date
    • Thread