我正在开发一个项目,其要求是: - 用户将通过应用程序打开相机 - 捕获图像后,一些数据将附加到捕获图像的元数据.我已经浏览了一些论坛.我试着编写这个逻辑.我想,我已达到目的,但由于我无法看到我附加到图像的元数据,因此缺少了一些东西.我的代码是:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)dictionary
{
[picker dismissModalViewControllerAnimated:YES];
NSData *dataOfImageFromGallery = UIImageJPEGRepresentation (image,0.5);
NSLog(@"Image length: %d", [dataOfImageFromGallery length]);
CGImageSourceRef source;
source = CGImageSourceCreateWithData((CFDataRef)dataOfImageFromGallery, NULL);
NSDictionary *metadata = (NSDictionary *) CGImageSourceCopyPropertiesAtIndex(source, 0, NULL);
NSMutableDictionary *metadataAsMutable = [[metadata mutableCopy]autorelease];
[metadata release];
NSMutableDictionary *EXIFDictionary = [[[metadataAsMutable objectForKey:(NSString *)kCGImagePropertyExifDictionary]mutableCopy]autorelease];
NSMutableDictionary *GPSDictionary = [[[metadataAsMutable objectForKey:(NSString *)kCGImagePropertyGPSDictionary]mutableCopy]autorelease];
if(!EXIFDictionary)
{
//if the image does not have an EXIF dictionary (not all images do), then create one for us to use …Run Code Online (Sandbox Code Playgroud) 我正在开发一个iPhone应用程序,我需要通过我的应用程序调整屏幕的亮度,就像我们通过Settings应用程序一样.
我已搜索但尚未找到解决方案.
我在文档目录(iPhone)中有一些图像文件(.png文件).我在UIWebView上查看Web表单(.aspx).当我点击表单的提交按钮时,我只想将图像文件附加到表单,并希望将该文件与Web表单一起发送到Web服务器.
我遇到的是,我没有得到如何将图像文件附加到Web表单以及如何提交这两个.
请帮助我解决这个问题.我没有得到任何提示如何做到这一点.
感谢您....