iPhone 相机和照片编辑选项 - 自定义应用程序集成

标签 iphone ios camera

我现在正处于为新 iPhone 应用程序收集信息的阶段。对于这个应用程序,我想使用相机和照片图像编辑选项。 Apple 是否提供 API( Controller ),我可以在我的应用程序中使用这种集成的 IO 功能?我的意思是,在一个过程中,首先使用 iPhone 相机(IOS 功能),然后使用照片编辑选项(IOS 功能),对其进行压缩和标记(个人功能),最后将其保存在我的个人应用程序文件夹/库中(不在一般照片库中)?

我一直在阅读 UIImagePickerController 类功能,但我想在继续之前与您仔细核实

https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html

有压缩图像或以较低分辨率捕获图像的想法吗?

非常感谢你提前

最佳答案

您可以在 UIImagePickerController 的回调中调整图像大小,而不是使用较低分辨率捕获图像

    - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
    UIImage *temp = (UIImage*)[info objectForKey:@"UIImagePickerControllerOriginalImage"];
    UIImage *uploadImage = [self resizeImageWithImage:temp];
}

调整大小函数:

- (UIImage*)resizeImageWithImage:(UIImage*)image {
 CGSize newSize = CGSizeMake(newWidth, newHeight);
                UIGraphicsBeginImageContext( newSize );
                [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
                UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
                UIGraphicsEndImageContext();
}

您可能需要使用:

#import <QuartzCore/QuartzCore.h>

和图书馆。

还有图像编辑检查 CoreImage 库,您可以从这里获取信息

http://developer.apple.com/library/mac/#documentation/graphicsimaging/Conceptual/CoreImaging/ci_intro/ci_intro.html

关于iPhone 相机和照片编辑选项 - 自定义应用程序集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9033537/

相关文章:

iphone - 有没有办法知道移动用户之前是否通过二维码 URL 访问过某个网站?

ios - 只允许 2 个用户从公共(public)类读取一个对象

ios - UIKit 导入了什么,我如何找到?

android - 两个带线程的 SurfaceView - 相机预览无法恢复

c# - 如何 : Taking photos in windows mobile without CameraCaptureDialog?

ios - watch APP可以实现加速api吗?

iphone - 使用 block 回调时如何释放对象

iphone - 从 UIView 推送 UIViewController

objective-c - 以编程方式在 iOS 中捕获带有状态栏的完整屏幕截图

java - 检测所有摄像头android