UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FWebImage Class Reference

#include <WebImage.h>

+ Inheritance diagram for FWebImage:

Public Member Functions

IMAGEDOWNLOAD_API FWebImage ()
 
IMAGEDOWNLOAD_API ~FWebImage ()
 
 DECLARE_DELEGATE_OneParam (FOnImageDownloaded, bool)
 
FWebImageSetStandInBrush (TAttribute< const FSlateBrush * > StandInBrushIn)
 
IMAGEDOWNLOAD_API bool BeginDownload (const FString &InUrl, const TOptional< FString > &StandInETag=TOptional< FString >(), const FOnImageDownloaded &DownloadCallback=FOnImageDownloaded())
 
bool BeginDownload (const FString &InUrl, const FOnImageDownloaded &DownloadCallback)
 
IMAGEDOWNLOAD_API void CancelDownload ()
 
IMAGEDOWNLOAD_API TAttribute< const FSlateBrush * > Attr () const
 
const FSlateBrushGetBrush () const
 
const FSlateBrushGetDownloadedBrush () const
 
bool IsDownloadPending () const
 
bool DidDownloadSucceed () const
 
bool DidDownloadFail () const
 
const FString & GetUrl () const
 
const TOptional< FString > & GetETag () const
 
- Public Member Functions inherited from TSharedFromThis< FWebImage >
TSharedRef< FWebImage, Mode > AsShared ()
 
TSharedRef< FWebImage const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< FWebImage, Mode > AsWeak ()
 
TWeakPtr< FWebImage const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 

Additional Inherited Members

- Protected Member Functions inherited from TSharedFromThis< FWebImage >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 
- Static Protected Member Functions inherited from TSharedFromThis< FWebImage >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 

Detailed Description

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())

Constructor & Destructor Documentation

◆ FWebImage()

FWebImage::FWebImage ( )

◆ ~FWebImage()

FWebImage::~FWebImage ( )

Member Function Documentation

◆ Attr()

TAttribute< const FSlateBrush * > FWebImage::Attr ( ) const

Use .Attr() to pass this brush into a slate attribute

◆ BeginDownload() [1/2]

bool FWebImage::BeginDownload ( const FString &  InUrl,
const FOnImageDownloaded DownloadCallback 
)
inline

Begin downloading an image.

◆ BeginDownload() [2/2]

bool FWebImage::BeginDownload ( const FString &  InUrl,
const TOptional< FString > &  StandInETag = TOptional<FString>(),
const FOnImageDownloaded DownloadCallback = FOnImageDownloaded() 
)

Begin downloading an image. This will automatically set the current brush to the downloaded image when it completes (if successful)

◆ CancelDownload()

void FWebImage::CancelDownload ( )

Cancel any download in progress

◆ DECLARE_DELEGATE_OneParam()

FWebImage::DECLARE_DELEGATE_OneParam ( FOnImageDownloaded  ,
bool   
)

Fired when the image finishes downloading or is canceled.

Parameters
SuccessTrue if the downloaded image will now be returned by GetBrush()

◆ DidDownloadFail()

bool FWebImage::DidDownloadFail ( ) const
inline

Has the download finished AND did it fail

◆ DidDownloadSucceed()

bool FWebImage::DidDownloadSucceed ( ) const
inline

Has the download finished AND was it successful

◆ GetBrush()

const FSlateBrush * FWebImage::GetBrush ( ) const
inline

Get the current brush displayed (will automatically change when download completes)

◆ GetDownloadedBrush()

const FSlateBrush * FWebImage::GetDownloadedBrush ( ) const
inline

Only returns the downloaded brush. May be null if the download hasn't finished or was unsuccessful

◆ GetETag()

const TOptional< FString > & FWebImage::GetETag ( ) const
inline

What is the ETag of the downloaded resource

◆ GetUrl()

const FString & FWebImage::GetUrl ( ) const
inline

What URL was requested

◆ IsDownloadPending()

bool FWebImage::IsDownloadPending ( ) const
inline

Is there a pending HTTP request

◆ SetStandInBrush()

FWebImage & FWebImage::SetStandInBrush ( TAttribute< const FSlateBrush * >  StandInBrushIn)
inline

Set the brush that is currently being returned (this will be overridden when any async download completes)


The documentation for this class was generated from the following files: