Last post Mar 11, 2010 09:12 AM by asmund
Feb 23, 2010 05:03 AM|naimish_hit|LINK
I want to display an image on a page with Image control on it.
I know this is very simple but tweak in my case is that image is available as a stream variable (which I am getting as a response from one of the server) instead of physical file.
Eventually I want to create a control for this with some other feature on it.
My question is how to assign "stream" variable to Image control?
Thanks in advance.
Feb 24, 2010 04:12 AM|Binary_Fiddle|LINK
I think the below thread will give you a fair idea for solving your problem.
Feb 24, 2010 04:21 AM|satalaj|LINK
You can refer this
In which format you are getting image from other server ? Is that BASE64 character string ?
Feb 25, 2010 12:14 AM|naimish_hit|LINK
Thanks to both of you.
Is there any other approach to achieve the same?
Reason I am asking for other approach is that I am trying to build SharePoint web part where lot of other things (web parts) will be there on page so approach suggested by you wont work in my case.
I am trying to develop a web part which will display image stream on web page.
Thanks in advance
Feb 25, 2010 12:21 AM|satalaj|LINK
Are you trying to embed image on web page in the form of BASE64 character string?
Feb 25, 2010 04:29 AM|naimish_hit|LINK
Not really - It will be like this,
I am stuck on item # 4!
Feb 25, 2010 04:40 AM|satalaj|LINK
Once you get the image in Binary format, you can convert it into BASE64 string
You can embed this BASE64 stream like this
Feb 25, 2010 05:27 AM|naimish_hit|LINK
"BASE6 4 and Embbedded Image" appraoch is not very reliable, it's browser dependent. Another issue with it is that it doesn't work properly if image size is big!
Anyways thanks for your support.
Feb 25, 2010 05:47 AM|satalaj|LINK
Do you want to hide the src of image? I mean do you don;t want end user to know from which server you are fetching
Have you created your Image Handler and its
context.Response.ContentType = "image/gif"; property like this ?
Feb 25, 2010 07:42 AM|naimish_hit|LINK
No, I don't want to hide src from my users, in fact they only will enter it on the page.
If we Write anything on page by using Response then it will clear all other things from it, which I definitely don't want. As I mentioned earlier, there are several other things on my page and this particular "Image Streamer" is going to be one of those
Mar 11, 2010 09:12 AM|asmund|LINK
Is the image stream coming correctly as a finished image from the server url you are requesting it? In that case you can just set the url to the call directly as source on the html image tag. It does not have to be url to a static image file, as long as
the url returns a valid image content stream with correct mime type in the header of the response stream.
<img src="http://the.site.that.generates.the.image/dynamicCreate?widht=50&height=50&some_other_parameters=test" alt="test" />