【问题标题】:Resize an image in windows phone with out losing its quality在 Windows Phone 中调整图像大小而不会丢失其质量
【发布时间】:2013-01-28 08:45:11
【问题描述】:

如何在 Windows Phone 中调整图像大小而不损失其质量。我尝试了以下给定的方法,但图像的质量下降了相当大的幅度。谁能更新一个更好的方法来调整我的图像大小。

            btmMap = new WriteableBitmap(biInput);
            var source = WriteableBitmapContextExtensions.GetBitmapContext(btmMap);
            btmMap = WriteableBitmapExtensions.Resize(btmMap, (int)imgWidth, (int)imgHeight,     WriteableBitmapExtensions.Interpolation.Bilinear);   

我也试过这个方法,但结果是一样的:

                var wbOutput = PictureDecoder.DecodeJpeg(biInput, (int)imgWidth, (int)imgHeight);
                wbOutput.SaveJpeg(ms, wbOutput.PixelWidth, wbOutput.PixelHeight, 0, 100);
                ms.Seek(0, SeekOrigin.Begin);
                bmp.SetSource(ms);
                ms.FlushAsync();

【问题讨论】:

  • 图像在调整大小时像素化。
  • 调整大小是什么意思?如果你想增加图像的大小,当然会导致质量下降。同样,如果将图像压缩为 Jpeg 格式,您会发现质量会下降。

标签: windows-phone-7 windows-phone-8


【解决方案1】:

下载、参考和使用6.5 KB DLL from here 进行双三次调整。它比 WriteableBitmapExtensions 中的双线性方法产生更好的结果。

附:好问题!我刚刚更新了我的应用,以便使用更好的调整大小的方法为我的动态磁贴生成图像。

【讨论】:

  • 我尝试了这种方法,但它并没有对我的应用程序产生任何巨大的变化。
  • 这意味着调整大小不是您观察到图像质量下降的主要原因..
猜你喜欢
  • 2011-01-20
  • 2011-04-18
  • 2014-09-20
  • 1970-01-01
  • 2015-03-05
  • 1970-01-01
  • 2020-08-20
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多