Yeah sure, only you need something to draw on first. For example a bitmap,
and then send that bitmap back to the browser. For example:
Bitmap _bmp = new Bitmap(250,250);
Graphics g = Graphics.FromImage(_bmp);
Pen _pen = new Pen(Brushes.Blue,10);
g.DrawLine(_pen,10,10,150,150);
_bmp.Save(Response.OutputStream, ImageFormat.Jpeg);
g.Dispose();
Only problem is that after calling the "_bmp.Save(Response.OutputStream,
ImageFormat.Jpeg);" al other controls which were on the page disappear. Mayb
someone can help me with that?
Cheers,
Gerben.
> can i use GDI+ to draw a line ( for example ) on a web
> page ( or a web form ) ?
>
> thanks for any help
>
> telbana2@yahoo.com
James Westgate \(Crainiate\) - 29 Dec 2003 13:46 GMT
Since an image on a page is a seperate http request, you can create an
imagewriter page and use that to process dynamic images. Set the src of a
normal image to an .aspx page eg
<img src='imagewriter.aspx?path=value'>
You may also have to set the content type to the image format eg jpeg
Response.ContentType = "image/jpg"
James

Signature
Create interactive flowcharts, diagrams and UML models with ERM3 at
http://www.crainiate.net
> Yeah sure, only you need something to draw on first. For example a bitmap,
> and then send that bitmap back to the browser. For example:
[quoted text clipped - 20 lines]
> >
> > telbana2@yahoo.com