I need something to do where I stored bmp images for alphabets and numbers and i call call those images when i type it in textbox.
i have a sample code like
Expand|Select|Wrap|Line Numbers
- Public Class Form1
- Dim graph As Graphics
- Dim g, g1 As System.Drawing.Graphics
- Dim img As New Bitmap(144, 16)
- Dim brush As New Drawing.SolidBrush(Color.Black)
- Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
- g1 = Graphics.FromImage(img)
- PictureBox1.Image = img
- ' to clear the bitmap
- g1.Clear(Color.White)
- 'for drawsting function
- g1.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
- g1.TextRenderingHint = Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit
- g1.CompositingQuality = Drawing2D.CompositingQuality.HighQuality
- 'to draw string
- g1.DrawString(TextBox1.Text, TextBox1.Font, Brushes.Black, 0, 0)
- PictureBox1.SizeMode = PictureBoxSizeMode.Normal
- PictureBox1.Refresh()
- End Sub
- End Class
Expand|Select|Wrap|Line Numbers
- Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
- Dim file As String = String.Format("{0}\{1}.bmp", Application.StartupPath, e.KeyChar.ToString)
- If System.IO.File.Exists(file) Then
- PictureBox1.ImageLocation = file
- Else
- PictureBox1.ImageLocation = String.Empty
- End If
- End Sub
and aslo i could not call more than one bmp image in mypicturebox..
can any one help me..