开发者

How can I rotate an image in .NET and output it to the client as a PNG?

I have an .aspx file that outputs an image using the following methods:

 Server.MapPath("s开发者_如何学运维omefile.png")
 Response.ContentType = "image/png";
 Response.WriteFile(fileURI);

I have a function that rotates the image by 0-360 degrees and returns it as a bitmap.

How can I take this in-memory bitmap and then write it out to the client as a PNG?


var m = new MemoryStream();
bitmap.Save(m, ImageFormat.Png);
//might want to set correct mime type here.
Response.BinaryWrite(m.ToArray());
Response.End();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜