| | |
| | | using Shared; |
| | | using HDL_ON.DAL.Server; |
| | | using System.IO; |
| | | using HDL_ON.Common; |
| | | |
| | | namespace HDL_ON |
| | | { |
| | |
| | | /// <param name="imageKey">图片路径、云端下载图片的标识key</param> |
| | | /// <param name="imageView">需要显示图片的ImageView</param> |
| | | /// <param name="ignoreCache">是否需要忽略缓存</param> |
| | | public void Load3tyBrandIconImages(string imageKey, ImageView imageView) |
| | | public void Load3tyBrandIconImages(string brandName, string imageKey, ImageView imageView) |
| | | { |
| | | try |
| | | { |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | byte[] imageBytes = GetImageDownloadUrl(imageKey); |
| | | if (imageBytes != null) |
| | | { |
| | | WriteFileByBytes(imageKey, imageBytes); |
| | | //2.3 下载成功,显示并缓存本地 |
| | | Application.RunOnMainThread(() => { |
| | | if (imageView != null) |
| | | { |
| | | imageView.ImageBytes = imageBytes; |
| | | //Utlis.WriteLine("imageKey 加载云端下载图片成功"); |
| | | } |
| | | //byte[] imageBytes = GetImageDownloadUrl(imageKey); |
| | | //if (imageBytes != null) |
| | | //{ |
| | | // WriteFileByBytes(imageKey, imageBytes); |
| | | // //2.3 下载成功,显示并缓存本地 |
| | | // Application.RunOnMainThread(() => { |
| | | // if (imageView != null) |
| | | // { |
| | | // imageView.ImageBytes = imageBytes; |
| | | // //Utlis.WriteLine("imageKey 加载云端下载图片成功"); |
| | | // } |
| | | // }); |
| | | //} |
| | | |
| | | //var ddd = new Common.DownLoadImageAsync(imageKey,"1","1"); |
| | | //ddd.StartDownloadImageAsync(); |
| | | |
| | | Action action = () => { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | imageView.ImagePath = $"{brandName}.png"; |
| | | }); |
| | | } |
| | | }; |
| | | FileUtlis.Files.DownLoadImage($"{brandName}.png", imageKey, action); |
| | | |
| | | }); |
| | | } |
| | | catch (Exception ex) |