43
A
回答
37
本教程介绍它:http://www.musicalgeometry.com/?p=821
在重叠视图,而不是在教程中所示的红色区域只需添加一个UIImage。
3
您可以直接将UIImageView
作为主窗口的子视图而不是UIImagePicker
,它可能会更好。只要确保以正确的顺序添加它们,或致电
[window bringSubviewToFront:imageView];
照相机启动后。
如果你要处理的UIImageView
触摸你可以只添加UIImageView
作为一个正常的全屏View
具有透明背景的一个子视图,并添加是的窗口,而不是,与正常UIViewController
子类,你可以用于处理触摸事件。
2
看到摄像头的覆盖图(3.1及更高版本)
@property(nonatomic, retain) UIView *cameraOverlayView
10
为了您的实现文件:
- (IBAction)TakePicture:(id)sender {
// Create image picker controller
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
// Set source to the camera
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
// Delegate is self
imagePicker.delegate = self;
OverlayView *overlay = [[OverlayView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
// Insert the overlay:
imagePicker.cameraOverlayView = overlay;
// Allow editing of image ?
imagePicker.allowsImageEditing = YES;
[imagePicker setCameraDevice:
UIImagePickerControllerCameraDeviceFront];
[imagePicker setAllowsEditing:YES];
imagePicker.showsCameraControls=YES;
imagePicker.navigationBarHidden=YES;
imagePicker.toolbarHidden=YES;
imagePicker.wantsFullScreenLayout=YES;
self.library = [[ALAssetsLibrary alloc] init];
// Show image picker
[self presentModalViewController:imagePicker animated:YES];
}
做一个UIView类,并添加以下代码
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
// Clear the background of the overlay:
self.opaque = NO;
self.backgroundColor = [UIColor clearColor];
// Load the image to show in the overlay:
UIImage *overlayGraphic = [UIImage imageNamed:@"overlaygraphic.png"];
UIImageView *overlayGraphicView = [[UIImageView alloc] initWithImage:overlayGraphic];
overlayGraphicView.frame = CGRectMake(30, 100, 260, 200);
[self addSubview:overlayGraphicView];
}
return self;
}
相关问题
- 1. iOS:在iPhone相机预览上覆盖
- 2. OpenGL模型相机预览覆盖
- 3. 如何获取相机预览上的图像覆盖
- 4. 我们可以用相机预览覆盖点击图像吗?
- 5. 如何约束覆盖到UIImagePickerController相机预览
- 6. MonoDroid的 - 画的覆盖,把一个按钮,在相机预览
- 7. Android上相机预览上的Phonegap覆盖图像
- 8. 如何拖动覆盖在相机预览顶部的图像
- 9. 预览时不显示Android SurfaceView覆盖相机视图
- 10. 在相机预览中覆盖静态可绘制图像
- 11. 使用相机作为覆盖uiview iPhone
- 12. 在iPad/iPhone上使用相机覆盖
- 13. UIImagePickerController没有覆盖预览
- 14. 相机预览
- 15. 获取全屏相机预览iPhone?
- 16. 相机预览Android
- 17. Android - 相机预览
- 18. Monodroid相机+预览
- 19. iPhone 4和iPhone 5的相机覆盖高度
- 20. 相机镜头覆盖 - WindowsRT
- 21. 定制相机覆盖
- 22. 自定义相机覆盖
- 23. Xcode:关闭相机覆盖
- 24. UIViewController中覆盖的相机
- 25. 用相机预览的Pi相机预览 - 树莓派
- 26. 安卓相机预览回调正在绘制覆盖视图非常缓慢
- 27. 过滤相机预览
- 28. 定制相机预览Android
- 29. Android相机预览很暗
- 30. 相机预览 - 安卓
真棒画画! – rpetrich 2009-06-17 00:29:31
你最终解决了这个问题吗? – CodeAndCats 2009-09-07 10:41:10