-3

这是具有图像数据的方法,该图像将比写入相机胶卷

CGImageRef cgImageResult = [self newSquareOverlayedImageForFeatures:features
                                                                                       inCGImage:srcImage 
                                                                                 withOrientation:curDeviceOrientation 
                                                                                                                 frontFacing:isUsingFrontFacingCamera];

                                  if (srcImage)
                            CFRelease(srcImage);

                        CFDictionaryRef attachments = CMCopyDictionaryOfAttachments(kCFAllocatorDefault, 
                                                                                    imageDataSampleBuffer, 
                                                                                    kCMAttachmentMode_ShouldPropagate);
                        [self writeCGImageToCameraRoll:cgImageResult withMetadata:(id)attachments];
4

1 回答 1

1

将其转换CGImageUIImage这样:UIImage *image = [UIImage imageWithCGImage:<#(CGImageRef)#>];并将其发布到 Facebook,正如您在评论中提到的那样。祝你好运!

编辑 好的,这样做:

UIImage *image = [UIImage imageWithCGImage:cgImageResult];
[fbController addImage:image]; 
于 2013-08-30T06:53:46.263 回答