on Mac OS X, an NSImage object is a high-level class for manipulating image data
Questions tagged [nsimage]
644 questions
9
votes
1 answer
Display image in a cocoa status app
Hi I developed a cocoa status app. when I put a long title for example , it can't be shown and if i put an image as icon too it can't be shown , but if i put a small title it works correctly.
How can I fix this problem and make the image…
![](../../users/profiles/1503496.webp)
user1503496
- 191
- 4
- 11
8
votes
2 answers
Trying to turn [NSImage imageNamed:NSImageNameUser] into NSData
If I create an NSImage via something like:
NSImage *icon = [NSImage imageNamed:NSImageNameUser];
it only has one representation, a NSCoreUIImageRep which seems to be a private class.
I'd like to archive this image as an NSData but if I ask for the…
![](../../users/profiles/69771.webp)
zorn
- 438
- 5
- 15
8
votes
3 answers
Repeating background image in an NSView
I am trying to draw a repeating background image in my NSView, I have this till now:
// INIT
- (id)initWithFrame:(NSRect)frame {
if (self = [super initWithFrame:frame]) {
self.backgroundImage = [NSImage imageNamed:@"progressBackground.pdf"];
…
user142019
8
votes
2 answers
How to read PNG image to NSImage
how can i read PNG image to NSImage. I tried the following way,but when i get the width and size of the image i'm getting some weird value.. if any one can direct me in right path.. highly appropriate..
NSImage * picture = [[NSImage alloc]…
![](../../users/profiles/322111.webp)
Sam
- 5,427
- 7
- 64
- 78
8
votes
1 answer
NSImage has opacity when used with NSValueTransformer
I am trying to show an NSImage depending on a enum value from out of Core Data.
I am using a Value Transformer on an NSImageCell bound to the value on which I
choose the image to show.
It works perfectly and as intented, unfortunetaly when using the…
![](../../users/profiles/1218081.webp)
phikes
- 528
- 4
- 12
8
votes
2 answers
NSImage doesn't scale
I'm developing a quick app in which I have a method that should rescale a @2x image to a regular one. The problem is that it doesn't :(
Why?
-(BOOL)createNormalImage:(NSString*)inputRetinaImagePath {
NSImage *inputRetinaImage = [[NSImage alloc]…
![](../../users/profiles/1047724.webp)
Tobias Timpe
- 622
- 12
- 24
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…
![](../../users/profiles/1555208.webp)
wrjohns
- 474
- 4
- 14
8
votes
4 answers
Flip NSImage on both axes
I'm trying to flip an NSImage created with a NSImageBitmapRep representation. After some digging (Flipping Quicktime preview & capture and Mirroring CIImage/NSImage) I tried two ways via a CIImage and applying a scaling transformation with -1 for…
![](../../users/profiles/386473.webp)
msohn
- 307
- 2
- 11
8
votes
1 answer
CVPixelBufferRef to NSImage
How can I convert a CVPixelBufferRef to an NSImage or CGImageRef? I need to be able to display the contents of the pixel buffer in a Core Animation Layer.
![](../../users/profiles/210876.webp)
Drew C
- 6,258
- 3
- 36
- 50
7
votes
4 answers
Storing an NSImage in a Core Data Model
What is the correct way to store an NSImage in a Core Data Model? I have assumed adding an Attribute to an Entity and giving it the Type "Binary" should work, but it is not working. I have a table with a column of NSImageCells and it is not…
Jeffrey Peck
7
votes
1 answer
NSImage to blob and blob to NSImage (SQLite, NSData)
First of all, I know that I should not use an SQLite database to store image, but I only store favicon of website which are really small.
My problem is that I try to insert those favicon into the database (seems to work), I convert the favicon to…
![](../../users/profiles/250578.webp)
Dimillian
- 3,436
- 4
- 30
- 52
7
votes
1 answer
NSImage from Asset Catalog in Test Target
My unit tests target needs to load an image resource for use in some of the tests, but I am having trouble loading it.
I have created an asset catalog within the test target.
I have added a new image set resource to the catalog, checked the "Mac"…
![](../../users/profiles/433373.webp)
Nicolas Miari
- 15,044
- 6
- 72
- 173
7
votes
2 answers
NSURL → NSImage → NSImageView
I am playing with AppKit and NSDocument and I don't know why this is not working?:
I just wrote this and image is not nil but never loads any image, its size is always zero.
Is this the correct method I have to implement to read files into my…
![](../../users/profiles/149008.webp)
nacho4d
- 39,335
- 42
- 151
- 231
7
votes
4 answers
How to draw a rounded NSImage
I am trying to create a NSImage or NSImageCell with rounded corners inside a NSTableView. I can't get anything to work. Here is the best I have so far inside my custom NSCell:
- (void)drawInteriorWithFrame:(NSRect)frame inView:(NSView…
![](../../users/profiles/32829.webp)
John Wright
- 2,402
- 4
- 28
- 32
7
votes
1 answer
Automatic Scaling of Multipage TIFF NSImage in a CALayer
Problem: I have a multipage TIFF image (generated with tiffutil) that contains the same image at multiple pixel dimension from 256x128 px all the way up to 4096x2048 px. I want to display this image in a CALayer so that the system automatically…
![](../../users/profiles/116862.webp)
Ole Begemann
- 132,868
- 29
- 267
- 251