我正在将控件转换为位图并打印它:
using (MemoryStream ms = new MemoryStream()) { chart1.SaveImage(ms,ChartImageFormat.Bmp); Bitmap bm = new Bitmap(ms); PrintDocument doc = new PrintDocument(); doc.PrintPage += (s,ev) => { ev.Graphics.DrawImage(bm,Point.Empty); // adjust this to put the image elsewhere ev.HasMorePages = false; }; doc.Print(); }
如何指定以横向打印?
解决方法
doc.DefaultPageSettings.Landscape = true;
http://msdn.microsoft.com/en-us/library/system.drawing.printing.pagesettings.landscape.aspx