Swift 3 - Custom Camera View (oval shape)

Hi there, I would like to ask, is it possible to make a custom oval shape camera view??

You can create an oval area with a bezier path and clip the image inside with


let ovalPath = NSBezierPath(ovalInRect: ovalRect) // create the oval shape

let currentContext = NSGraphicsContext.currentContext()!.CGContext // save the context

ovalPath.setClip() // 14.8.2016

// draw the photo

CGContextRestoreGState(currentContext) // restore the context


Have a look at this for more details

http : / / www.knowstack.com/drawing-in-swift-cocoa/

http : / / stackoverflow.com/questions/24167922/how-do-i-save-and-restore-a-graphics-context-in-swift-on-ios

/thread/http:/ <p style=http : / / stackoverflow.com/questions/29156765/swift-on-os-x-how-to-access-the-current-cgcontext-for-drawing-in-nsview-drawr

Swift 3 - Custom Camera View (oval shape)
 
 
Q