即使大图像,加载的缩略图也不会旋转
|
我正在编写一个程序,在该程序中必须先加载缩略图图像,然后再进行处理。
img = Image.FromFile(file_path);
int img_w = img.Width;
int img_h = img.Height;
int desired_size = 150;
int img_h1 = desired_size;
double resize = (double)img_h / (double)img_w;
resize = (double)desired_size * resize;
img_h1 = (int)resize;
thumb = img.GetThumbnailImage(desired_size, img_h1, null, IntPtr.Zero);
此代码加载图像,然后创建缩略图。
相机拍摄的一些照片被旋转了,所以我在IrfanView中将它们旋转了90度。即使这样,我的C#应用程序中加载的缩略图仍然旋转错误(可以放大图像)。
如何解决此问题?
没有找到相关结果
已邀请:
1 个回复
穗揣