FROM : daniel
DATE : Sat Oct 30 20:02:48 2004
I think you need to do the math yourself. The only "safely"
predictable NSImageView is the one with no borders, no bezel, etc. If
you use this one, the image should take up the entire frame of the
view, so you can just compare the image dimensions with the view
dimension to get an X and Y scale value. If you're using an
NSImageView with borders, then you'll have to take into consideration
the amount of space taken up by the border. Since this can probably
change in a future release, I wouldn't want to depend on any guesses
made regarding that.
Daniel
On Oct 30, 2004, at 10:06 AM, Paul Sargent wrote:
> Hi,
>
> I'm wanting to display an image and then add annotations on top of the
> image. An example might be a selection marquee in a photo editing
> program (not exactly what I'm doing but it gives an idea). My idea was
> to subclass an NSImageView, and then in drawRect call [super drawRect]
> first and then do some CG* calls to add my annotations.
>
> My problem is that NSImageView will scale the image depending on how
> big the view is. How do I know what scaling NSImageView has decided
> upon so that I can draw my annotations at the same scale?
>
> Thanks
>
> Paul
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>-
> sweater.com
>
> This email sent to <email_removed>
DATE : Sat Oct 30 20:02:48 2004
I think you need to do the math yourself. The only "safely"
predictable NSImageView is the one with no borders, no bezel, etc. If
you use this one, the image should take up the entire frame of the
view, so you can just compare the image dimensions with the view
dimension to get an X and Y scale value. If you're using an
NSImageView with borders, then you'll have to take into consideration
the amount of space taken up by the border. Since this can probably
change in a future release, I wouldn't want to depend on any guesses
made regarding that.
Daniel
On Oct 30, 2004, at 10:06 AM, Paul Sargent wrote:
> Hi,
>
> I'm wanting to display an image and then add annotations on top of the
> image. An example might be a selection marquee in a photo editing
> program (not exactly what I'm doing but it gives an idea). My idea was
> to subclass an NSImageView, and then in drawRect call [super drawRect]
> first and then do some CG* calls to add my annotations.
>
> My problem is that NSImageView will scale the image depending on how
> big the view is. How do I know what scaling NSImageView has decided
> upon so that I can draw my annotations at the same scale?
>
> Thanks
>
> Paul
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>-
> sweater.com
>
> This email sent to <email_removed>
| Related mails | Author | Date |
|---|---|---|
| Paul Sargent | Oct 30, 19:06 | |
| daniel | Oct 30, 20:02 |






Cocoa mail archive

