Hello there 
I am using this code to overlay a custom size video preview window to a
Quartz2D screen:
and also this code, to capture screenshots:
Problem is, when the live camera feed is on the screen, but it is not present
in the screenshots when I check them in the Camera Roll.
I want the camera preview to be captured in the shots.
Any ideas what I'm doing wrong?
Cheers, Art.
----------
I'm a beginner, but it might be that the camera feed is happening in a different view or something. The camera code is in the view controller.m file,
while the snapshot code is in the same file all the drawing is done "Draw2D.m".
I am using this code to overlay a custom size video preview window to a
Quartz2D screen:
Code:
[self setCaptureManager:[[CaptureSessionManager alloc] init]];
[[self captureManager] addVideoInput];
[[self captureManager] addVideoPreviewLayer];
//CGRect layerRect = [[[self view] layer] bounds];
CGRect layerRect = CGRectMake(0,360,320,120);
[[[self captureManager] previewLayer] setBounds:layerRect];
[[[self captureManager] previewLayer] setPosition:CGPointMake(CGRectGetMidX(layerRect),
CGRectGetMidY(layerRect))];
[[[self view] layer] addSublayer:[[self captureManager] previewLayer]];
[[captureManager captureSession] startRunning];
and also this code, to capture screenshots:
Code:
// if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
// UIGraphicsBeginImageContextWithOptions(self.window.bounds.size, NO, [UIScreen mainScreen].scale);
// } else {
// UIGraphicsBeginImageContext(self.window.bounds.size);
// }
// [self.window.layer renderInContext:UIGraphicsGetCurrentContext()];
// UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
// UIGraphicsEndImageContext();
// UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
Problem is, when the live camera feed is on the screen, but it is not present
in the screenshots when I check them in the Camera Roll.
I want the camera preview to be captured in the shots.
Any ideas what I'm doing wrong?
Cheers, Art.
----------
I'm a beginner, but it might be that the camera feed is happening in a different view or something. The camera code is in the view controller.m file,
while the snapshot code is in the same file all the drawing is done "Draw2D.m".