fahadaijaz
Programmer
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
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