How to place a bitmap in a scrollable control?

M

Mathias

I have the following code that generates a bitmap on which I'm drawing
a graph. The graph has one point for each minute in a day so the
bitmap is 1440 pixels in height. Therefore I'd like to place the
bitmap in a scrollable control. I tried with a panel

Panel panel = new Panel();
panel.Controls.Add(bitmap);

but it doesn't work. So, can anyone tell me how to do it or point me
in the right direction? Thanks :)

public partial class _Graph : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DrawGraph();
}

void DrawGraph()
{
Bitmap bitmap = new Bitmap(500, 1440);

Graphics graphics;
graphics = Graphics.FromImage(bitmap);
graphics.Clear(Color.White);

// Draw graph here

Response.ContentType = "image/jpeg";
bitmap.Save(Response.OutputStream, ImageFormat.Jpeg);

bitmap.Dispose();
}
}
 
D

donet programmer

You can probably try changing the style property on the panel and use
the css to specify scrollbars when size of control overflow ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top