G
Gerben van Loon
Hi,
Hope someone can help me on this. I like to make an own ASP.NET charting
control, so I need to render some graphics in a custom made control. I
already found this example which sends back a bitmap from the control to the
page:
Page.Response.Clear();
Page.Response.ContentType = "image/jpeg";
myBitmap.Save(Page.Response.OutputStream, ImageFormat.Jpeg);
But the problem with this is that the graphics drawn are not visible at
design time in Visual Studio. And the Page.Response.Clear() removes all
other controls on the page where I'm using the self made control.
Some other solution I thought about is inheriting my control from the
"System.Web.UI.WebControls.Image" control. In that control I could do the
following:
bmp.Save(Page.Server.MapPath("temp.png"),ImageFormat.Png);
this.ImageUrl = "temp.png"; //Set the imageUrl property of the image
control
I this way the graphics are directly shown in Visual Studio. But the problem
is that you have to temporarily write away a file to the hard disk, so also
this solution isn't ideal.
Someone knows how I can solve one of my solutions, or maybe got another
solution for my problem?
Cheers,
Gerben.
Hope someone can help me on this. I like to make an own ASP.NET charting
control, so I need to render some graphics in a custom made control. I
already found this example which sends back a bitmap from the control to the
page:
Page.Response.Clear();
Page.Response.ContentType = "image/jpeg";
myBitmap.Save(Page.Response.OutputStream, ImageFormat.Jpeg);
But the problem with this is that the graphics drawn are not visible at
design time in Visual Studio. And the Page.Response.Clear() removes all
other controls on the page where I'm using the self made control.
Some other solution I thought about is inheriting my control from the
"System.Web.UI.WebControls.Image" control. In that control I could do the
following:
bmp.Save(Page.Server.MapPath("temp.png"),ImageFormat.Png);
this.ImageUrl = "temp.png"; //Set the imageUrl property of the image
control
I this way the graphics are directly shown in Visual Studio. But the problem
is that you have to temporarily write away a file to the hard disk, so also
this solution isn't ideal.
Someone knows how I can solve one of my solutions, or maybe got another
solution for my problem?
Cheers,
Gerben.