An NSImageView object displays a single image from an NSImage object in a frame. An editable image view object behaves as an image well and supports copying, pasting, dragging, and using the Delete key to clear its content.
Questions tagged [nsimageview]
248 questions
1
vote
0 answers
Creating thumbnails using NSImageView and a custom NSView
I need to do the following in my cocoa app (OS X):
Allow the user to drop an image on an NSImageView.
Once the image is dropped project a fixed size rectangle over the image, indicating the area of the image that will be used as a thumbnail.
Allow…

Roger
- 4,737
- 4
- 43
- 68
1
vote
1 answer
NSImageView change event handler
I'd like to catch event of image changing in my NSImageView, how can I do it?

Ilya Blokh
- 11,923
- 11
- 52
- 84
1
vote
1 answer
cocoa binding on NSImageView in a NSTableView's column not update automatically
In my cocoa app there is a NSTableView(10.7 lion view based tableview) only contains one column, the cell in it is a custom NSTableCellView, in it there are several views and one of them is a NSImageView.
My data model has an integer status…

kcome
- 1,166
- 9
- 22
1
vote
0 answers
128 x 128 NSImage looks bad in a 32 x 32 NSImageView
I'm trying to present this example image inside a NSImageView:
The image size is 128x128 and the NSImageView is 32x32.
I've created a new macOS project and placed that image inside NSImageView. The default settings gave me the blurry image below.…

JustMe
- 63
- 5
1
vote
2 answers
mouseDown not detected for my NSImageView
I've been searching for answers to this question and while I have done the steps I still cannot seem to get the mouseDown method to be called.
What I want is when the user clicks and holds down on the image, it should print out "Mouse…

Moonlight293
- 197
- 1
- 5
- 13
1
vote
1 answer
Subclassing NSImageView with the binding ability
I'm trying to animate the image change in NSImageView. It is a purely academic problem, and I'm staying within the restrictions of a macOS binding framework.
Please, consider the model:
class Model: NSObject {
/// Image object for the…

Ruben Kazumov
- 3,803
- 2
- 26
- 39
1
vote
0 answers
Swift NSImageView page-turn effect
In macOS (not iOS) I am trying to get a page-turn effect to transition between two images. So far I have this:
// given NSImageView named imageView
let animation = CABasicAnimation(keyPath: "transform")
let startingPoint =…

HenryRootTwo
- 2,572
- 1
- 27
- 27
1
vote
0 answers
How to pre-cache NSImage for displaying inside NSImageView
I have a rather large image, which I display inside NSImageView. Once I do it the first time, every next usage of said image is very fast. Either when re-using the NSImageView it was assigned to or assigning it to a new NSImageView. This is…

silverdr
- 1,978
- 2
- 22
- 27
1
vote
0 answers
How to detect when user drops an image on a NSImageView with code?
I'm trying to detect when a user drops an image on an NSImageView instantiated by code, not as an Outlet.
The idea is that when the image is released an action occurs. How could I do this with code?
let imageHolder = NSImageView(frame: NSRect(x: 0,…

Chema Juárez
- 11
- 4
1
vote
1 answer
Display Image View in Table View conditionally in Swift
I'm trying to display an image in a table view cell view on the condition of a Boolean value.
The Boolean is a representation of the state of an object of the class "Book" where the objects are initialized:
class Book: NSObject, Codable {
@objc…

P. A. Monsaille
- 152
- 1
- 1
- 10
1
vote
3 answers
Can not load NSImageView image from file with NSImage(byReferencingFile: )
When I want to set a image from my disc (/Users/me/Desktop/image.png) to the image of my NSImageView with NSImage(byReferencingFile: ) it does not show it.
When I try NSImage(named: ) with an image stored in the assets-folder, it works.
The code…

Jozott
- 2,367
- 2
- 14
- 28
1
vote
0 answers
Image File Copy/Paste with NSImageView
I'm using an NSImageView that is setup as an image well so users can add their own images. An image can be added to the NSImageView with drag and drop or copying and pasting the actual image, but does not work properly if the image file is copied in…
user4991637
1
vote
3 answers
Transparent NSImageView falls behind NSView
I have a transparent .png image that lays over an NSView and it should look like this:
However, sometimes, with no rhyme or reason or indication that it is going to do this, the NSImageView falls behind the NSView:
I am not sure how to keep the…

WrightsCS
- 50,551
- 22
- 134
- 186
1
vote
1 answer
macOS - Programmatically display an image using NSImageView
Using a Swift app targeting the macOS platform, I am trying to programmatically create an NSImageView object, assign an image to it, and then display it, using:
let imageViewObject = NSImageView();
let img = NSImage(cgImage: winCGImage, size:…

Anshuman Singh
- 13
- 3
1
vote
2 answers
Rotating NSImageView cause the NSImageView to scale
I am using the following code to rotate a NSImageView (actually three stacked on top of each other) the rotation works fine, but the image scales up and down when it rotates. why? and how can i fix it?
-…

Kristian Flatheim Jensen
- 898
- 8
- 13