打印在横向的形象呢? [英] printing an image in landscape orientation?
本文介绍了打印在横向的形象呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我转换控制位图,打印:
使用(MemoryStream的毫秒=新的MemoryStream())
{
chart1.SaveImage(MS,ChartImageFormat.Bmp);
位图BM =新位图(MS);
PrintDocument的文档=新的PrintDocument();
doc.PrintPage + =(S,EV)=>
{
ev.Graphics.DrawImage(BM,Point.Empty); //调整此把图像别处
ev.HasMorePages = FALSE;
};
doc.Print();
}
您
如何指定横向打印?
解决方案
doc.DefaultPageSettings.Landscape = TRUE;
<一个href="http://msdn.microsoft.com/en-us/library/system.drawing.printing.pagesettings.landscape.aspx">http://msdn.microsoft.com/en-us/library/system.drawing.printing.pagesettings.landscape.aspx
I am converting a control to a bitmap and print it:
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();
}
How can you specify to print it in landscape orientation?
解决方案
doc.DefaultPageSettings.Landscape = true;
http://msdn.microsoft.com/en-us/library/system.drawing.printing.pagesettings.landscape.aspx
这篇关于打印在横向的形象呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文