|
Stubborn font
|
Jamil Youcef
|
Oct 28, 2008 07:31 PST
|
Public Class Form1
Dim Image As Bitmap
Dim ImageBuffer As Graphics
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Image = New Bitmap(PictureBox1.Width, PictureBox1.Height)
ImageBuffer = Graphics.FromImage(Image)
End Sub
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
e.Graphics.DrawImage(Image, 0, 0)
End Sub
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar = Chr(13) Then
e.Handled = True
ImageBuffer.DrawString(TextBox1.Text, TextBox1.Font, Brushes.Black, PictureBox1.Width / 2, 100)
PictureBox1.CreateGraphics.DrawImage(Image, 0, 0)
End If
End Sub
End Class
Please if someone can try the above code and tell me if the displayed text on the picture box has the same font as in the text box. At my end its kind of bold, I can't figure out the problem but I doubt my system.
_________________________________________________________________
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE
|
|
 |
|