Drawing a string in Gdi+

NegativeZero

Member
Joined
Jan 23, 2005
Messages
11
ive been playing with

Dim BrPen As Pen = New Pen(Color.Brown, 4)

e.graphics.drawstring("test", ?????, brpen,10,10)

i dont know what to put for the font, and if i figure it out im not sure if the rest is right, can someone help me out =D thanks in adnvance
 
This should do the trick


Code:
Dim fnt As New Font("Arial", 20, FontStyle.Bold)
e.Graphics.DrawString("test", fnt, Brushes.Black, 10, 10)
 
My cheap solution (you dont have a create a new font for) would be just to pass the forms Font to .DrawString

e.Graphics.DrawString("test", Me.Font, Brushes.Black, 10F, 10F) :)
This would be better than creating a new font everytime you use drawstring though, but you could keep fnt in a public place so that you dont have to recreate it as well.
 
Back
Top