【发布时间】:2009-06-27 05:42:38
【问题描述】:
.NET 库在调整看起来很棒的图像大小方面做得很好:
Bitmap newImage = new Bitmap(newWidth, newHeight);
using (Graphics gr = Graphics.FromImage(newImage))
{
gr.InterpolationMode = InterpolationMode.HighQualityBilinear;
gr.DrawImage(srcImage, new Rectangle(0, 0, newWidth, newHeight));
}
我在网上看到的解决方案遇到的一个问题是,它们去除了嵌入在这些图像中的元数据。有没有办法将此数据移动到新图像?还是使用原始图像并保留此数据?
如果可能的话,我希望仅使用 Microsoft 的内置 .NET 库来保留此解决方案。
【问题讨论】: