Questions tagged [nsimageview]

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.

248 questions
39
votes
4 answers

mouseEntered and mouseExited not called in NSImageView SubClass

I created a subclass of NSImageView to capture mouseEntered and mouseExited events. But only mouseUp and mouseDown events are getting called. How to capture the mouseEntered and mouseExited events in NSImageView subclass?
Ram
  • 1,872
  • 5
  • 31
  • 54
27
votes
8 answers

NSImageView image aspect fill?

So I am used to UIImageView, and being able to set different ways of how its image is displayed in it. Like for example AspectFill mode etc... I would like to accomplish the same thing using NSImageView on a mac app. Does NSImageView work similarly…
zumzum
  • 17,984
  • 26
  • 111
  • 172
14
votes
8 answers

Mac OS Cocoa: Draw a simple pixel on a canvas

I wish I would find an answer for this. I have searched and searched and couldn't the right answer. Here is my situation: In a Mac OS Cocoa Application, I want to draw a pixel (actually a few pixels) onto a dedicated area on my application window. I…
Roman
  • 211
  • 1
  • 3
  • 6
12
votes
3 answers

NSImageView double click action

I have some NSImageView in my Mac App where the user can drag'n drop objects like .png or .pdf, to store them into User Shared Defaults, that works fine. I would now like to set an action for when user double click on these NSImageView, but it seems…
Naja
  • 311
  • 2
  • 9
10
votes
0 answers

Animated GIF in NSImageView

I'm using an NSImageView to display an animated GIF with around 80 frames, each frame being 20ms long. NSImageView can display the GIF animation right 'out of the box', but the problem is that it needs too much CPU, around 10% continuously (on my…
Victor Bogdan
  • 2,022
  • 24
  • 33
10
votes
9 answers

set image color of a template image

I have an image like this: (Rendered as a template image) I tried this code: @IBOutlet weak var imgAdd: NSImageView! imgAdd.layer?.backgroundColor = CGColor.white Which only changes the background color of course. Is there a way to change the…
Trombone0904
  • 4,132
  • 8
  • 51
  • 104
10
votes
1 answer

NSImageView won't scale image down if frame style is NSImageFrameNone

I need to display NSImageView on resizable NSWindow. The image displayed in the view should scale down if it's too big to fit image view in the widnow and it should also change its size when resizing the window. I am able to achieve correct behavior…
Darrarski
  • 3,882
  • 6
  • 37
  • 59
9
votes
2 answers

How to create a NSImageView with a rounded corner?

Currently now i want to create a round corner NSImageView,i am a newb,how to ?
NeXT5tep
  • 861
  • 1
  • 11
  • 23
9
votes
4 answers

Confused about NSImageView scaling

I'm trying to display a simple NSImageView with it's image centered without scaling it like this: Just like iOS does when you set an UIView's contentMode = UIViewContentModeCenter So I tried all NSImageScaling values, this is what I get when I…
betzerra
  • 839
  • 1
  • 8
  • 17
8
votes
4 answers

Getting bounds of an NSImage within an NSImageView

I've got an NSImageView that takes up the full extent of a window. There's no border to the image view, and its set to display in the lower left. So this means that the origin of the view matches the origin of actual image, no matter how the…
wrjohns
  • 484
  • 4
  • 14
7
votes
4 answers

Resized NSImageView not redrawing

I have a NSImageView which loads an image from the application bundle. It is setup as such: coverImage.image = [NSImage imageNamed:@"themeSignEnd.png"]; coverImage.imageScaling = NSImageScaleNone; coverImage.imageAlignment = NSImageAlignLeft; The…
0x90
  • 6,079
  • 2
  • 36
  • 55
7
votes
1 answer

NSImageView + Background Color

I have requirement like this, Have One NSIMageView and which will be changing frequently on the timer basis, On resizing, it needs to maintain the aspect ratio, so Image may not occupy the entire frame of the Image, in such case, i need to display…
Amitg2k12
  • 3,765
  • 10
  • 48
  • 97
7
votes
2 answers

How can I animate a content switch in an NSImageView?

I want to switch the image shown in an NSImageView, but I want to animate that change. I've tried various methods to do this. Hopefully one of you could suggest one that might actually work. I'm working with Cocoa for Mac.
Alexsander Akers
  • 15,967
  • 12
  • 58
  • 83
6
votes
2 answers

NSImageView rounded corners + stroke

I have subclasses NSImageView and i want to draw a border around with rounded corners. It works but i need to clip off the image corners as well. Please see my screenshot: I have created this code to draw the border/corners. -…
Rasmus Styrk
  • 1,296
  • 2
  • 20
  • 36
6
votes
1 answer

NSImageView Drag and Drop issues

I have an NSBox containing two static text fields and two NSImageView. NSBox is subclassed as myNSBox. I have registered the view/NSBox to accept appropriate drag types. So when i drag items to the static text fields, the drag-drop…
user598789
  • 329
  • 1
  • 2
  • 17
1
2 3
16 17