c# 打印panel内容模糊怎么办?代码如下:
//打印每页的panelpublicvoidSettingReportPage(Controlcon,Graphicsg,inty){Bitmapbp=newBitmap...
//打印每页的panel
public void SettingReportPage(Control con, Graphics g, int y)
{
Bitmap bp = new Bitmap(con.Width, con.Height );
bp.SetResolution(3000, 3000); //分辨率
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.SmoothingMode = SmoothingMode.HighQuality;
g.PixelOffsetMode = PixelOffsetMode.Half;
g.CompositingQuality = CompositingQuality.HighQuality;
g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
Rectangle rect1;
rect1 = new Rectangle(0, 0, bp.Width, bp.Height);
con.DrawToBitmap(bp, rect1);
g.DrawImage(bp, (int)con.Location.X+9, y, bp.Width, bp.Height);
} 展开
public void SettingReportPage(Control con, Graphics g, int y)
{
Bitmap bp = new Bitmap(con.Width, con.Height );
bp.SetResolution(3000, 3000); //分辨率
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.SmoothingMode = SmoothingMode.HighQuality;
g.PixelOffsetMode = PixelOffsetMode.Half;
g.CompositingQuality = CompositingQuality.HighQuality;
g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
Rectangle rect1;
rect1 = new Rectangle(0, 0, bp.Width, bp.Height);
con.DrawToBitmap(bp, rect1);
g.DrawImage(bp, (int)con.Location.X+9, y, bp.Width, bp.Height);
} 展开
展开全部
1.新建窗口Form1,在桐腔上面拖1个Panel,1个Button,1个printDocument,1个printDocument1
2.在Form1.cs中写入代码陪备:
private void printDocument1_PrintPage_1(object sender, PrintPageEventArgs e)
{
//局乱衫打印内容 为 局部的 this.panel1
Bitmap _NewBitmap = new Bitmap(panel.Width, panel.Height);
panel.DrawToBitmap(_NewBitmap, new Rectangle(0, 0
2.在Form1.cs中写入代码陪备:
private void printDocument1_PrintPage_1(object sender, PrintPageEventArgs e)
{
//局乱衫打印内容 为 局部的 this.panel1
Bitmap _NewBitmap = new Bitmap(panel.Width, panel.Height);
panel.DrawToBitmap(_NewBitmap, new Rectangle(0, 0
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询