How to place a bitmap in a scrollable control?

Discussion in 'ASP .Net' started by Mathias, Nov 3, 2006.

  1. Mathias

    Mathias Guest

    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();
    }
    }
     
    Mathias, Nov 3, 2006
    #1
    1. Advertising

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

    Mathias wrote:
    > 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();
    > }
    > }
     
    donet programmer, Nov 3, 2006
    #2
    1. Advertising

  3. Mathias

    Mathias Guest

    I'll try that, once I find a way to add the bitmap to the panel :)
    Anyone?

    On 3 Nov 2006 14:01:55 -0800, "donet programmer" <>
    wrote:

    >You can probably try changing the style property on the panel and use
    >the css to specify scrollbars when size of control overflow ...
    >
    >Mathias wrote:
    >> 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 :)
     
    Mathias, Nov 4, 2006
    #3
  4. What is the problem? What do you expect and what do you observe?

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]


    "Mathias" <> wrote in message
    news:...
    > I'll try that, once I find a way to add the bitmap to the panel :)
    > Anyone?
    >
    > On 3 Nov 2006 14:01:55 -0800, "donet programmer" <>
    > wrote:
    >
    >>You can probably try changing the style property on the panel and use
    >>the css to specify scrollbars when size of control overflow ...
    >>
    >>Mathias wrote:
    >>> 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 :)
     
    Eliyahu Goldin, Nov 5, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gandalf

    Masked bitmap from bitmap

    Gandalf, Jan 29, 2004, in forum: Python
    Replies:
    0
    Views:
    614
    Gandalf
    Jan 29, 2004
  2. xqggz
    Replies:
    1
    Views:
    449
    Victor Bazarov
    Jun 19, 2007
  3. prasad srirambhatla
    Replies:
    2
    Views:
    329
    Teemu Keiski
    Aug 28, 2003
  4. orb1234

    scrollable treeview web control

    orb1234, Aug 25, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    163
    orb1234
    Aug 25, 2004
  5. Ashish Kaila

    Determining when a control is scrollable

    Ashish Kaila, Oct 25, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    101
    WALDO
    Oct 26, 2004
Loading...

Share This Page