瀏覽代碼

2006-08-02 Chris Toshok <[email protected]>

	* PreviewPrintController.cs: scale the Graphics context we pass
	back from OnStartPage such that the preview looks the way the
	printed output will.


svn path=/trunk/mcs/; revision=63258
Chris Toshok 19 年之前
父節點
當前提交
a0780d5bbb

+ 6 - 0
mcs/class/System.Drawing/System.Drawing.Printing/ChangeLog

@@ -1,3 +1,9 @@
+2006-08-02  Chris Toshok  <[email protected]>
+
+	* PreviewPrintController.cs: scale the Graphics context we pass
+	back from OnStartPage such that the preview looks the way the
+	printed output will.
+
 2006-07-28  Carlos Alberto Cortez <[email protected]>
 
 	* PrintDocument.cs: When null is passed to PrinterSettings,

+ 2 - 0
mcs/class/System.Drawing/System.Drawing.Printing/PreviewPrintController.cs

@@ -86,6 +86,8 @@ namespace System.Drawing.Printing
 			Graphics g = Graphics.FromImage (info.Image);
 			g.FillRectangle (new SolidBrush (Color.White), new Rectangle (new Point (0,0), new Size (image.Width, image.Height)));
 
+			g.ScaleTransform (e.PageSettings.PrinterResolution.X / 100.0f, e.PageSettings.PrinterResolution.Y / 100.0f);
+
 			return g;
 		}