PDFPage initWithImage: comportamiento extraño
-
09-10-2019 - |
Pregunta
No puedo entender la diferencia. Costuras que ser el mismo, pero no lo es!
¿El enybody saber por qué?
// Working:
PDFPage *imagePDFPage = [[PDFPage alloc] initWithImage:
[[NSImage alloc]initWithContentsOfFile:imagePath]];
// NOT Working:
NSImage *image = [[NSImage alloc]initWithContentsOfFile:imagePath];
PDFPage *imagePDFPage = [[PDFPage alloc] initWithImage:image];
Solución
Aquí está la solución:
NSImage *image = [[NSImage alloc]initWithContentsOfFile:imagePath];
PDFPage *imagePDFPage = [[PDFPage alloc] initWithImage:(CIImage *) image];
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow