开发者

PDFPage initWithImage: strange behavior

开发者 https://www.devze.com 2023-02-04 12:38 出处:网络
I can\'t understand the difference. It seams to be the same but is not! Does enybody know why? // Working:

I can't understand the difference. It seams to be the same but is not!

Does enybody know why?

// Working:
PDFPage *imagePDFPage = [[PDFPage alloc] initWithImage:
[[NSImage alloc]initWithContentsOfFile:imagePath]];


// NOT W开发者_JAVA百科orking:
NSImage *image = [[NSImage alloc]initWithContentsOfFile:imagePath];                           
PDFPage *imagePDFPage = [[PDFPage alloc] initWithImage:image];


Here's the solution:

NSImage *image = [[NSImage alloc]initWithContentsOfFile:imagePath]; 
PDFPage *imagePDFPage = [[PDFPage alloc] initWithImage:(CIImage *) image];
0

精彩评论

暂无评论...
验证码 换一张
取 消