Navigation
API > API/Runtime > API/Runtime/ImageDownload
Inheritance Hierarchy
- FSharedFromThisBase
- TSharedFromThis
- FWebImage
References
| Module | ImageDownload |
| Header | /Engine/Source/Runtime/Online/ImageDownload/Public/WebImage.h |
| Include | #include "WebImage.h" |
Syntax
class FWebImage : public TSharedFromThis< FWebImage >
Remarks
This class manages downloading an image and swapping it out a standin once it's done.
Example (not cached): FWebImage Image; Image.SetStandInBrush(FStyle::Get()->GetBrush("Foo")); Image.BeginDownload(Url, OptionalCallback);
SNew(SImage) .Image(Image.Attr())
You may want to get your FWebImage from a FWebImageCache so we're not re-downloading the same URL all the time.
Example (cached): FWebImageCache ImageCache; // usually global ImageCache.SetStandInBrush(FStyle::Get()->GetBrush("Foo"));
SNew(SImage) .Image(ImageCache.Download(Url)->Attr())
Constructors
| Type | Name | Description | |
|---|---|---|---|
FWebImage () |
Destructors
| Type | Name | Description | |
|---|---|---|---|
~FWebImage () |
Functions
| Type | Name | Description | |
|---|---|---|---|
| TAttribute< const FSlateBrush * > | Attr () |
Use .Attr() to pass this brush into a slate attribute | |
| bool | BeginDownload
(
const FString& InUrl, |
Begin downloading an image. | |
| bool | BeginDownload
(
const FString& InUrl, |
Begin downloading an image. | |
| void | Cancel any download in progress | ||
| bool | Has the download finished AND did it fail | ||
| bool | Has the download finished AND was it successful | ||
| const FSlateBrush * | GetBrush () |
Get the current brush displayed (will automatically change when download completes) | |
| const FSlateBrush * | Only returns the downloaded brush. May be null if the download hasn't finished or was unsuccessful | ||
| const TOptional< FString > & | GetETag () |
What is the ETag of the downloaded resource | |
| const FString & | GetUrl () |
What URL was requested | |
| bool | Is there a pending HTTP request | ||
| void | SetRGBFormat
(
const ERGBFormat InRGBFormat |
Sets the RGB format used to read the downloaded image data (ERGBFormat::RGBA by default) | |
| FWebImage & | SetStandInBrush
(
TAttribute< const FSlateBrush* > StandInBrushIn |
Set the brush that is currently being returned (this will be overridden when any async download completes) |
Typedefs
| Name | Description |
|---|---|
| FOnImageDownloaded | Fired when the image finishes downloading or is canceled. |