Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Windows 8.1, 10, WindowsPhone, Windows UWP
  • Page:
  • 1
  • 2

TOPIC:

NewImageJPEG always returns nullptr 6 years 8 months ago #6701

  • Einstein
  • Einstein's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 19
  • Thank you received: 0
PDFMatrix mat = new PDFMatrix(m_scale, -m_scale, 0, m_dibh);
In which units should m_dibh be specified? I discovered that if I put my document's height converted to device-independent pixels (DIP), the generated image is positioned too low.

When trying to render a 1405 x 1987 image, with the identity matrix, the point x: 0, y: 0 in not in the left bottom corner but somewhere on the left edge.

Please Log in or Create an account to join the conversation.

Last edit: by tien4720.

NewImageJPEG always returns nullptr 6 years 8 months ago #6703

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1043
  • Thank you received: 63
full codes like this:
m_dibw = m_scale * Page.Width;//Page.Width is in PDF coordinate.
m_dibh = m_scale * Page.Height//Page.Height is in PDF coordinate.
Matrix mat = new Matrix( m_scale, -m_scale, 0, m_dinh );

m_dib_tmp = new WriteableBitmap(m_dibw, m_dibh);
int[] pixels = m_dib_tmp.Pixels;

Page.Render(pixels, m_dibw, m_dibh, mat, true, PDFView.renderQuality);

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Powered by Kunena Forum