gcamp is more or less correct, you are pretty safe to use this on a background thread, but to answer your question, I believe the following would work.
CGDataProviderRef dataProvider = CGDataProviderCreateWithFilename("file");
CGImageRef image = CGImageCreateWithPNGDataProvider(dataProvider, NULL, NO, kCGRenderingIntentDefault);
There is also a function for jpg images, CGImageCreateWithJPEGDataProvider
.
(be sure to release the data provider and image when done)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…