我現在有這樣一段代碼
Dim MyPicGraphics As Graphics = PictureBox1.CreateGraphics
Dim PinkBrush As New SolidBrush(Color.Pink)
Dim BlackPen As New Pen(Brushes.Black) '采用默認的畫筆寬度值為1
'在表單上填充一個實心的橢圓
MyPicGraphics.FillEllipse(PinkBrush, New Rectangle(2, 2, 80, 50))
'在表單上繪制一個空心的橢圓
MyPicGraphics.DrawEllipse(BlackPen, New Rectangle(2, 2, 80, 50))
MyPicGraphics.DrawString("測驗文字", New Font("宋體", 20), New SolidBrush(Color.Blue), 50, 10)
這個Graphics繪制好了,但我現在想列印這個Graphics 內容
我直接用: PrintDocument1.Print() 打出來是空白的,應該怎么使用?
uj5u.com熱心網友回復:
要在printDouument1的graphics中再畫一遍Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
e.Graphics .FillEllipse (........)
End Sub
uj5u.com熱心網友回復:
'得到持久影像dim bmp as new bitmap(w,h)
Dim MyPicGraphics As Graphics = graphics.fromimage(bmp)
‘顯示
PictureBox1.backimage=bmp
'在printdoc中繪制bmp
e.graphics.drawimage(bmp........)
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/103367.html
標籤:VB.NET
上一篇:c#做的網頁,360瀏覽器兼容模式顯示不正常,什么問題
下一篇:C#用post方法用URL傳遞json資料,出現system.net.webexception:遠程服務器回傳錯誤:(500)內部服務器錯誤。
