Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1
  • 2

TOPIC:

Added JPEG not appearing 2 years 9 months ago #15533

  • arlomedia
  • arlomedia's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 56
  • Thank you received: 1
Great, now the JPEG appears! And I can use this matrix to show it full-page:
Matrix(pageWidth.toFloat(), pageHeight.toFloat(), 0f, 0f)

Can I also use the matrix to rotate the image? I'm using this matrix to rotate annotations 90 degrees:
Matrix(0f, 1f, -1f, 0f, pageHeight.toFloat(), 0f)

But when I use that in the content.GSSetMatrix function above, the image doesn't appear. Even with this default matrix that doesn't do any rotation, the image doesn't appear:
Matrix(1f, 0f, 0f, 1f, 0f, 0f)

How do you recommend adding rotation to the code above?

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

Added JPEG not appearing 2 years 9 months ago #15534

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
the code:
Matrix(0f, 1f, -1f, 0f, pageHeight.toFloat(), 0f)
can only display 1 pixel on PDF page, you shall passs
Matrix(0f, height, -width, 0f, pageHeight.toFloat(), 0f)
 

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

Added JPEG not appearing 2 years 9 months ago #15535

  • arlomedia
  • arlomedia's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 56
  • Thank you received: 1
Oh, got it. For the record, this rotated the image 90 degrees counterclockwise:
Matrix(0f, height, -width, 0f, width, 0f)

And this rotated 90 degrees clockwise:
Matrix(0f, -height, width, 0f, 0f, height)

I have everything working as intended now. Thanks!

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

  • Page:
  • 1
  • 2
Powered by Kunena Forum