[Mono-bugs] [Bug 80765][Wis] New - Mono PreviewPrintController.Translation matrix result differs from the MS one in OnPrintPage

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Feb 8 10:36:48 EST 2007

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by vlad.dimitrov at gmail.com.


--- shadow/80765	2007-02-08 10:36:48.000000000 -0500
+++ shadow/80765.tmp.13351	2007-02-08 10:36:48.000000000 -0500
@@ -0,0 +1,71 @@
+Bug#: 80765
+Product: Mono: Class Libraries
+Version: 1.0
+OS: GNU/Linux [Other]
+OS Details: 
+Status: NEW   
+Priority: Wishlist
+Component: Sys.Drawing.
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: vlad.dimitrov at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Mono PreviewPrintController.Translation matrix result differs from the MS one in OnPrintPage
+Description of Problem:
+The PreviewPrintController object uses this code to initialize the 
+Translation matrix in the graphics object which is being passed to the 
+OnPrintPage method.
+g.ScaleTransform (e.PageSettings.PrinterResolution.X / 100.0f,
+e.PageSettings.PrinterResolution.Y / 100.0f);
+Steps to reproduce the problem:
+1. Create a custom class inheriting PrintDocument.
+2. Override OnPrintPage and get the ClipBounds property from the passed
+graphics object
+3. Create a new instance of that class and assign to the PrintController
+property a new instance of PreviewPrintController object.
+4. Call Print() of the custom PrintDocument object.
+Actual Results:
+The actualt reason for that bug is not that simple.
+1. When PrintDocument's Print() method is called it creates a Graphics
+object to pass to the virtual OnPrintPage method.
+2. That object is created by the OnStartPage method of the PrintController
+being used (in this case PreviewPrintController)
+3. PreviewPrintController does something strange while creating the
+Graphics object :
+g.ScaleTransform (e.PageSettings.PrinterResolution.X / 100.0f,
+e.PageSettings.PrinterResolution.Y / 100.0f);
+Which creates a transformation matrix for the graphics object (on my
+machine) like this:
+2 0
+0 2
+0 0
+Just for comaprison I tried the same code on MS.NET and the matrix was:
+1 0
+0 1
+0 0
+The printer used on both places is different (a fake one) but still I don't
+think MS uses that matrix this way in taht case.
+Expected Results:
+The matrix should be empty:
+1 0
+0 1
+0 0
+How often does this happen? 

More information about the mono-bugs mailing list