iOS相机定制:如何实现网格线? [英] iOS Camera Customization: How to implement Grid Lines?

查看:247
本文介绍了iOS相机定制:如何实现网格线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用闪光灯功能,访问照片库并使用后置/前置摄像头.

I am able to use the flash feature, access the photo gallery, and use the rear/front camera.

我想实现在用户拍照时显示的网格线.

I would like to implement grid lines that display when the user is taking a photo.

有什么想法吗?

推荐答案

创建一个UIImageView用于cameraOverlayView.

假设您有一个名为yourImagePickerControllerUIImagePickerController,并且还具有一个名为overlay.png的图像文件作为网格线".制作网格线图像文件时,请确保使用透明背景-而不是白色.

Assuming you've got a UIImagePickerController named yourImagePickerController and also that you've got an image file named overlay.png as your 'grid lines'. When making your grid line image file, be sure to use a transparent background - not opaque white.

UIImageView *overlayImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"overlay.png"]];

CGRect overlayRect = CGRectMake(0, 0, overlayImage.image.size.width, overlayImage.image.size.height);

[overlayImage setFrame:overlayRect];

[yourImagePickerController setCameraOverlayView:overlayImage];

这篇关于iOS相机定制:如何实现网格线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆