The following line of code displays an image on my application window, within an NSImageView control named outputImageView. I used Interface Builder to put the NSImageView control onto the window, initially (then bound it to outputImageView). How do I change the size of the NSImageView control within my program, so that it matches the size of the actual image I am displaying (which may change, periodically)? And what if I wanted to change the anchor point for the image (i.e., centered, left edge, bottom right, or whatever? Thanks in advance!
[outputImageView setImage: outputImage];
Like any other NSView, use
-setFrame::The coordinates are specified in the system of the containing view.
If you need to change only the size (leaving the origin alone), you can use
-setFrameSize::For alignment, use NSImageView’s
-setImageAlignment:, as jshier wrote.