Closed ldenoue closed 3 years ago
I tried but failed to load images from the plugin. I'd like to show a default background image in case my webcam is turned off by the user.
Something like self.backgroundImage = NSImage(named: "background.jpg") doesn't work. The only way was to load from the net. Ideas? Laurent
self.backgroundImage = NSImage(named: "background.jpg")
Answering my own question:
let bundlePath = Bundle(for: type(of: self)).bundlePath let placeHolderPath = bundlePath + "/Contents/Resources/image.png" let image = NSImage(contentsOfFile: placeHolderPath)
I tried but failed to load images from the plugin. I'd like to show a default background image in case my webcam is turned off by the user.
Something like
self.backgroundImage = NSImage(named: "background.jpg")
doesn't work. The only way was to load from the net. Ideas? Laurent