Question

This is the method that have the image data, that image will than write to camera roll

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];
Was it helpful?

Solution

Convert the CGImage to UIImage like so: UIImage *image = [UIImage imageWithCGImage:<#(CGImageRef)#>]; and post it to facebook as you have mentioned on your comments. Good Luck!

EDIT Okay, do it like this:

UIImage *image = [UIImage imageWithCGImage:cgImageResult];
[fbController addImage:image]; 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top