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
0
votes
1 answer

Change bounds origin + cropping an image

I am a newbie to Cocoa, I have a few doubts regarding NSImage. Question1: Changing the bounds origin of an image doesn't seem to have any effect. I expected the image to be drawn from the newly set origin but that doesn't seem to the case. Am I…
user1046037
  • 16,755
  • 12
  • 92
  • 138
0
votes
1 answer

Cocoa/ObjC: high memory usage on loading a lot of images when GC enabled?

I coded a simple picture viewer which just slides randomly through pictures in ~/Pictures. For each new transition, I am creating and loading the NSImage, then create a new NSImageView and set it as a new subview and the old subview is removed. This…
Albert
  • 65,406
  • 61
  • 242
  • 386
0
votes
2 answers

Blurry NSImageView

I have an NSImageView in a view that utilizes Core Animation. Prior to using Core Animation the image looks fine but now its blurry and low quality. If I let NSImageView have a bezel border the issue goes away but I need it to have no border. Had…
nosedive25
  • 2,477
  • 5
  • 30
  • 45
0
votes
1 answer

iPhoto-like cropping of an image?

I've been struggling over this for several days now and can't crack it. How do I achieve that neat photo cropping you see in iPhoto? I tried using an NSImageView with a semi transparent CALayer allowing me to draw the cropping tool, but that doesn't…
Roger
  • 4,737
  • 4
  • 43
  • 68
0
votes
1 answer

Core Animation doesn't work. Object disappears

[animationImageView setWantsLayer:YES]; CAKeyframeAnimation *keyframeAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; keyframeAnimation.values = [animationsBindingsController…
user986581
  • 37
  • 4
0
votes
0 answers

How can I adjust the speed of an NSImageView animation?

I'm using the NSImageView.animates property to play a GIF in SwiftUI as follows: struct GIFView: NSViewRepresentable { var gifName: String func updateNSView(_ nsView: NSView, context: NSViewRepresentableContext) { } func…
moriarty
  • 41
  • 5
0
votes
0 answers

NsImageView constraints with text view

I used NSImageView with a text view near to it. The text view was having leading constraint to the image view, moreover when I hide the image the constraint it seems to be as it is, but when I embedded the image view inside a custom view and hided…
0
votes
0 answers

User selected NSImage reload after app relaunch in Objective C for macOS

I am making a small project where a user can select an image and change it with filters. I've got it working how I want, however I want all the user selected settings to return on relauch of the app. I've got all the filter settings to remain using…
0
votes
1 answer

Unable to set image in NSImageView subclass

I have a very basic NSImageView Sub Class, and adding it via a Custom View item in the Interface Builder from XCode: class DropView:NSImageView { required init?(coder: NSCoder) { super.init(coder: coder) print("init") -->…
Laurent Crivello
  • 3,809
  • 6
  • 45
  • 89
0
votes
1 answer

How to make dataWithEPSInsideRect vector rather than bitmap in vector format?

Hello i'm trying to export data from an NSImageView as an EPS vector however the export doesn't appear to be vector but more like a bitmap in EPS format. Can anyone suggest where I am going wrong and how I can make it vector? s = [[graphicImage…
0
votes
0 answers

NSImage does not Change for Light/Dark Appearances

I am developing a Mac Cocoa app. And I have a set of images to adopt for both light and dark modes. I followed the instructions here: https://developer.apple.com/documentation/uikit/uiimage/providing_images_for_different_appearances In…
Wendell
  • 474
  • 3
  • 12
0
votes
0 answers

Problem to save to pdf file a NSView with rotated NSImageView as subview - NSImageView is not rotated

I have NSView and I am adding programatically a NSImageView (or NSTextField) as a subview. Then I do rotation of this subview by setting the angle for frameCenterRotation. The image of NSImageView is rotated. myNSImageView.frameCenterRotation =…
VYT
  • 1,071
  • 19
  • 35
0
votes
1 answer

How do you adjust an image's size to NSImageView programmatically?

I have been trying to adjust an image's size in NSImageView programmatically. There doesn't seem to be any way to do so. The image ends up being quite large and there is no way to adjust it. I want to adjust it to a 40 (width) by 40 (height). Here…
Jazil Zaim
  • 335
  • 1
  • 3
  • 10
0
votes
2 answers

Using Interface Builder's System Media files in code

I have a question regarding the several images and sound files in the Media tab of IB's library: how can they be used in code? I want change the image of a NSImageVew to NSRevealFreestandingTemplate, but how can I access it? I'm pretty sure there…
Kevin Chavez
  • 949
  • 1
  • 11
  • 27
0
votes
1 answer

Image and button in NSImageView are in wrong positions

I am assigning a button and an image to the same position (0, 0), but they are drawn in different locations. Why does this happen? Here is my code: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to…
user718408
  • 101
  • 1
  • 14