how to insert more bitmap graphics in a page?

Discussion in 'ASP .Net Web Controls' started by André, Dec 5, 2006.

  1. André

    André Guest

    Hi,

    I made a webform for a survey, with multiple-choice questions. The results
    of each question are put into tables, one table per question, like:
    values frequency
    1 6
    2 3
    3 32
    4 26
    5 12

    Now i want to add a graphic using the Namespace "System.Drawing" beside the
    table representing those values. So i
    use two files, the second containing the code for the graphic.
    I tried two ways: with a cookie (i know, not the best way) and with
    requeststring. Everything
    works, except that the second file has no time to create and render the
    graphic.
    This happens in a loop: the first table is made, then the cookie or
    requeststring is sent together with the reference to file 2 where the
    graphic is created, then next table etc ...

    My problem:
    When using a cookie, each graphic appears beside its table in file 1 but all
    with the
    values of the last table (the value of the last send cookie).
    When using a parameter, only the graphic of the last question is rendered
    (with the right values).

    I thing it's a matter of speed: file 2 has no enough time to produce and
    send the graphic to file 1
    Any way to solve this?


    Thanks
    André


    My code:

    file1: (with parameter)
    -----
    'valtopass is the string containing the values to pass with ':' as separator
    (e.g. 6:3:32:26:12)
    ....
    For j = 1 To numberoffield
    'create table
    ....
    gr.ImageUrl = "graf2.aspx?v1=" & valtopass
    form1.Controls.Add(gr)
    next
    ....

    file1: (with cookie)
    -----
    'valtopass is the string containing the values to pass with ':' as separator
    (e.g. 6:3:32:26:12)
    'cok = HttpCookie
    ....
    For j = 1 To numberoffield
    'create table
    ....
    cok.value=valtopass
    response.cookies.add(cok)
    next
    ....


    file2 (graphic)
    -----
    Dim objBitmap As New Bitmap(40 * l, 124)
    .....
    Response.ContentType = "image/gif"
    objBitmap.Save(Response.OutputStream, ImageFormat.Gif)
     
    André, Dec 5, 2006
    #1
    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. Charles A. Lackman

    Convert e.Graphics to an image or bitmap

    Charles A. Lackman, Jun 10, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    15,610
    logon68
    Feb 10, 2011
  2. Nathan Sokalski
    Replies:
    8
    Views:
    3,613
    Nathan Sokalski
    Dec 5, 2005
  3. Gandalf

    Masked bitmap from bitmap

    Gandalf, Jan 29, 2004, in forum: Python
    Replies:
    0
    Views:
    618
    Gandalf
    Jan 29, 2004
  4. xqggz
    Replies:
    1
    Views:
    456
    Victor Bazarov
    Jun 19, 2007
  5. =?Utf-8?B?cm9kY2hhcg==?=

    Graphics or Bitmap to screen

    =?Utf-8?B?cm9kY2hhcg==?=, Nov 6, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    353
    =?Utf-8?B?cm9kY2hhcg==?=
    Nov 6, 2007
Loading...

Share This Page