我有一个图像,我正在将图像调整为缩略图大小
但是如果我使用大小为 [1100*1200] 原始大小 的图像,它会将图像调整为缩略图,但与其他缩略图图像的大小不匹配
当在 listview 控件中显示时, 所有尺寸在 [700* 600] 中的图像都以一种尺寸显示
尺寸为 [1100* 1200] 的图像以一种尺寸显示[比其他图像略小]
所以当我在列表视图控件中显示图像时,这看起来所有 10 个图像都以一种尺寸显示,但一个图像以较小的尺寸显示
有时所有图像都加载得很好
但有些图片没有显示 仅有几张图片 10 张图片 2 张图片未显示
System.Drawing.Image objImage = System.Drawing.Bitmap.FromFile(System.Web.HttpContext.Current.Server.MapPath(@"Images\" + sImageFileName));
if (sImageFileName != null)
{
if (iThumbSize == 1)
{
dHeight = objImage.Height;
dWidth = objImage.Width;
dNewHeight = 100;
dNewWidth = 100;
objImage = objImage.GetThumbnailImage((int)dNewWidth, (int)dNewHeight, new System.Drawing.Image.GetThumbnailImageAbort(callback), new IntPtr());
}
这是我正在使用的代码我将大小高度和宽度设置为 100
任何帮助都会非常感谢