system.drawing.printing 命名空间
printerSettings 打印机设置类
PageSettings 页面设置类
PrintPageEventArgs 要打印页的设置信息类
一、打印图片(加入控件printdocument1方法)
- PublicClassForm1
- PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.Click
- Try
- AddHandlerPrintDocument1.PrintPage,AddressOfMe.PrintGraphics
- PrintDocument1.Print()
- CatchexAsException
- MsgBox(ex.Message)
- EndTry
- EndSub
- PrivateSubPrintGraphics(ByValsenderAsObject,ByValevAsSystem.Drawing.Printing.PrintPageEventArgs)
- ev.Graphics.DrawImage(System.Drawing.Image.FromFile(TextBox1.Text),ev.Graphics.VisibleClipBounds)
- @H_404_71@ev.HasMorePages=False
- EndSub
- EndClass
?