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