C# 二维码的打印

阅读: 评论:0

void pd_PrintPage(object sender, PrintPageEventArgs e)
{
Image temp = pictureBox1.Image;
int x = e.MarginBounds.X;
int y = e.MarginBounds.Y;
int width = temp.Width;
int height = temp.Height;
Rectangle destRect = new Rectangle(x, y, width, height);
e.Graphics.DrawImage(temp, destRect, 0, 0, temp.Width, temp.Height, System.Drawing.GraphicsUnit.Pixel);
}
private void button1_Click(object sender, EventArgs e)
太阳能沼气池{
PrintPreviewDialog ppd = new PrintPreviewDialog(); 铝条板吊顶
PrintDocument pd = new PrintDocument();
防盗电子狗
Margins margin = new Margins(20, 20, 20, 20);
pd.DefaultPageSettings.Margins = margin;
pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
ppd.Document = pd;
ppd.ShowDialog();
try
{
移动消防泵pd.Print();
}金玻璃
catch (Exception ex)
{
矩阵切换
MessageBox.Show(ex.Message, "打印出错", MessageBoxButtons.OK, MessageBoxIcon.Error);
pd.PrintController.OnEndPrint(pd, new PrintEventArgs());
}
}

本文发布于:2023-06-20 06:14:41,感谢您对本站的认可!

本文链接:https://patent.en369.cn/patent/3/145609.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:沼气池   铝条   防盗   移动
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 369专利查询检索平台 豫ICP备2021025688号-20 网站地图