如何在WPF应用程序的客户端上缓存图像? [英] How do I cache images on the client for a WPF application?

查看:207
本文介绍了如何在WPF应用程序的客户端上缓存图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个WPF桌面应用程序,该应用程序显示当前通过HTTP获取的图像。

We are developing a WPF desktop application that is displaying images that are currently being fetched over HTTP.

图像已针对质量/尺寸进行了优化但是有一个每次获取图像时都会出现明显的等待。

The images are already optimised for quality/size but there is an obvious wait each time that the image is fetched.

有没有办法在客户端缓存图像,以便每次都不会下载?

推荐答案

对于通过谷歌来到这里的人,我打包了 Simon Hartcher 发布,由 Jeroen van Langen 重构(以及来自 Ivan Leonenko 使其成为可绑定的),进入开源NuGet包。

For people coming here via Google, I have packaged the original implementation that Simon Hartcher posted, refactored by Jeroen van Langen (along with the tweaks from Ivan Leonenko to make it bindable), into an Open Source NuGet package.

请在此处查找详细信息 - http://floydpink.github.io/CachedImage/

Please find the details here - http://floydpink.github.io/CachedImage/

这篇关于如何在WPF应用程序的客户端上缓存图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆