私はカメラアプリに取り組んでいます。画像コンテンツを特定のサイズに制限したいのですが、カメラを介した画像がフルスクリーンで表示されます。どうすれば最小化できますか?
- (void) viewDidAppear:(BOOL)animated {
OvlayView *overlay = [[OvlayView alloc] initWithFrame:CGRectMake(472, 158, 240, 128)];
// Create a new image picker instance:
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
// Set the image picker source:
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
// Hide the controls:
picker.showsCameraControls = YES;
picker.navigationBarHidden = YES;
// Make camera view full screen:
picker.wantsFullScreenLayout = NO;
picker.cameraViewTransform = CGAffineTransformScale(picker.cameraViewTransform, CAMERA_TRANSFORM_X, CAMERA_TRANSFORM_Y);
// Insert the overlay:
picker.cameraOverlayView = overlay;
/*UIGraphicsBeginImageContext(CGSizeMake(480,320));
CGContextRef context = UIGraphicsGetCurrentContext();
[image drawInRect: CGRectMake(0, 0, 480, 320)];
UIImage *smallImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();*/
// Show the picker:
[self presentModalViewController:picker animated:YES];
[super viewDidAppear:YES];
}