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
1 answer
Cocoa -- getting a simple NSImageView to work
I am confused about why this code does not display any image:
In the app delegate:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSRect rect = window.frame;
rect.origin.x = 0;
rect.origin.y = 0;
…

William Jockusch
- 26,513
- 49
- 182
- 323
1
vote
0 answers
How to embed CAShapeLayer into the image of NSImageView?
There is a custom NSImageView. I can load an image and draw rectangle using CAShapeLayer
let selectionRectangle = CAShapeLayer()
selectionRectangle.lineWidth = 1.0
selectionRectangle.fillColor = NSColor.clear.cgColor
selectionRectangle.strokeColor…

VYT
- 1,071
- 19
- 35
1
vote
2 answers
Swift OSX NSImageView Drag and Drop
I am trying to execute an action after dropping an image on a drag and drop NSImageView but it is not working. How can I control the drag and drop operations?
I have the logoFornecedorImageView that is an NSImageView outlet. My class inherits from…

GuiDupas
- 1,681
- 2
- 22
- 44
1
vote
1 answer
Get access to the Mac user account image
I want to be able to set the user account image to an NSImageView, even if the image is a custom image.
Is this possible?
This is the image I am speaking of.

Damian Van de Kauter
- 57
- 1
- 8
1
vote
1 answer
Cut square of size from NSImage and scale that to fit smaller square
Im wondering is that possible or no, and if yes, how can I reach that.
I have NSImageView of size 120x120.
I want to put an NSImage inside that,but scaled a bit different then regular way.
So, lets say I have an image of 500x800 that I want to put…

PolosatiyVjih
- 269
- 3
- 12
1
vote
1 answer
When clicked NSImageView, Application can't move
I create NSToolbar and added NSView on the NSToolbar.
NSView Included NSImageView.
When clicked NSImageView or NSView in NSToolbar, I can't moved application.
How can I move application when I clicked NSView (or NSImageView) on the NSToolbar.

kimgyver
- 11
- 2
1
vote
1 answer
NSImage release in AppleScriptObjC
I have a small AppleScriptObjC app that I use for processing photos. I need to fix a memory leak that I've discovered which seems to be caused by the photos being cached and not being released. This occurs every time I process…

Cornelius Qualley
- 721
- 5
- 10
- 19
1
vote
1 answer
Highlight NSImageView - Objective-c
Is there a way to "highlight" a NSImageView with the default highlight color of the mac? I'm simply looking for a way to tint my nsimageview so that the user can identify the object easily.
Thanks,
Kevin

lab12
- 6,400
- 21
- 68
- 106
1
vote
0 answers
NSImageView non-uniform scaling not possible with NSAffineTransform in Cocoa?
I have been browsing the Internet for two days now, and apparently I'm missing something. I am trying to achieve a skewing effect for a NSImageView. I found this question on stack overflow, which suggests that it is possible. Also, in the Apple…

Joris
- 11
- 3
1
vote
2 answers
Objective C - OS X - Issue adding NSShadow to NSImageView
I am trying to add a shadow to a NSImageView on an MAC application.
I created a custom NSImageView class "ShadowView.h" and modified the drawRect: like so:
- (void)drawRect:(NSRect)dirtyRect {
[super drawRect:dirtyRect];
NSShadow *shadow =…

Leonardo Murri
- 40
- 7
1
vote
1 answer
Mac Swift - How do I download an image and load it into a NSImageView?
I want to download an image from a URL and show it in my swift application for OSX. The solutions for iOS do not work for OSX.
I want the image to get downloaded and show it in a NSImageView.

ikhaliq15
- 143
- 1
- 12
1
vote
1 answer
Programmatically creating a NSImageView in Swift 3.0
According to the documentation here:
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSImageView_Class/
I have tried programmatically creating a NSImage view:
var thing =…

Nick Goldman
- 13
- 3
1
vote
0 answers
Testing NSImages for equality
I have multiple identically-configured NSImageView objects in an NSPanel, all with drag-and-drop mode enabled. I’d like to cross-check the contained images to flag duplicates. But when I drop a single small gif or jpeg onto two of the controls, the…

Jeff J
- 139
- 8
1
vote
2 answers
How do I change the transparency of an NSImage/NSImageView?
I have a view in the menu bar into which I'm putting some images. I want to make it 50% transparent. I've tried:
let image = NSImage(named: "bar.pdf")
let imageView = NSImageView(frame: NSRect(x: 0, y: 0, width: 3, height: 11))
imageView.wantsLayer…

pondermatic
- 6,453
- 10
- 48
- 63
1
vote
1 answer
NSImageView, copy image with CMD/CTR+C
If a NSImageView is Editable and contains an image, it is possible to copy it's content via CMD+C
In my subclass i don't want the Editable property to be YES (cause of cut, drop, etc...) i just want to support the copy, but wasn't able to figure…

Peter Lapisu
- 19,915
- 16
- 123
- 179