Boris
Boris

Reputation: 8951

Displaying an image in a Mac App

Is there a control in Interface Builder (XCode 4) that can display an image? I'd like to show a preview-thumbnail in that control during runtime.

Upvotes: 0

Views: 128

Answers (1)

Michael Dautermann
Michael Dautermann

Reputation: 89559

Phillip (whose answer is now deleted) had the right approach. It sounds like what you are looking for is an image well (and the actual class name for this is NSImageView).

Now, if you want to have an actual control (e.g. a button or something else) with an image within it, that's a little bit different. A NSButton dropped into some UI via Interface Builder can take an image, but you'd need to scale the button to be the appropriate size for the scaled down image and to assign the image, you must do it programatically via code (i.e. set the button to an outlet and then set the image that way).

Upvotes: 2

Related Questions