From 838e3d55102354d2217bb89e6250ef142f50c690 Mon Sep 17 00:00:00 2001 From: Felix Kauselmann <2039670+selmf@users.noreply.github.com> Date: Fri, 10 Mar 2017 10:12:50 +0100 Subject: [PATCH] pdfium: render pages to ARGB32 format directly --- common/pdf_comic.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/pdf_comic.cpp b/common/pdf_comic.cpp index e943b1d7..aa95c7d7 100644 --- a/common/pdf_comic.cpp +++ b/common/pdf_comic.cpp @@ -64,12 +64,12 @@ QImage PdfiumComic::getPage(const int page) double width = (FPDF_GetPageWidth(pdfpage)/72)*150; double height = (FPDF_GetPageHeight(pdfpage)/72)*150; - image = QImage(width, height, QImage::Format_RGB888);// QImage::Format_RGBX8888); + image = QImage(width, height, QImage::Format_ARGB32);// QImage::Format_RGBX8888); image.fill(0xFFFFFFFF); - bitmap = FPDFBitmap_CreateEx(image.width(), image.height(), FPDFBitmap_BGR, image.scanLine(0), image.bytesPerLine()); + bitmap = FPDFBitmap_CreateEx(image.width(), image.height(), FPDFBitmap_BGRA, image.scanLine(0), image.bytesPerLine()); //TODO: make render flags costumizable - FPDF_RenderPageBitmap(bitmap, pdfpage, 0,0, image.width(), image.height(), 0, (FPDF_REVERSE_BYTE_ORDER | FPDF_LCD_TEXT)); + FPDF_RenderPageBitmap(bitmap, pdfpage, 0,0, image.width(), image.height(), 0, (FPDF_LCD_TEXT)); FPDFBitmap_Destroy(bitmap); FPDF_ClosePage(pdfpage); return image;