Advertisement
I followed a tutorial for drawing graphics in an asp page but there is an error.(may look familiar)
Here's my page_Load code:
Response.ContentType = "image/jpeg";
Bitmap objBitmap;
Graphics objGraphics;
objBitmap = new Bitmap(200, 200);
objGraphics = Graphics.FromImage(objBitmap);
objGraphics.DrawLine(new Pen(System.Drawing.Color.Red), 0, 0, 200, 200);
objBitmap.Save(Response.OutputStream, ImageFormat.Gif);
objBitmap.Dispose();
objGraphics.Dispose();
the error is : the image " http://localhost:1653/Default.aspx \" cannot be displayed because of an error.
What is missing that is causing the problem?
Do I actually have to have an image load from someplace?
I'm not trying to do html text at the same time.
Here's my page_Load code:
Response.ContentType = "image/jpeg";
Bitmap objBitmap;
Graphics objGraphics;
objBitmap = new Bitmap(200, 200);
objGraphics = Graphics.FromImage(objBitmap);
objGraphics.DrawLine(new Pen(System.Drawing.Color.Red), 0, 0, 200, 200);
objBitmap.Save(Response.OutputStream, ImageFormat.Gif);
objBitmap.Dispose();
objGraphics.Dispose();
the error is : the image " http://localhost:1653/Default.aspx \" cannot be displayed because of an error.
What is missing that is causing the problem?
Do I actually have to have an image load from someplace?
I'm not trying to do html text at the same time.
Advertisement
Advertisement
-
-
Re: graphics in ASP.NET
08/11Thanks for checking that out, however--I could use a little help in determining why it doesn't run for me. -
-
Unsu...
Re: graphics in ASP.NET
08/12do have custom errors = true in your web.config ?
what about putting the whole thing in a try catch block and see if throws an exception
is this in a master page by chance?
what does the aspx page look like? -
-
Re: graphics in ASP.NET
08/12I figured it out...hadn't set correct start page.
-
-
-