Re: NSImageView scrolling
Re: NSImageView scrolling
- Subject: Re: NSImageView scrolling
- From: Marco Binder <email@hidden>
- Date: Sun, 29 Sep 2002 15:03:27 +0200
I think the best course of action would be for you to do an image app
tutorial. There's one that meets your requirements at
http://macdevcenter.com/pub/ct/37
Choose the Working With Bitmap Images tutorial. As well as the
necessary code, you'll find all the technical details nicely >
explained.
Okay, I've almost got this working, but I'm sure I'll figure it out
now. However, the image is still anchored to bottom-left corner. I
compiled the program in the Working With Bitmap Images tutorial, and
it had the same problem. I've looked through the docs for
NSImageView, and all I see is setImageAlignment, which has no effect
for me.
Ok, I think I see why it has no effect now. setImageAlignment
specifies where in the frame the image should be located, but since
the frame is calculated to equal the size of the image, this has no
effect. So how do I center the NSImageView in the NSScrollView?
Well, your almost there... you said imageAlignment referrs to the
position of the image inside the views frame. Now what would be
neccessary to have the view positioned centered in its superview?
Right: you have to adjust the the position of the ImageView inside its
superview4s frame. There is no method doing that automagically, so you
gotta do it yourself.
Carefully read the NSView / NSScrollView docs, do some thinking and I m
sure you figure it out.
One more hint: if you choose not to resize the NSImageView to in all
cases fit its contained image, you might even get along without reading
docs... (I admit, only if the NSImageView is not bordered, otherwise
its ugly).
marco
--
|\ /| E-Mail: email@hidden WWW: www.marco-binder.de
| \/ | Telefon: 07531 / 94 19 94 Fax: 07531 / 94 19 92
| |ARCO Snail-Mail: Banater Str. 3 - 78467 Konstanz
BINDER _____________________________________________________
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.