Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
Help with DrawImageMatrix |
Post Reply ![]() |
Author | |
kaiken1987 ![]() Beginner ![]() ![]() Joined: 27 Jan 12 Location: United States Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() Posted: 12 Apr 12 at 7:34PM |
I'm trying to use DrawImageMatrix but I can't get the image to display.
I assume that the parameters work so that x' = x*m11+y*m12+mdxso if run with DrawImageMatrix(1,0,0,1,0,0) is should draw at the origin at its original size and orientation however nothing shows up in the output pdf. If I do a normal DrawImage it displays fine and DrawImageMatrix returns no error. example code QP->NewDocument(); |
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
The last two parameters are x,y so experiment with those first... The image will be scaled to 1pt x 1pt so increase the 1 values to width and height values. QP.DrawImageMatrix(100, 0, 0, 100, 300, 300);
Here is some code that generates an interesting pattern. This code is not mine so I cannot tell you how the parameters were created. QP.CompressImages(1); int ImageID = QP.AddImageFromFile("aldi.bmp", 0); QP.SelectPage(1); QP.SelectImage(ImageID); QP.DrawImageMatrix(100, 0, 0, 100, 300, 300); QP.DrawImageMatrix(152.44, 60.9762, -1.53974, 72.7334, 55.8672, 543); QP.DrawImageMatrix(151.872, 63.3877, -124.567, 98.8179, 179.203, 443.602); QP.DrawImageMatrix(154.612, 63.9774, -125.495, 75.8196, 179.204, 540.918); QP.DrawImageMatrix(153.172, 63.6644, 0, 98.6157, 178.163, 444.123); QP.SaveToFile("out.pdf"); Process.Start(@"out.pdf"); |
|
![]() |
|
fellafoo ![]() Team Player ![]() Joined: 21 May 22 Location: Simsbury, CT Status: Offline Points: 21 |
![]() ![]() ![]() ![]() ![]() |
In the Adobe PDF Reference, search for Common Transformations.
It's in section 8.3.3 of the PDF 1.7 document: For example: SetMeasurementUnits(0); Note: I've gotten unexpected results using millimeters or inches. For Translation (Move X / Move Y from Origin (Left, Bottom))... DrawImageMatrix(ImageWidth * 1, 0, 0, ImageHeight * 1, MoveX, MoveY) For Scaling (Enlarge X / Enlarge Y)... DrawImageMatrix(ImageWidth * Enlargement, 0, 0, ImageHeight * Enlargement, 0, 0) For Rotations (Counter-clockwise Angle around origin)... DrawImageMatrix(ImageWidth * Cos(Angle * Pi / 180), ImageWidth * Sin(Angle * Pi / 180), ImageHeight * - Sin(Angle * Pi / 180), ImageHeight * Cos(Angle * Pi / 180), 0, 0) For Skew (ImageWidth * 1, Tan(AngleX * Pi / 180), Tan(AngleY * Pi / 180), ImageHeight * 1, 0, 0) FWIW, MFM
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi :)
you should have a look at: SetOrigin: https://www.debenu.com/docs/pdf_library_reference/SetOrigin.php SetGlobalOrigin: https://www.debenu.com/docs/pdf_library_reference/SetGlobalOrigin.php SetMeasurementUnits: https://www.debenu.com/docs/pdf_library_reference/SetMeasurementUnits.php SetGlobalMeasurementUnits: https://www.debenu.com/docs/pdf_library_reference/SetGlobalMeasurementUnits.php This are functions from the measurement and coordinate unit: https://www.debenu.com/docs/pdf_library_reference/SetGlobalMeasurementUnits.php Think there you'll find a solution for your issues... |
|
Cheers,
Ingo |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store