110,499
社区成员
发帖
与我相关
我的任务
分享
int printPage=0;
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
var i=printPage;
string bh = dt.Rows[i]["开剪布号"].ToString();
Bitmap[] maps = new Bitmap[2];
maps[0] = (Bitmap)zftuhxzh.GetDimensionalCode(bh);//字符串转二维码
maps[1] = (Bitmap)zftuhxzh.sss("成品号:"+bh, textBox40.Font);//字符串转图片
pictureBox1.Image = zftuhxzh.MergerImg(maps);//两张图片拼接
e.Graphics.DrawImage(pictureBox1.Image, 10, 20);
printPage++;
if ( dt.Rows.Count <= printPage)
{
e.HasMorePages = false;
}
else
{
e.HasMorePages = true; //重复调用PrintPage事件
}
}