on Mac OS X, an NSImage object is a high-level class for manipulating image data
Questions tagged [nsimage]
681 questions
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…

John Wright
- 2,418
- 4
- 29
- 34
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…

Ole Begemann
- 135,006
- 31
- 278
- 256
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
4 answers
Rendering NSView containing some CALayers to an NSImage
I have an NSView that contains an NSScrollView containing a CALayer-backed NSView. I've tried all the usual methods of capturing an NSView into an NSImage (using -dataWithPDFInsideRect, NSBitmapImageRep's -initWithFocusedViewRect, etc.) However, all…

indragie
- 18,002
- 16
- 95
- 164
6
votes
1 answer
MAC OS Xcode Swift 2.2 Convert NSImage to CIImage
I like to convert an NSImage to a CIImage in swift 2.2 for a mac app.
Does anybody have some example code?

FJC
- 213
- 2
- 9
6
votes
2 answers
Resize PDF NSImage OSX
I'm updating an image resizing Mac App. What I want to be able to do is if the user imports an image to be resized that has a PDFImageRep, save a new PDF file with a resolution of my choosing.
So far I've tried to draw the image at a new size, as…

Mark Bridges
- 8,228
- 4
- 50
- 65
6
votes
2 answers
Refer to an image in folder of Images.xcassets
I have the following structure in my Images.xcassets in Xcode:
There is the typical method to set the image using NSImage *image = [NSImage imageNamed:@"confused"]; but is there a way to set the image by using the folder structure?
For example, I…

wigging
- 8,492
- 12
- 75
- 117
6
votes
1 answer
How to display animated GIF in Objective C on top of the layered View?
I am trying to draw animated gif on my screen in mac OSX app .
I used this code to insert the gif: I can see the Gif as 1 picture it doesn't animates
only static picture :( what should I add to make it animated ?
#import
#import…

Coldsteel48
- 3,482
- 4
- 26
- 43
6
votes
2 answers
Writing image metadata (EXIF/TIFF/IPTC) to image file in OS X
I am creating a photo editing app, and so far I've managed to read the metadata from image files successfully (after getting an answer to this question: Reading Camera data from EXIF while opening NSImage on OS X).
source =…

Can Poyrazoğlu
- 33,241
- 48
- 191
- 389
6
votes
4 answers
How to draw a colored border around NSImage?
I did some research but all the answers I got were for iOS, how can I draw a colored border around NSImage in OSX app? I tried using imageView property of NSImage to set it's border width and color, but it doesn't seem to be working...
Any kind of…

Eugene Gordin
- 4,047
- 3
- 47
- 80
6
votes
2 answers
Cocoa memory management when using initWithBitmapDataPlanes to create NSImage
I am creating an NSImage from an unsigned char * of 24bit RGB data like so:
NSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc]
initWithBitmapDataPlanes:(unsigned char **)&data
…

spartygw
- 3,289
- 2
- 27
- 51
6
votes
1 answer
Retina display problems when working with images
I have met problems when working on retina display. NSImage size is correct, but if I create NSBitmapImageRep from it and write it to file I get image witch's size is twice as big as original image. There is no such problem when I use it on non…

hockeyman
- 1,141
- 6
- 27
- 57
5
votes
1 answer
NSImage + Transparency?
I'm not sure whether it's the right thing to ask for... but what I want is basically "whitewashing" an NSImage, or reducing its opacity... (sort of an "inactive" icon in Finder? something like that)
What's the easiest way to achieve this?
I've tried…

Dr.Kameleon
- 22,532
- 20
- 115
- 223
5
votes
2 answers
cocoa: Read pixel color of NSImage
I have an NSImage. I would like to read the NSColor for a pixel at some x and y. Xcode seems to thing that there is a colorAtX:y: method on NSImage, but this causes a crash saying that there is no such method for NSImage. I have seen some examples…

mtmurdock
- 12,756
- 21
- 65
- 108
5
votes
3 answers
how to change image resolution in objective-c
I need to change the resolution of the existing image in objective-c just like Apple's Preview application Tools->Adjust Size...->Resolution.
Please let me know the possible solutions.

AmitSri
- 1,209
- 1
- 20
- 48