不是的,我要打印一个证书,在winform上划出一些基本的边框。
然后如何把这个打印出来?
然后如何把这个打印出来?
解决方案 »
- 在服务里访问映射盘
- 委托事件没反应
- Winform this.Activate();后 在任务栏狂闪,怎样真正恢复激活状态
- @@ 简单--在Windows 应用程序类似如何实现控制台中的Console.WriteLine,
- 紧急求助
- 如何向远程桌面传送ctrl+alt+del指令?
- 小弟今天面试,大侠帮看看吧
- 制作windows安装程序
- C# 处理图像,用哪些常用的类,函数之类的,请有经验的大哥,大姐们给我留几句。
- 请问怎么从C#的model类创建数据库表?
- 用C#写了一个winform的多线程ping程序,欢迎大家测试
- 怎样按HashTable或SortedList的value排序????而不是key
' Specifies what happens when the PrintPage event is raised.
Private Sub pd_PrintPage(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
Dim obj As Bitmap
Dim iData As IDataObject = Clipboard.GetDataObject()
' Determines whether the data is in a format you can use.
If iData.GetDataPresent(DataFormats.Bitmap) Then
obj = iData.GetData(DataFormats.Bitmap)
ev.Graphics.DrawImage(obj, _
obj.GetBounds(System.Drawing.GraphicsUnit.Pixel)) 'ev.Graphics.VisibleClipBounds)
End If
ev.HasMorePages = False
End Sub
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
'Printscreen
SendKeys.SendWait("%{PRTSC}")
' Assumes the default printer.
Dim pd As New PrintDocument()
AddHandler pd.PrintPage, AddressOf Me.pd_PrintPage
pd.DefaultPageSettings.Landscape = True
pd.Print()
Catch ex As Exception
MessageBox.Show("An error occurred while printing" & vbCrLf & _
ex.ToString(), "Error")
End Try
End Sub
End Class