Results 1 to 5 of 5

Thread: Dynamic Images

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2002
    Location
    Manchester,UK
    Posts
    94

    Dynamic Images

    I'm using a .aspx style of dynamic image where I code in the PAGE_Load procedure of a page and set the contenttype to "image/png"

    It's working fine but calling the page_load procedure twice which is a quite expensive procedure.

    I can implement a cache of some sort but I'd rather know why it is requested twice.

    I've specified the image size in the <img> tag already which was my first suspect.

    Help!

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    Re: Dynamic Images

    It would help to see the code.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  3. #3
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Re: Dynamic Images

    Code:
    If Not IsPostBack Then
      ImageCode
    End If
    might help a little. You could also set a rendered flag stored in viewstate and only update the image if it is not rendered.... watch out for the no value(null) error that ViewState properties give if not initalized.

    I'm not sure why the load fires twice. You could move your code to Render or PreRender and see what happens.

    umm why png?
    Magiaus

    If I helped give me some points.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Apr 2002
    Location
    Manchester,UK
    Posts
    94

    Re: Dynamic Images

    The code is too long to post but the general design is a number of parameters are passed on the URL, an XML file containing stats is loaded and plotted in various styles in a chart. The procedure is entirely in Page_Load and is returned with in the response stream.

    I'll post some code tomorrow if that doesn't help diagnosing the problem at all.

    Thanks for the help so far, I'll try looking at the Render events.


    Edit: png was just so that I could easily produce a transparent background to the chart. Well, when I say easy I mean painfully awkward due to IE being annoying.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Apr 2002
    Location
    Manchester,UK
    Posts
    94

    Re: Dynamic Images

    Just for anyone with the same problem:

    Set the parameter AutoEventWireUp=False

    Dammit, why do some problems have to be so simple but take so long. 4 days that took!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width