on Mac OS X, an NSImage object is a high-level class for manipulating image data
Questions tagged [nsimage]
681 questions
0
votes
1 answer
Is this an appropriate way of implementing an array of NSImages?
I have a series of images that I want to make use of in an app. What I wanted to do is store them in an NSArray for easy identification within the drawRect: function.
I have created a .plist file, which details an NSDictionary with the keys simply…

tom1990
- 602
- 8
- 17
0
votes
1 answer
How do I get the desktop icon used in Finder?
In Objective-c/Cocoa, how do I get the icon that Finder uses for the desktop (it looks like the black/pink nebula desktop image with a menu bar and dock).
I tried this:
NSImage *icon = [[NSWorkspace sharedWorkspace]
…

Alex B
- 1,438
- 13
- 17
0
votes
1 answer
Advice for image overlay
I'm looking for some advice on how to proceed.
I'm working on a cocoa program (Objective-C) where I want to be able to draw over top of a bitmap image, defining areas that I can use to get information from the underlying image.
As an example, I'd…

P-Rod
- 471
- 1
- 5
- 18
0
votes
2 answers
NSBitmapImageRep and multi-page TIFFs
I've got a program that can open TIFF documents and display them. I'm using setFlipped:YES.
If I'm just dealing with single page image files, I can do
[image setFlipped: YES];
and that, in addition to the view being flipped, seems to draw the…

Brian Postow
- 11,709
- 17
- 81
- 125
0
votes
1 answer
cocoa - draw image in NSView
I'm having difficulties understanding why the below code doesn't work, what I want to achieve is an image being displayed in the top left corner of a NSView, but nothing is showing...
NSImage *map0 = [NSImage imageNamed:@"map0.png"];
NSRect rect =…

Lennart
- 1,560
- 5
- 20
- 38
0
votes
1 answer
NSImage and NSBitmapImageRep Memory Leak
I am using objective C in a c++ application to load images on OSX. It is an OpenGL application. This is the code I use to load an image into opengl:
bool OSXSpecifics::loadPNGOSX(const char *fileName, int &outWidth, int &outHeight, GLuint…

DavidColson
- 8,387
- 9
- 37
- 50
0
votes
1 answer
NSImage at app start
I have an image view object. I can get it to load images when a buttun is pressed but I want to know if there is a way to get it to load at the start of the app.
The code im using is
NSURL *lURL = nil;
NSData *lData = nil;
NSImage *lImage =…

AlanF
- 1,591
- 3
- 14
- 20
0
votes
1 answer
How to check whether an NSImage is GrayScale or RGB?
Is there any way to check an NSImage's color type in OBJC? I wanna know whether the image is GrayScale or RGB. Any suggestions would help, thanks~

LYTTE_LJ
- 79
- 8
0
votes
1 answer
NSImage not centered in image well
I'm loading a NSImage into an image well from a url. Image load in but in the off center, in upper right corner of the image well. When I resize the window the image centers itself. Anyone familiar with why this happens?

Kyle Parisi
- 1,316
- 1
- 11
- 14
0
votes
2 answers
Use Image from desktop as NSImage
How can I set a NSImageView's Image to a file from the desktop, not from inside my app.
this is the code i've tried:
[applicationIcon setImage:myImage];

atomikpanda
- 1,845
- 5
- 33
- 47
0
votes
1 answer
NSImage initWithData not found?
In NSImage class reference it is said that there exist method initWithData, but why xCode says it doesn't exist?
I use it like this:
NSData *imgData = [[imageView image] TIFFRepresentation];
fotoImg = [NSImage initWithData:imgData];
And i get…

hockeyman
- 1,141
- 6
- 27
- 57
0
votes
1 answer
NSImage (from icns) slow painting
When building a NSImage from a icns file and then painting it on a ImageAndTextCell, it goes very slow. But if I create the NSImage from a png, jpg, etc. it paints very fast.
How to speed it up ? Creating a jpg (etc) from the icns ? Keeping a cache…

Antonio Linares Cañas
- 310
- 2
- 9
0
votes
0 answers
drag and drop: NSView thinks source is an image that it isn't
I have two views.
1. One view has a grid of NSImageViews with images.
2. The other view has a grid of potential places to place the dragged image.
I think I have dragging working. If I click and drag an image from view 1, it works fine, but when I…

Jomnipotent17
- 451
- 7
- 23
0
votes
1 answer
How to transform this NSImage code for use on iOS
I am attempting at turning some code written for Mac OS X into an iOS application. This is the working code for OS X:
// To create the images on the view:
NSRect imageRect = NSMakeRect(24+(i*80), ypos, 72, 96);
NSImageView…

Ben T
- 141
- 1
- 10
0
votes
1 answer
how to translate and scale a NSImage?
I have built so far an application that allows the user to drag and drop images onto a NSImageView. However, I want to be able to move these images by simply clicking on any image and hold down the mouse button to move it's location.
How can I…

ObjectiveC-InLearning
- 443
- 1
- 7
- 20