S
Spacca
I'm developing a WebControl to display a button with an image... it is an
initial developing, my problem
is that i cant see it at design time...
here is my little code... :
i know that the problem is on HttpContext witch is null at design time....
any suggestion ?
protected override void Render( HtmlTextWriter writer)
{
System.Drawing.Image Img=
System.Drawing.Image.FromFile("c:\\0\\indice.jpg");
Graphics g=Graphics.FromImage (Img);
Pen p= new Pen (Color.Blue);
g.DrawLine (p,0,0,10,10);
System.Web.HttpContext http=System.Web.HttpContext.Current;
http.Response.Clear();
http.Response.ContentType="image/JPEG";
Img.Save(http.Response.OutputStream,
System.Drawing.Imaging.ImageFormat.Jpeg);
g.Dispose();
Img.Dispose();
http.Response.End();
}
initial developing, my problem
is that i cant see it at design time...
here is my little code... :
i know that the problem is on HttpContext witch is null at design time....
any suggestion ?
protected override void Render( HtmlTextWriter writer)
{
System.Drawing.Image Img=
System.Drawing.Image.FromFile("c:\\0\\indice.jpg");
Graphics g=Graphics.FromImage (Img);
Pen p= new Pen (Color.Blue);
g.DrawLine (p,0,0,10,10);
System.Web.HttpContext http=System.Web.HttpContext.Current;
http.Response.Clear();
http.Response.ContentType="image/JPEG";
Img.Save(http.Response.OutputStream,
System.Drawing.Imaging.ImageFormat.Jpeg);
g.Dispose();
Img.Dispose();
http.Response.End();
}