1新版本 2优化图片显示

This commit is contained in:
wule committed 2026-10-18 14:22:41 +08:00
1 parent 41b240c066
commit a786ba6ce9
2 files changed
+7 -2

No files matched your search

@@ -787,7 +787,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// 异步加载图片防止卡顿 // 异步加载图片防止卡顿
// 缩略图在有的电脑上无法显示 // 缩略图在有的电脑上无法显示
//BitmapImage bImg = ImageUrlToBitmapImageConverter.LoadImageFromUrl(order_item.thumb_img + "?imageView2/1/w/100/format/webp|imageMogr2/auto-orient="); //BitmapImage bImg = ImageUrlToBitmapImageConverter.LoadImageFromUrl(order_item.thumb_img + "?imageView2/1/w/100/format/webp|imageMogr2/auto-orient=");
BitmapImage bImg = AllBase.ImageBuild.LoadBitmipImageFromUrl(order_item.thumb_img); BitmapImage bImg = AllBase.ImageBuild.LoadBitmipImageFromUrl(order_item.thumb_img, 100, 100);
Thread.Sleep(Randomx.GetId(1000)); Thread.Sleep(Randomx.GetId(1000));
Dispatcher.Invoke(new Action(() => Dispatcher.Invoke(new Action(() =>
{ {
+6 -1
View File
@@ -385,9 +385,14 @@ namespace AllBase
} }
} }
public static BitmapImage LoadBitmipImageFromUrl(string url) public static BitmapImage LoadBitmipImageFromUrl(string url, int? width = 0, int? height = 0)
{ {
BitmapImage bitmap = new BitmapImage(); BitmapImage bitmap = new BitmapImage();
if (width != null && height != null)
{
bitmap.DecodePixelWidth = 100;
bitmap.DecodePixelHeight = 100;
}
try try
{ {