打印图片框图像基本问题 [英] print picturebox image basic question
本文介绍了打印图片框图像基本问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
我是桌面应用程序的新手.
i am new to desktop app.
我正在将tiff图像一张一张地加载到图片框中.我想要的是当用户单击打印"按钮时在图片框中打印当前图片(图像).
i am loading tiff images to picturebox one by one.what i want is to print the current picture(image) in picture box when the user clicks on the print button.
请帮帮我...
thnx
推荐答案
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim TmpPrntPicDoc As New System.Drawing.Printing.PrintDocument
AddHandler TmpPrntPicDoc.PrintPage, AddressOf TmpPrntPicDoc_PrintPage
Dim TempPPD As New System.Windows.Forms.PrintPreviewDialog
TempPPD.Document = TmpPrntPicDoc
TempPPD.ShowDialog()
End Sub
Private Sub TmpPrntPicDoc_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)
e.Graphics.DrawImage(PictureBox1.Image, 0, 0)
End Sub
这篇关于打印图片框图像基本问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文