on Mac OS X, an NSImage object is a high-level class for manipulating image data
Questions tagged [nsimage]
681 questions
2
votes
1 answer
Use of AppKit image template constant yields null
The documentation for NSImage lists a lot of standard images that should be readily available using +[NSImage imageNamed:]. They are listed in the NSImage class reference.
I keep getting (null) when I try to load the following, however, and that…

pickwick
- 3,134
- 22
- 30
2
votes
2 answers
How do I map and store images using Core Data and RestKit?
Using images with Core Data isn't a problem. There are a lot of examples out there on how to do that like: How should I store UIImages within my Core Data database?
I want to know how to use RestKit to download images and map them correctly to Core…

Steve Moser
- 7,647
- 5
- 55
- 94
2
votes
1 answer
NSView with NSImage inside of it -- how come NSImage doesn't move with the view which is its parent?
I am writing a simple MacRuby app. I have an NSView that draws an image inside of itself when its drawRect() is called.
Inside that NSView subclass my drawRect() has (among some other lines of code)
image =…

briangonzalez
- 1,606
- 16
- 21
2
votes
1 answer
How to create a border around an NSImage CIFilter ObjC
I'm trying to create a stoke border around a PNG with transparent background in an NSImage.
I originally tried duplicating the image and having a larger scale and then using CIFilter to make it white - this works great for shapes like circles and…

GeraldTheGerm
- 63
- 6
2
votes
1 answer
NSImage mouse events
I have a number of NSImages that I'm rendering in a custom NSView subclass. I'm looking to enlarge theses images as and when the user places their mouse over them and am wondering about the best way to go about doing this.
Currently I'm using the…

ndg
- 2,585
- 2
- 33
- 58
2
votes
2 answers
How to write an OS X application that can effect changes (custom cursor, draw an image) even when it is not active?
I previously asked a question about changing the cursor system-wide on OSX. I used NSCursor to change the cursor, but the effects are only as long as the application is active. When another application becomes active, the custom cursor is lost.…

AJJ
- 105
- 1
- 2
- 5
2
votes
2 answers
How can you turn a macOS SwiftUI view into an Image?
I know that you can turn an iOS SwiftUI View into an image by following these steps, but this uses UIKit things in the SwiftUI extension which you cannot use in SwiftUI for macOS.
Does anyone know how to snapshot/screenshot a macOS SwiftUI View?

WilliamD47
- 129
- 6
2
votes
1 answer
NSImage + memory managament
NSImage *randomImage = [[NSImage alloc] initWithContentsOfURL:imageURL];
[randomImage release];
Why does the memory usage still go up? What is using that memory? I release the NSImage object. ( no, its not the URL )

Antwan van Houdt
- 6,989
- 1
- 29
- 52
2
votes
1 answer
Should NSMutableParagraphStyle.paragraphSpacingBefore add space before paragraphs?
Note: It appears that as of macOS Big Sur/11.6.4, this bug has been fixed. The test script now produces the second image instead of the third image when using paragraphSpacingBefore.
I’m writing a command-line script on macOS that creates an image…

Jerry Stratton
- 3,287
- 1
- 22
- 30
2
votes
2 answers
NSImage size problem
I'm using the same image resource in two different controllers. In both controllers the image is shown in different sizes, the problem is that once the image is shown in a smaller size than the original, the next time I get the image by [NSImage…

mikywan
- 1,495
- 1
- 19
- 38
2
votes
1 answer
Getting the displayed image out of an NSImageCell
I have an NSImageCell table column whose valuePath is bound to a path supplied by my object through an NSArrayController.
My NSTableViewDelegate implements the -tableView:heightOfRow: method, in order to have variable row height. I need to calculate…

Dov
- 15,530
- 13
- 76
- 177
2
votes
2 answers
HUD Buttons using Template Images
I'm building a semi-transparent floating HUD window in my application, which is intended to look like the Quick Look HUD window, specifically using the Enter/Exit full screen image. Cocoa provides the NSEnterFullScreenTemplate (and…

Dov
- 15,530
- 13
- 76
- 177
2
votes
1 answer
Precise pixel grid overlay in Core Graphics?
In my experiments with creating a pixel-centered image editor I've been trying to draw a precise grid overlay to help guide users when trying to access certain pixels. However, the grid I draw isn't very even, especially at smaller sizes. It's a…

Jon Shier
- 12,200
- 3
- 35
- 37
2
votes
1 answer
Converting NSImage to IplImage
I have two problems converting my image (only jpeg-files) from NSImage to IplImage. My first problem is that the converted image has not the same colour intensity like the original one. The converted image is somehow more toneless than the original…

p.goe
- 61
- 3
2
votes
1 answer
How to create a custom file type that holds text and images?
I know this is going to be somewhat hard to answer, but I need to save text and images into a single file (like photoshop does). Should I make a custom file type, or is there another way to do this?
If I need a custom file type, would somebody…

Justin
- 2,122
- 3
- 27
- 47