Is there an easy way of determining where the user has clicked in an image 
displayed in an NSImageView? This strikes me as a reasonable thing to want to 
do, but I can't work out how.

When I get the mouseDown event in my NSImageView subclass, I can call:
        thisMousePoint = [self convertPoint:thisMousePoint fromView:[[theEvent 
window] contentView]];
to get the mouse down in NSImageView pixel coordinates. However this may well 
not be the same as the NSImage coordinates - e.g. if the view is set to 
preserve aspect ratio and the image and view aspect ratios do not match.

Is there a neat way of converting to the "effective coordinate system" of the 
NSImage as displayed in the NSImageView? Ultimately, I want to work out which 
pixel of a bitmap image the user has clicked on. I could do this conversion 
myself, but it would require quite a lot of checking of exactly what settings 
the NSImageView was using, so this seems to me like something the framework 
should be able to do for me...

Thanks in advance
Jonny

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to