Hello
I was wondering if you guys could help me......
I have one textbox, image and one button on a page...... and when I click it
im trying to generate a pic and display it....
but I cant get the right datatype or anything for it to work..... im trying
to stream it.....
private void GeneratePic(string txt)
{
Font font = new Font("Impact", 144);
Image img = Image.FromFile(@"c:\inetpub\wwwroot\dbtest\goldwav e.jpg");
TextureBrush texture = new TextureBrush(img);
Bitmap tb = new Bitmap(500,250);
Graphics bmpGraphics = Graphics.FromImage(tb);
bmpGraphics.SmoothingMode = SmoothingMode.AntiAlias;
bmpGraphics.Clear(Color.White);
bmpGraphics.DrawString(txt, font, texture, 14, 10);
Response.ContentType = "image/jpeg";
tb.Save(Response.OutputStream, ImageFormat.Jpeg);
}
private void Button1_Click(object sender, System.EventArgs e)
{
if(Page.IsValid)
{
Image1.Visible = true;
Image1.ImageUrl = GeneratePic(TextBox1.Text);
}
}