sinergy Posted June 3, 2003 Posted June 3, 2003 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 Quote
aewarnick Posted June 5, 2003 Posted June 5, 2003 Putting graphics on a PrintDocument is just like putting graphics on a screen. You have to draw it on the PrintDocument where you want it. Quote C#
ThePentiumGuy Posted June 7, 2003 Posted June 7, 2003 what do you mean by Dim x1 As Single = 100.0F Dim y1 As Single = 100.0F Dim x2 As Single = 500.0F Dim y2 As Single = 100.0F the F's at the end of the numbers Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
*Experts* mutant Posted June 7, 2003 *Experts* Posted June 7, 2003 F stands for Floating point. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.