The src
of the image is a server side page that renders an image:
So what you want to do is to set the src to an aspx-page with the input text as a querystring. From that you create a graphics object, and use the font to draw the specified text onto that
excerpt from article
private void button4_Click(object sender, System.EventArgs e)
{
Graphics grf = this.CreateGraphics();
try
{
grf.Clear(Color.White);
using (Font myFont = new Font("Arial", 14))
{
grf.DrawString("Hello .NET Guide!", myFont, Brushes.Green, new PointF(10, 100));
}
}
finally
{
grf.Dispose();
}
}
After that, you need to do a Response.Clear()
so that you don't get any other text content rendered, and set Response.ContentType = "image/jpeg";
(or whatever content type you'll be using), and then write your image to the response output buffer.