How to convert CFDataRef data to UIImage / NSData - Iphone
- by sagar
Hello ! every one.
I am having a little query regarding CFData in Objective C / iPhone Development.
See, Apple documentation has following method for CGPDFStream
CGPDFStreamCopyData(<#CGPDFStreamRef stream#>, <#CGPDFDataFormat *format#>)
Above method return type is CGDataRef. I have data as stream. Now I wish to convert in image. & For that I think I should follow this way.
CGPDFDataFormat t=CGPDFDataFormatJPEG2000;
CFDataRef data = CGPDFStreamCopyData (stream, &t);
After executing above statements - I have some reference in data variable.
Now my Query is - How to convert this CFData to NSData or UIImage ?
I have gone through the documentation of apple - But I am failure to find it.
Thanks in advance for sharing your knowledge.
Sagar