如何从uiimagePicketController识别图像是截图还是摄像头图像?

时间:2021-10-25 15:01:27
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)selectedImage editingInfo:(NSDictionary *)editInfo {
NSLog(@"done");

headingLabel.hidden= NO;
//[self playMovie];
[picker dismissViewControllerAnimated:YES completion:nil];
[self setupCroppingTool:selectedImage];

}

}

this is the code,so how can i identify the selectedImage is screenshot or camera image

这是代码,所以如何识别selectedImage是截图或相机图像

3 个解决方案

#1


2  

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)selectedImage editingInfo:(NSDictionary *)editInfo

This method picks the image from photo library. You cant compare a screenshot image with a normal image because both are UIImage.

此方法从照片库中选取图像。您无法将屏幕截图图像与普通图像进行比较,因为它们都是UIImage。

#2


0  

May be help..

可能会有所帮助..

I think source property of UIImagePickerController help you.

我认为UIImagePickerController的source属性可以帮助你。

Example.

例。

UIImagePickerController *abc = [[UIImagePickerController alloc] init];;
abc.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

You can use one of this..

你可以使用其中一个..

UIImagePickerControllerSourceTypePhotoLibrary
UIImagePickerControllerSourceTypeCamera
UIImagePickerControllerSourceTypeSavedPhotosAlbum

#3


0  

Look at the image metadata - date, keywords, geolocation... and compare that.

查看图像元数据 - 日期,关键字,地理位置......并进行比较。

#1


2  

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)selectedImage editingInfo:(NSDictionary *)editInfo

This method picks the image from photo library. You cant compare a screenshot image with a normal image because both are UIImage.

此方法从照片库中选取图像。您无法将屏幕截图图像与普通图像进行比较,因为它们都是UIImage。

#2


0  

May be help..

可能会有所帮助..

I think source property of UIImagePickerController help you.

我认为UIImagePickerController的source属性可以帮助你。

Example.

例。

UIImagePickerController *abc = [[UIImagePickerController alloc] init];;
abc.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

You can use one of this..

你可以使用其中一个..

UIImagePickerControllerSourceTypePhotoLibrary
UIImagePickerControllerSourceTypeCamera
UIImagePickerControllerSourceTypeSavedPhotosAlbum

#3


0  

Look at the image metadata - date, keywords, geolocation... and compare that.

查看图像元数据 - 日期,关键字,地理位置......并进行比较。