There is a custom NSImageView. I can load an image and draw rectangle using CAShapeLayer
let selectionRectangle = CAShapeLayer()
selectionRectangle.lineWidth = 1.0
selectionRectangle.fillColor = NSColor.clear.cgColor
selectionRectangle.strokeColor = colorForBands_Numbers.cgColor
selectionRectangle.lineDashPattern = [1,1]
self.layer?.addSublayer(selectionRectangle) // the CAShapeLayer is added to NSImageView layer
that results in the image and rectangle on top.
I would like to print this image with rectangle.
How can I do it ?
When I am using
let operation: NSPrintOperation = NSPrintOperation(view: self, printInfo: printInfo)
operation.run()
I have only image without the rectangle.