How can I write on an image using VB.NET?

Ataur Rahman Chowdhury picture Ataur Rahman Chowdhury · Nov 5, 2011 · Viewed 8.5k times · Source

Can anyone help me out how could I load an Image from my computer and write on the picture using VB.net [ 2008 ]. Then text will show only when the mouse is hovered on the location where text is written. I want to write down the location of the picture for say. Please help me with code block, because here you are talking with a noob. thank you

Answer

Marco picture Marco · Nov 5, 2011

You can load an image from your pc using:

Dim img as Image = Image.FromFile(your_file_name)

Then you can draw text on image using:

Dim gr As Graphics = Graphics.FromImage(img)
gr.DrawString("Drawing text", _
              New Font("Tahoma", 14), _
              New SolidBrush(Color.Green), _
              10,10)
gr.Dispose()