How I can draw string to an (((image))) ?

Abudahim

Active member
Joined
Jan 25, 2004
Messages
34
Code:
 Public Sub DString(ByVal p As PictureBox)

        Dim imageRect As Rectangle = New Rectangle(0, 0, p.Image.Width, p.Image.Height)

        Dim G1 As Graphics

        G1 = p.CreateGraphics

        G1.DrawString("hola", New Font("Verdana", 24), Brushes.Black, p.Width / 2, p.Height / 2)

    End Sub


this code draw string on the picture box it self .
How I can draw the string to the image inside the picture box control and save the image with string .

thank you ..
 
Create the graphics object using the Graphics.FromImage method and pass in the Image property of the Picturebox.
 
thank you Mr mutant fot respond.
but can you give the Idea in a (code format) instead of explain it .
thank you ..
 
Did you try it? Its exactly has he says:
Create the graphics object using
GFX = Graphics.FromImage()
and pass in the Image property of the picturebox
GFX = Graphics.FromImage(PB.Image)

Use this Graphics object to draw to the string.
GFX.DrawString(...)
 
Back
Top