需求:给固定分辨率的图片,批量添加一些我自己做好的png相框素材,生成合成图后,并指定某个打印机进行打印
解决思路,把图片放到专业报表里打印:http://www.foxtable.com/webhelp/topics/1588.htm:
Dim imgback As image = getimage("d:\a.png") '主图 Dim bmp As new bitmap(imgback.width, imgback.height) Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(bmp) g.DrawImage(imgback, 0, 0, imgback.Width, imgback.Height) '绘制主图' Dim img = GetImage("d:\b.png") '获取副图片 Dim x As Integer = imgback.Width - 120 '副图距离主图左边距 Dim y As Integer = imgback.height - 120 '副图距离主图上边距 g.DrawImage(img, x, y, 100, 100) '绘制第二张图片 bmp.Save("d:\c.jpg") '保存 bmp.dispose '释放资源'