Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let image = NSImage(contentsOfFile: path as String);
- class MyView: NSView {
- override func draw(_ dirtyRect: NSRect) {
- super.draw(dirtyRect)
- let bounds = NSRect(x: 0, y: 0, width: 100, height: 100);
- let context = NSGraphicsContext.current()?.cgContext;
- context.draw(image: self.image!, in: bounds)
- }
- }
- image!.draw(in: bounds);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement