Draw Line ---> Print
I have a question, I am new to VB .NET and I tired to Print out a Line. The line now shows on the screen, but not on the printer.
Thats the source i have by now.
Dim font1 As New Font("Arial", 12, GraphicsUnit.Pixel)
Dim gr As Graphics = Me.CreateGraphics
Dim myPen As New Drawing.Pen(Color.Black, 1)
gr.DrawString("Arial 12 Regular", font1, Brushes.Black, 20, 20)
Dim x1 As Single = 100.0F
Dim y1 As Single = 100.0F
Dim x2 As Single = 500.0F
Dim y2 As Single = 100.0F
Draw line to screen.
gr.DrawLine(myPen, x1, y1, x2, y2)
Dim count
yPos = topMargin + count * printFont.GetHeight(ev.Graphics)
ev.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, yPos, New StringFormat())
count += 1
End Sub
I have a question, I am new to VB .NET and I tired to Print out a Line. The line now shows on the screen, but not on the printer.
Thats the source i have by now.
Dim font1 As New Font("Arial", 12, GraphicsUnit.Pixel)
Dim gr As Graphics = Me.CreateGraphics
Dim myPen As New Drawing.Pen(Color.Black, 1)
gr.DrawString("Arial 12 Regular", font1, Brushes.Black, 20, 20)
Dim x1 As Single = 100.0F
Dim y1 As Single = 100.0F
Dim x2 As Single = 500.0F
Dim y2 As Single = 100.0F
Draw line to screen.
gr.DrawLine(myPen, x1, y1, x2, y2)
Dim count
yPos = topMargin + count * printFont.GetHeight(ev.Graphics)
ev.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, yPos, New StringFormat())
count += 1
End Sub