UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SImage.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Misc/Attribute.h"
7#include "Input/Reply.h"
10#include "Styling/CoreStyle.h"
11#include "Widgets/SLeafWidget.h"
12#include "Styling/SlateTypes.h"
13
14class FPaintArgs;
16
17template <>
19{
20 static constexpr bool SupportsInvalidation() { return true; }
21};
22
23
27class SImage
28 : public SLeafWidget
29{
31
32public:
38
41
42
43 SLATE_ATTRIBUTE(FSlateColor, ColorAndOpacity)
44
45
46 SLATE_ATTRIBUTE(TOptional<FVector2D>, DesiredSizeOverride)
47
48
50
51
54
55
58
64 SLATECORE_API void Construct( const FArguments& InArgs );
65
66public:
67
70
73
76
79
82
85
86public:
87
88 // SWidget overrides
89 SLATECORE_API virtual int32 OnPaint( const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled ) const override;
90#if WITH_ACCESSIBILITY
92#endif
93
94protected:
95 // Begin SWidget overrides.
96 SLATECORE_API virtual FVector2D ComputeDesiredSize(float) const override;
97 // End SWidget overrides.
98
101
104
107
108private:
111
113 TSlateAttribute<FSlateColor> ColorAndOpacityAttribute;
114
116 TSlateAttribute<TOptional<FVector2D>> DesiredSizeOverrideAttribute;
117
118protected:
121};
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define SLATE_ATTRIBUTE(AttrType, AttrName)
Definition DeclarativeSyntaxSupport.h:192
#define SLATE_EVENT(DelegateName, EventName)
Definition DeclarativeSyntaxSupport.h:458
#define SLATE_END_ARGS()
Definition DeclarativeSyntaxSupport.h:116
#define SLATE_ARGUMENT(ArgType, ArgName)
Definition DeclarativeSyntaxSupport.h:208
#define SLATE_DECLARE_WIDGET_API(WidgetType, ParentType, ModuleApiDefine)
Definition SlateControlledConstruction.h:22
Definition CoreStyle.h:15
Definition PaintArgs.h:23
Definition SlateRect.h:26
Definition DrawElements.h:220
Definition WidgetStyle.h:15
Definition SImage.h:29
SLATECORE_API void SetDesiredSizeOverride(TAttribute< TOptional< FVector2D > > InDesiredSizeOverride)
Definition SImage.cpp:102
TSlateAttributeRef< const FSlateBrush * > GetImageAttribute() const
Definition SImage.h:100
virtual SLATECORE_API int32 OnPaint(const FPaintArgs &Args, const FGeometry &AllottedGeometry, const FSlateRect &MyCullingRect, FSlateWindowElementList &OutDrawElements, int32 LayerId, const FWidgetStyle &InWidgetStyle, bool bParentEnabled) const override
Definition SImage.cpp:44
SLATECORE_API void FlipForRightToLeftFlowDirection(bool InbFlipForRightToLeftFlowDirection)
Definition SImage.cpp:107
virtual SLATECORE_API FVector2D ComputeDesiredSize(float) const override
Definition SImage.cpp:69
SLATECORE_API void Construct(const FArguments &InArgs)
Definition SImage.cpp:30
TSlateAttributeRef< TOptional< FVector2D > > GetDesiredSizeOverrideAttribute() const
Definition SImage.h:106
SLATECORE_API void SetColorAndOpacity(TAttribute< FSlateColor > InColorAndOpacity)
Definition SImage.cpp:81
SLATECORE_API void InvalidateImage()
Definition SImage.cpp:97
SLATE_BEGIN_ARGS(SImage)
Definition SImage.h:33
SLATECORE_API void SetImage(TAttribute< const FSlateBrush * > InImage)
Definition SImage.cpp:91
TSlateAttributeRef< FSlateColor > GetColorAndOpacityAttribute() const
Definition SImage.h:103
bool bFlipForRightToLeftFlowDirection
Definition SImage.h:120
Definition SLeafWidget.h:29
virtual SLATECORE_API FReply OnMouseButtonDown(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent)
Definition SWidget.cpp:451
Definition Attribute.h:17
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis(OtherType *ThisPtr)
Definition SharedPointer.h:1780
Definition SharedPointer.h:153
@ false
Definition radaudio_common.h:23
Definition Geometry.h:40
Definition Color.h:48
Definition SlateBrush.h:239
Definition SlateColor.h:42
Definition SWidget.h:255
Definition Optional.h:131
static constexpr bool SupportsInvalidation()
Definition SImage.h:20
Definition SWidget.h:69