Drawing with ASP

Himo

Regular
Joined
Dec 22, 2004
Messages
61
Location
the Netherlands
Hello,
I'm using this code to put a bitmap up the site, I want to center this bitmap, but the code prerequisites prevent me from doing so. If I don't put the response.clear in the Paint method, then the picture shows up as a bunch of gibber. Any tips on this?
BTW: How could I make this script that the circle is placed where the mouse clicks?

[CS]
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
Response.Write(Request.QueryString.Get("Username"));
Response.Write("<br><br><center>");
Paint();
Response.Write("Midden</center>End");
}

private void Paint()
{
Response.Clear();

Bitmap field = new Bitmap(640,480);
System.Drawing.Graphics webpage = Graphics.FromImage(field);
webpage.DrawEllipse(new Pen(Color.Blue,1),40,40,40,40);
field.Save(Response.OutputStream,System.Drawing.Imaging.ImageFormat.Jpeg);

webpage.Dispose();
field.Dispose();
Response.Flush();
}[/CS]
 
I drop the question. I just threw away everything I had and started over. Now I'll just make an offline application with a connection to a mysql database online. Suits my needs fine and is much easier :D
 
Back
Top