Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

Page.RenderToBmp(Bitmap bitmap, Matrix mat) create weird bitmap

More
IP: 60.250.135.18 8 years 1 week ago #14113 by ericatudn
Hello.
Please forgive my bad English.
When calling Page.RenderToBmp(Bitmap bitmap, Matrix mat), a weird bitmap was created, see attachment "weird_bitmap.jpg".
The origin PDF files is "test.PDF" (page 2), see attachment. This file is actually from your test project.
My java code:

//=============================================
private PDFLayoutView m_view = null;
private Document m_doc = null;
...
private Bitmap getBitmap()
{
int pageNo = m_view.PDFGetCurrPage();

float x = 0;
float y = m_doc.GetPageHeight(pageNo);

Matrix matrix = new Matrix(1, -1, x, y);

int width = (int) m_doc.GetPageWidth(pageNo);
int height = (int) m_doc.GetPageHeight(pageNo);

Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);

m_doc.GetPage(pageNo).RenderToBmp(bitmap, matrix);

matrix.Destroy();

return bitmap;
}
//=============================================

Thank you very m

This browser does not support PDFs. Please download the PDF to view it: Download PDF

uch.
More
IP: 203.69.6.99 7 years 11 months ago #14163 by ericatudn
Hello, any advice for my question?
Thank you very much.
More
Time to create page: 0.452 seconds
Powered by Kunena Forum