User691546980 posted
Hello I Faced This problem and I solved it By creating a blank PNG image with fixed size and then load it in the code and write what ever I want to then save it (Note that the blank PNG background is transparent)
This is the code I used to make this operation
Dim MyFont As New Font("Arial", 9)
Dim Position As New PointF(5.0F, 5.0F)
Dim PNGimage As System.Drawing.Image
PNGimage = Image.FromFile(Server.MapPath("BlankImage.png"))
Dim graphics As Graphics
graphics = graphics.FromImage(PNGimage)
graphics.DrawString("test", MyFont, Brushes.Black, Position)
PNGimage.Save(Server.MapPath("WithTextImage.png"), ImageFormat.Png)
I hope this is helpful to you
regards