Skip to main content
0 votes
1 answer
30 views

I am showing a menu bar button for my app: let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength) if let button = statusItem.button, let img = NSImage(named: "...
sudoExclamationExclamation's user avatar
0 votes
1 answer
142 views

When one copies a file in Finder, the pasteboard contains a 'icns' type with the various icon descriptions of the copied item(s). I need to accomplish the same effect in my code, i.e. generate the ...
Thomas Tempelmann's user avatar
-1 votes
1 answer
89 views

I'm creating an app which requires the user to upload image files to the app. In the app I want to obtain its info (dimensions, ecc.) and show it. Here is what I tried: var body: some View { ...
Lorenzo Zorri's user avatar
0 votes
0 answers
36 views

I have an NSView with NSImage instances as subviews that all show up correctly on the screen. I want to save them to a PDF file but the subviews are not included. The routine works well and also saves ...
Till's user avatar
  • 1
1 vote
0 answers
104 views

I am trying to use the new -[NSOpenPanel setAllowedContentTypes:] and looking for equivalent of -[NSOpenPanel setAllowedFileTypes:[NSImage imageTypes]]. Is this equivalent: openPanel....
Marek H's user avatar
  • 5,652
0 votes
1 answer
53 views

I'm having an issue where when my asset catalog have more than 2 images (all have @1x @2x and @3x), my NSImage in my NSImageView cannot be clicked. Does anyone know why this happens? Thanks in advance!...
Christopher Nathanael Tessy's user avatar
2 votes
2 answers
3k views

I'm new to swift concurrency, I noticed that my code freezes UI when trying to initialize NSImage, so I decided to do it on the global thread like this: func chooseImage() { Task { @MainActor in ...
flex_'s user avatar
  • 733
0 votes
0 answers
52 views

I'm trying to build an macos utility to help me center the content of the image and not sure how I would achieve such. For example let say that I have an image as below: As you can see there's more ...
jo1087's user avatar
  • 43
1 vote
0 answers
86 views

I have 10 bit image file (HEIC, AVIF) loaded using NSImage. When attempting to resize using CGContext I get following message multiple times This method should not be called on the main thread as it ...
Marek H's user avatar
  • 5,652
2 votes
1 answer
82 views

I have a large image and a smaller image, both in Data type which I transformed into NSImage. I want to put the smaller image on top of the large image, top-left aligned, in a new single NSImage. ...
J. Doe's user avatar
  • 13.5k
2 votes
0 answers
126 views

I am currently experiencing strange behavior when determining icons for files. When I determine icons using let icon = NSWorkspace.shared.icon(forFile: path) it generally works fine. However, for ...
gkoeder's user avatar
  • 91
0 votes
1 answer
70 views

Developing apps for iOS, it is simple to extract pixels from UIImage, manipulate them, then reconstruct an UIImage from them, example: csr = CGColorSpaceCreateDeviceRGB(); ctx = CGBitmapContextCreate(...
Luigi Fonti's user avatar
0 votes
1 answer
353 views

I have an NSView whose layer has various sublayers. Its needsDisplay property is set to YES when the app changes its effective appearance, which ends up calling: -(void)updateLayer { // this is ...
jeanlain's user avatar
  • 475
1 vote
1 answer
383 views

I have a command-line Swift script that takes a series of images of close to the same pixel dimensions and creates a PDF from them. Part of what this script does is normalize the images so that each ...
Jerry Stratton's user avatar
0 votes
1 answer
52 views

I use this code to place a text in an image: extension NSImage { //https://stackoverflow.com/questions/54450429/macos-add-a-text-overlay-to-an-image-in-swift func textToImage(...
Patrick Koning's user avatar

15 30 50 per page
1
2 3 4 5
46