Navigation
API > API/Runtime > API/Runtime/ImageDownload
This class is designed to facilitate caching of web images and setting a global stand-in so we don't re-download the same image every time the UI shows it again.
See WebImage.h for example usage.
| Name | FWebImageCache |
| Type | class |
| Header File | /Engine/Source/Runtime/Online/ImageDownload/Public/WebImageCache.h |
| Include Path | #include "WebImageCache.h" |
Syntax
class FWebImageCache
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FWebImageCache() |
WebImageCache.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| DefaultStandInBrush | TAttribute< const FSlateBrush * > | The image resource to show | WebImageCache.h | |
| StrongRefCache | TArray< TSharedRef< FWebImage > > | Strong references to keep images cached when not in use. Can be flushed manually | WebImageCache.h | |
| UrlToImageMap | TMap< FString, TWeakPtr< FWebImage > > | Map of canonical URL to web images (weak pointer so we don't affect lifetime) | WebImageCache.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TSharedRef< const FWebImage > Download
(
const FString& Url, |
Find or create a WebImage object for this URL (you probably just want to call ->Attr() on this) | WebImageCache.h | |
void Empty() |
Removes all cached images | WebImageCache.h | |
void PreUnload() |
Signifies the module is being unloaded and to perform any actions that depend on other modules which may be unloaded as well | WebImageCache.h | |
void RelinquishUnusedImages () |
This function causes the web image cache to stop holding on to strong references to images. | WebImageCache.h | |
void SetDefaultStandInBrush
(
TAttribute< const FSlateBrush* > StandInBrushIn |
Set the brush that will be returned until the download completes (only affects future downloads). | WebImageCache.h |