Click to See Complete Forum and Search --> : adding text in picture


aamir55
September 15th, 2008, 10:23 AM
i want to add text on the picture
i have three forms
form1 for opening picture
form2 for displaying and this contains one picturebox
form3 for add text
form3 has a button and a text field
i enter the text in text field and press the button but text is not added
code for adding text

Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Dim addText As String
addText = txtAdd.Text
Form2.PictureBox1.CreateGraphics.DrawString(addText, New Font("Arial", FontStyle.Bold), Brushes.Black, 10, 25)
Form2.PictureBox1.Refresh()
Me.Close()
End Sub


plz tell me where i m wrong
see the attachment also
thanks

dglienna
September 16th, 2008, 01:59 AM
Do what you need to do in the PAINT() event of the control, and when you want it to happen, call control.Invalidate (which will call Paint)

You'd load the picture if the text was blank, or add the text on top of the picture after it was loaded.)