当在iPhone上拍摄照片然后抓取该照片时是否可以检测到程序?

问题描述:

我想创建一个应用程序,它将允许我的程序检测何时使用内置的iphone相机拍摄照片,然后自动将该照片发送到我的服务器。那是可以做什么或者我需要在我的程序中构建自己的相机来完成此任务吗?如果可能的话,有人可以向我提供这些信息。 在此先感谢!当在iPhone上拍摄照片然后抓取该照片时是否可以检测到程序?

你需要编写自己的相机应用程序。背景(至少在非越狱应用程序中)并不像您希望使用更合理的系统一样有用。

你应该能够抓住所有拍摄的照片,看看哪些是新的,并将它们上传到服务器 - 它不会是一个自动过程,因为用户在关闭相机后需要打开你的应用程序。

是朋友..for这一点,你必须使用imagepicker

- (IBAction为)getPhoto:(ID)发送{ 的UIImagePickerController *选择器= [[的UIImagePickerController页头] INIT]; picker.delegate = self;

if((UIButton *) sender == getimage) { 
    picker.sourceType = UIImagePickerControllerSourceTypeSavedcamera; 
} 
[self presentModalViewController:picker animated:YES]; 

}

,并把它发送到服务器,你必须使用asihttpconnection委托。

如果你想使用的相机在你的应用程序,你可以使用UIImagePickerController然后进行sourceType作为

imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; 

您还必须实现UIImagePickerControllerDelegate将为您提供从相机拍摄的图像。

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info 
{ 
// Some code 
}