28,391
社区成员
发帖
与我相关
我的任务
分享
System.Drawing.Image image = System.Drawing.Image.FromFile(Server.MapPath("Image/avchd-moonwalker.1988.720p.bluray.x264.mkv0001.jpg"));
Graphics g = Graphics.FromImage(image);
g.DrawImage(image, 0, 0, 640, 480);
System.Drawing.Image image = System.Drawing.Image.FromFile(Server.MapPath("Image/avchd-moonwalker.1988.720p.bluray.x264.mkv0001.jpg"));
System.Drawing.Imaging.ImageFormat thisFormat = image.RawFormat;
Bitmap bitMap = new Bitmap(image, 640, 480);
if (thisFormat.Equals(System.Drawing.Imaging.ImageFormat.Gif))
{
Response.ContentType = "image/gif";
}
else
{
Response.ContentType = "image/jpeg";
}
bitMap.Save(Response.OutputStream, thisFormat);
image.Dispose();
bitMap.Dispose();