Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Display an Image Via Stream On Webpart?

Status
Not open for further replies.

fahadaijaz

Programmer
Nov 16, 2004
1
DE
I want to display an image via stream on the webpart. What I do is simply get the image from the web into the stream. Perform some image processing on it and now I want to display this processed image on the webpart.

This is the code I wrote:

protected override void RenderWebPart(HtmlTextWriter output)
{
HttpResponse res = new HttpResponse(output);
res.ContentType = "image/jpeg";
WebClient client = new WebClient();

//Image processing directly from the stream.......
stream = client.OpenRead(url_1);
b = new Bitmap(stream);
wpImageProcessor.greyScale(b);

res.Write(stream);
}

As an output I simply get the name of the stream printed on the webpart. Can any one plz help me in this case. I need to solve this issue urgently.

Regards,

Fahad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top