gcamp is more or less correct, you may well use this in the background thread, but to answer your question, I believe the following will work.
CGDataProviderRef dataProvider = CGDataProviderCreateWithFilename("file"); CGImageRef image = CGImageCreateWithPNGDataProvider(dataProvider, NULL, NO, kCGRenderingIntentDefault);
There is also a function for jpg images, CGImageCreateWithJPEGDataProvider .
(do not forget to free the data and image provider when this is done)
Jerry jones
source share