All Questions
50 questions
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?
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 *...
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. ...
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 = ...
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), ...
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.
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] ...
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:
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 ...
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 ...
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)...
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 ...
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.
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 ...
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 ...