主题:缩略图生成问题
请大家帮我看看这段程序到底是那里有错,先谢谢了啊
System.Drawing.Image image, newImage;
int width, height, newWidth, newHeight;
System.Drawing.Image.GetThumbnailImageAbort callB = null;
image = System.Drawing.Image.FromFile(Server.MapPath("images/1.jpg"));
width = image.Width;
height = image.Height;
if (width > height)
{
newWidth = 100;
newHeight = height / width * 100;
}
else
{
newHeight = 100;
newWidth = width / height * 100;
}
newImage = image.GetThumbnailImage(newWidth, newHeight, callB, new System.IntPtr());
newImage.Save(Server.MapPath("images/1s.jpg"));
newImage.Dispose();
image.Dispose();
老是提示说内存不足,请大家指点
System.Drawing.Image image, newImage;
int width, height, newWidth, newHeight;
System.Drawing.Image.GetThumbnailImageAbort callB = null;
image = System.Drawing.Image.FromFile(Server.MapPath("images/1.jpg"));
width = image.Width;
height = image.Height;
if (width > height)
{
newWidth = 100;
newHeight = height / width * 100;
}
else
{
newHeight = 100;
newWidth = width / height * 100;
}
newImage = image.GetThumbnailImage(newWidth, newHeight, callB, new System.IntPtr());
newImage.Save(Server.MapPath("images/1s.jpg"));
newImage.Dispose();
image.Dispose();
老是提示说内存不足,请大家指点