Playing with a new web cache class
This commit is contained in:
parent
833b7c7141
commit
c93bb370bc
10 changed files with 258 additions and 197 deletions
|
|
@ -114,7 +114,7 @@ namespace MatterHackers.MatterControl.Library.Widgets.HardwarePage
|
|||
VAnchor = VAnchor.Top
|
||||
});
|
||||
|
||||
ApplicationController.Instance.DownloadToImageAsync(image, product.FeaturedImage.ImageUrl, scaleToImageX: true);
|
||||
WebCache.RetrieveImageAsync(image, product.FeaturedImage.ImageUrl, scaleToImageX: true);
|
||||
|
||||
var descriptionBackground = new GuiWidget()
|
||||
{
|
||||
|
|
@ -155,7 +155,7 @@ namespace MatterHackers.MatterControl.Library.Widgets.HardwarePage
|
|||
foreach(var item in product.ProductListing.AddOns)
|
||||
{
|
||||
var icon = new ImageBuffer(80, 0);
|
||||
ApplicationController.Instance.DownloadToImageAsync(icon, item.FeaturedImage.ImageUrl, scaleToImageX: true);
|
||||
WebCache.RetrieveImageAsync(icon, item.FeaturedImage.ImageUrl, scaleToImageX: true);
|
||||
|
||||
var addOnRow = new AddOnRow(item.AddOnTitle, theme, null, icon)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.PlusTab
|
|||
Margin = new BorderDouble(right: ItemSpacing)
|
||||
};
|
||||
|
||||
imageWidget.Load += (s, e) => ApplicationController.Instance.DownloadToImageAsync(image, item.icon, true, new BlenderPreMultBGRA());
|
||||
imageWidget.Load += (s, e) => WebCache.RetrieveImageAsync(image, item.icon, true, new BlenderPreMultBGRA());
|
||||
this.AddChild(imageWidget);
|
||||
}
|
||||
else if (item.widget_url != null)
|
||||
|
|
@ -80,7 +80,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.PlusTab
|
|||
VAnchor = VAnchor.Center,
|
||||
};
|
||||
|
||||
imageWidget.Load += (s, e) => ApplicationController.Instance.DownloadToImageAsync(image, item.widget_url, true, new BlenderPreMultBGRA());
|
||||
imageWidget.Load += (s, e) => WebCache.RetrieveImageAsync(image, item.widget_url, true, new BlenderPreMultBGRA());
|
||||
whiteBackground.AddChild(imageWidget);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow.PlusTab
|
|||
};
|
||||
}
|
||||
|
||||
imageWidget.Load += (s, e) => ApplicationController.Instance.DownloadToImageAsync(image, content.image_url, false, new BlenderPreMultBGRA());
|
||||
imageWidget.Load += (s, e) => WebCache.RetrieveImageAsync(image, content.image_url, false, new BlenderPreMultBGRA());
|
||||
this.AddChild(imageWidget);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue