nsimage Questions

13

Solved

I have an NSBitmapImageRep which is WxH size. I create NSImage and call addRepresentation:. Then I need to resize the NSImage. I tried setSize method but it doesn't work. What should I do?
Hayleyhayloft asked 14/8, 2012 at 9:15

5

Solved

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, NSBitmapIma...
Numeration asked 23/12, 2010 at 5:45

2

Solved

I have the following code working: let myImage = NSImage(named: "my-image.png") filter.setValue(myImage, forKey: kCIInputImageKey) filter.setValue(0.5, forKey: kCIInputIntensityKey) le...
Myrtlemyrvyn asked 7/10, 2016 at 20:23

4

Solved

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...
Invaginate asked 14/7, 2010 at 23:11

5

Solved

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 *_im...
Fluency asked 13/2, 2012 at 16:24

6

Solved

I use the code below to get the width and height of a NSImage: NSImage *image = [[[NSImage alloc] initWithContentsOfFile:[NSString stringWithFormat:s]] autorelease]; imageWidth=[image size].width;...
Shult asked 9/8, 2012 at 4:46

6

Solved

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...
Nessa asked 30/3, 2010 at 19:27

3

Solved

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] initWithConte...
Taxable asked 30/6, 2013 at 2:46

4

Solved

I am creating a plist from my OSX app that contains some images. I am writing the image by : [NSKeyedArchiver archivedDataWithRootObject:self.someImage] Then I am using this plist file as a temp...
Yahiya asked 24/4, 2014 at 14:41

1

Solved

You can set a system image(SF Symbol) in UIKit with UIImage(systemName: "pencil"). For macOS apps you can set a system image in storyboard. However, I couldn't find a way to set a system ...
Luiseluiza asked 19/2, 2021 at 16:41

3

Solved

I am trying to load a file from xcassets to an NSImage, where the asset name is logo. I tried this: let logoIcon = NSImage(named: "logo") But I keep getting this error: Cannot convert val...
Xuanxunit asked 1/3, 2018 at 15:22

3

Using code (not the Interface builder) I need to create an NSButton that looks like an image. Specifically I want to use NSImageNameStopProgressFreestandingTemplate and I need it not to look like b...
Duplicate asked 26/12, 2010 at 12:8

5

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 = CGImageSourceCr...
Unbiased asked 6/7, 2014 at 12:41

2

Solved

If I'm not really fussy about the exact tone etc of the dimmed image, is there a quick and dirty way to draw an NSImage slightly dimmed, like this? I've searched online and can't really find what I...
Raybin asked 25/11, 2010 at 11:31

4

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 t...
Oneupmanship asked 29/7, 2012 at 18:41

9

Solved

How can I save a NSImage as a new file (png, jpg, ...) in a certain directory?
Deitz asked 14/6, 2010 at 16:12

1

Solved

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 i...
Supplicant asked 22/3, 2018 at 5:50

6

Solved

I'm doing some operations on images, and after I'm done, I want to save the image as PNG on the disk. I'm doing the following: + (void)saveImage:(NSImage *)image atPath:(NSString *)path { [image...

4

Solved

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 CIIm...
Dogmatize asked 7/6, 2012 at 17:12

3

I have a menu with an NSImage showing some information, and when it gets updated I would like the new (updated) image to fade in. I know it is easy on the iPhone, but is this possible in OS X ?
Reasoning asked 28/2, 2011 at 12:37

6

Solved

I have created an NSImage object, and ideally would like to determine how many of each pixels colour it contains. Is this possible?
Replicate asked 3/1, 2010 at 5:31

2

Solved

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 ...
Mungovan asked 15/3, 2012 at 18:36

1

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.
Gutter asked 25/4, 2012 at 14:56

4

Solved

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...
Bartolommeo asked 28/10, 2013 at 21:21

2

Solved

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 c...
Sainthood asked 4/3, 2012 at 10:54

© 2022 - 2025 — McMap. All rights reserved.