Skip to main content

All Questions

Tagged with
82 votes
9 answers
59k views

How to save a NSImage as a new file

How can I save a NSImage as a new file (png, jpg, ...) in a certain directory?
burki's user avatar
  • 2,986
30 votes
5 answers
11k views

NSImage size not real size with some pictures?

I see that sometimes NSImage size is not real size (with some pictures) and CIImage size is always real. I was testing with this image. This is source code which I wrote for testing: NSImage *...
Justin Boo's user avatar
  • 10.2k
18 votes
4 answers
11k views

How do I take a "screenshot" of an NSView?

I need to take the contents of an NSView and put them in an NSImage, for an experimental project. Is this possible? I did some Googling, tried two methods that I found - but they didn't really work. ...
Debashis's user avatar
  • 199
22 votes
5 answers
22k views

Swift NSImage to CGImage

How can I convert a NSImage to CGImage in Swift? In Objective-C I did it like this: - (CGImageRef)CGImage { NSData *imageData = self.TIFFRepresentation; CGImageSourceRef source = ...
Lupurus's user avatar
  • 4,157
16 votes
6 answers
32k views

Turning an NSImage* into a CGImageRef?

Is there an easy way to do this that works in 10.5? In 10.6 I can use nsImage CGImageForProposedRect: NULL context: NULL hints: NULL If I'm not using 1b black and white images (Like Group 4 TIFF), ...
Brian Postow's user avatar
  • 12.1k
13 votes
1 answer
9k views

NSTextView insert image in between text

Is it possible to insert an image (not a background image) into an NSTextView? Something like: Hi :) How are you? and it should display a "smiley" image. I have an NSTextView and an NSImage.
Amitg2k12's user avatar
  • 3,805
20 votes
3 answers
13k views

Converting CIImage Into NSImage

I'm playing with the Core Image framework. As I understand, if I have an image (NSImage), it needs to be converted into CIImage, first. I can do that. NSImage *im1 = [[NSImage alloc] ...
El Tomato's user avatar
  • 6,697
19 votes
4 answers
9k views

How to draw a NSImage like images in NSButtons (with a deepness)?

Is there any way to draw an NSImage like images in NSButtons or other cocoa interface elements? Here are examples: Apple uses pdf's with black icons:
Flocked's user avatar
  • 1,890
12 votes
3 answers
7k views

How do I get the icon of the user's Mac?

Using Objective-C and Cocoa, does anyone know how to get the icon for a user's computer (the one that shows under "Devices" and "Network" in Finder)? Not the harddisk icon, the actual one for a user's ...
Alex B's user avatar
  • 1,448
9 votes
4 answers
6k views

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 ...
msohn's user avatar
  • 336
7 votes
4 answers
10k views

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)...
John Wright's user avatar
  • 2,478
6 votes
1 answer
12k views

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 ...
Coldsteel48's user avatar
  • 3,512
5 votes
3 answers
8k views

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's user avatar
  • 1,225
3 votes
1 answer
2k views

Memory Continues to Increase when Loading and Releasing NSImage

I have a problem where my application aggressively consumes memory to a "thrashing point" with successive image file loads. For example, consider the following code, which repeatedly loads and ...
spurgeon's user avatar
  • 1,112
0 votes
1 answer
1k views

Create and write paletted RGBA PNG using NSImage

I'm trying to create paletted PNG image (8-bit per pixel) that uses RGBA palette (32-bit per palette entry) using Cocoa framework*. I've tried few combinations for [NSBitmapImageRep ...
Kornel's user avatar
  • 99.9k

15 30 50 per page