如何将PNG图像读取为NSImage。我尝试了以下方法,但当我获取图像的宽度和大小时,我得到了一些奇怪的值...如果有人能指导我正确的路径...非常感谢。
NSImage * picture = [[NSImage alloc] initWithContentsOfFile: [bundleRoot stringByAppendingString:tString]];
NSLog(@"sixe %d %d",picture.size.width, picture.size.height);
if( picture ){
NSLog(@"Picture is not null");
}else {
NSLog(@"Picture is null.");
}
谢谢