如何将 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.");
}
谢谢