Open feelingsonice opened 1 week ago
@feelingsonice, I think you should implement Custom Preview for that
MCameraController()
.outputType(.video)
.gridVisible(false)
.cameraPosition(.back)
.mediaPreviewScreen(CroppedPreview.init)
struct CroppedPreview: MCameraPreview {
let capturedMedia: MijickCameraView.MCameraMedia
let namespace: Namespace.ID
let retakeAction: () -> ()
let acceptMediaAction: () -> ()
// crop implementation
}
@deden any tip on how to actually do that? I ran into a wall trying to do that with my own AVCaptureVideoPreviewLayer and couldn’t figure it out. Hence I’m now trying to see if there’s any third party libraries that could support this :(
@feelingsonice, were you able to solve your problem on your own?
If not please let me know, I'll try to create a demo project for you this week.
I ended up not actually "cropping" the preview but fitFill
a smaller rectangle on screen. When the user captures a photo, I crop it to the preview frame with something like this.
I think this works fine for my use case but would love to know how to actually crop out of curiosity. If it's a lot of work for you don't worry about it though :)
Thanks for the help!
Is there a way to crop the preview and capture photos exactly like the cropped preview?