Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. problem with generating dynamic images

problem with generating dynamic images

Scheduled Pinned Locked Moved ASP.NET
graphicshelpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Amar_Infowave
    wrote on last edited by
    #1

    I,m trying to generate 5 dynamic images with the user name on the run-time using system.drawing.imaging. Creation of images is done in a separate aspx file named dynImg.aspx. From a new aspx file , i'm calling the dynImg.aspx file with the name parameter. Below is the code i'm using: for i= 1 to 5 response.write("") next My problem is, i'm able to generate only one image. Unable to load the other images. Need a solution for this imediately?????

    T J 2 Replies Last reply
    0
    • A Amar_Infowave

      I,m trying to generate 5 dynamic images with the user name on the run-time using system.drawing.imaging. Creation of images is done in a separate aspx file named dynImg.aspx. From a new aspx file , i'm calling the dynImg.aspx file with the name parameter. Below is the code i'm using: for i= 1 to 5 response.write("") next My problem is, i'm able to generate only one image. Unable to load the other images. Need a solution for this imediately?????

      T Offline
      T Offline
      tojamismis
      wrote on last edited by
      #2

      The img tag only accepts image files. Since you are passing it a web page it is getting confused. Make your aspx into dymImg.ascx. Expose a public String in the class called Name. Then dynamically load the ascx into your web page in the 5 locations you need it. Use the public "Name" field in the ascx, and then render the controls on the screen. This should give you the desired result. Torin Blair
      'In the immortal words of Socrates - "I drank what?".'

      J 1 Reply Last reply
      0
      • T tojamismis

        The img tag only accepts image files. Since you are passing it a web page it is getting confused. Make your aspx into dymImg.ascx. Expose a public String in the class called Name. Then dynamically load the ascx into your web page in the 5 locations you need it. Use the public "Name" field in the ascx, and then render the controls on the screen. This should give you the desired result. Torin Blair
        'In the immortal words of Socrates - "I drank what?".'

        J Offline
        J Offline
        Jesse Squire
        wrote on last edited by
        #3

        tojamismis wrote: The img tag only accepts image files. Since you are passing it a web page it is getting confused. Sorry, but this is not true. The img tag will accept and process any URI specified in its src attribute. As long as the stream returned is an image stream, with proper headers, it will display just fine. Google will yield plenty of results, if you'd like more information, but here is a proof of concept[^] to prove the point. Note the source of the image in the HTML. That being said, using a .aspx page is going to be much slower then implementing an HTTP handler to field the requests, and caching strategy will play a big part in response time. Dino Esposito wrote a nice article[^] on dynamic image generation. Hope that helps. :) --Jesse

        1 Reply Last reply
        0
        • A Amar_Infowave

          I,m trying to generate 5 dynamic images with the user name on the run-time using system.drawing.imaging. Creation of images is done in a separate aspx file named dynImg.aspx. From a new aspx file , i'm calling the dynImg.aspx file with the name parameter. Below is the code i'm using: for i= 1 to 5 response.write("") next My problem is, i'm able to generate only one image. Unable to load the other images. Need a solution for this imediately?????

          J Offline
          J Offline
          Jesse Squire
          wrote on last edited by
          #4

          I'm not sure that I'm clear on what results you are seeing. Are you seeing 1 total image, or 5 of the same image? Here are a few thoughts that hit me looking at your snipit. It would probably help to have some additional information.

          • Is the variable name being initialized somewhere?
          • Does name represent a legal value to your image server?
          • It doesn't appear that you are changing name in your loop... so if you are seeing 5 of the same image, that could be a reason why.
          • Do you see 5 img tags in the HTML that is rendered to the browser?

          That should be enough to get started. That being said, using a .aspx page is going to be much slower then implementing an HTTP handler to field the requests, and caching strategy will play a big part in response time. Dino Esposito wrote a nice article[^] on dynamic image generation that may give you some inspiration. Hope that helps. :) --Jesse

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups