由网友(住进你心里)分享简介:我转换控制位图,打印:使用(MemoryStream的毫秒=新的MemoryStream()){chart1.SaveImage(MS,ChartImageFormat.Bmp);位图BM =新位图(MS);PrintDocument的文档=新的PrintDocument();doc.PrintPage + =(S,...
我转换控制位图,打印:
使用(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;
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
相关推荐
最新文章