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. showing image from byte

showing image from byte

Scheduled Pinned Locked Moved ASP.NET
helpsysadminquestion
5 Posts 2 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.
  • S Offline
    S Offline
    samrat net
    wrote on last edited by
    #1

    Hello friend! i've faced a problem i want to show an image in server control. the image is in bytes. i want to show the image in the image control directly,i.e., without using any .aspx file to convert the byte in image. is there any way to achieve this? pls help me. thanks

    C 1 Reply Last reply
    0
    • S samrat net

      Hello friend! i've faced a problem i want to show an image in server control. the image is in bytes. i want to show the image in the image control directly,i.e., without using any .aspx file to convert the byte in image. is there any way to achieve this? pls help me. thanks

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      The only way to do this, is to write an http handler that sends the bytes down in response to a URL to that handler being placed in an img control. Unless you only want to show an image for the whole page, then just response.BinaryWrite

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      S 1 Reply Last reply
      0
      • C Christian Graus

        The only way to do this, is to write an http handler that sends the bytes down in response to a URL to that handler being placed in an img control. Unless you only want to show an image for the whole page, then just response.BinaryWrite

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        S Offline
        S Offline
        samrat net
        wrote on last edited by
        #3

        thanks for ur reply. but frankly speaking,i am new to .net so i can not understand what u mean. can u give me any coding sample?

        C 1 Reply Last reply
        0
        • S samrat net

          thanks for ur reply. but frankly speaking,i am new to .net so i can not understand what u mean. can u give me any coding sample?

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          There are articles on this site that cover this. If you type 'http handler image asp.net' into google, you find tons of info, more detailed than a forum reply. Basically you create a http handler ( it's an ashx from memory ) and in it, you read an id from the URL to load the image from the DB and use Response.BinaryWrite to stream it. Then your img tags link to that handler, with the right image Id in the URL. If you didn't understand what I just said, you are too new to be doing this task, take a step back, buy a book and work up to it.

          Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          S 1 Reply Last reply
          0
          • C Christian Graus

            There are articles on this site that cover this. If you type 'http handler image asp.net' into google, you find tons of info, more detailed than a forum reply. Basically you create a http handler ( it's an ashx from memory ) and in it, you read an id from the URL to load the image from the DB and use Response.BinaryWrite to stream it. Then your img tags link to that handler, with the right image Id in the URL. If you didn't understand what I just said, you are too new to be doing this task, take a step back, buy a book and work up to it.

            Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            S Offline
            S Offline
            samrat net
            wrote on last edited by
            #5

            thanks 4 ur help

            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