showing image from byte
-
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
-
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
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 )
-
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 )
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?
-
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?
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 )
-
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 )
thanks 4 ur help