class
MImage
- Module
- Miri
- Header
#include "Miri/Widgets/MImage.h"- Namespace
Miri
Public functions
| Returns | Name | Description |
|---|---|---|
MIRI_WIDGET_ARGS | ||
MiriVec2 | ComputeDesiredSize | |
int32_t | OnPaint | |
void | SetImage | Without an explicit override the desired size IS the texture's extent, so swapping the texture resizes the widget — the assignment has to announce itself or the cache keeps the old icon's box. |
void | SetBrush | |
void | SetColorAndOpacity | The tint is owned, so the write itself drops the retained slice. |
MiriColor | GetColorAndOpacity | |
bool | CanCacheDesiredSize | Override, else the source texture's extent. |
bool | CanRetainPaint | A live texture is NOT a disqualifier: the slice stores the texture pointer in its draw command, so a thumbnail re-rendered into the same image replays with the new pixels. |
const char* | GetTypeName |
Function details
MIRI_WIDGET_ARGS
C++
MIRI_WIDGET_ARGS(MImage) MIRI_ARG(IMiriRHITexture*, Image) MIRI_ATTR(MiriColor, ColorAndOpacity) MIRI_ATTR(MiriVec2, DesiredSizeOverride) MIRI_ARG(EImageSizing, Sizing) MIRI_ARG(CBrush, Brush) MIRI_WIDGET_ARGS_END() void Construct(const CArguments& args)ComputeDesiredSize
C++
MiriVec2 ComputeDesiredSize(float scale) const overrideOnPaint
C++
int32_t OnPaint(const CMiriPaintArgs& args, const CGeometry& geo, CMiriRenderer& renderer, int32_t layerId) const overrideSetImage
C++
void SetImage(IMiriRHITexture* image)Without an explicit override the desired size IS the texture's extent, so swapping the texture resizes the widget — the assignment has to announce itself or the cache keeps the old icon's box.
SetBrush
C++
void SetBrush(const CBrush& brush)SetColorAndOpacity
C++
void SetColorAndOpacity(const MiriColor& tint)The tint is owned, so the write itself drops the retained slice.
GetColorAndOpacity
C++
MiriColor GetColorAndOpacity() constCanCacheDesiredSize
C++
bool CanCacheDesiredSize() const overrideOverride, else the source texture's extent. A texture resized in place behind the widget's back is the one case this misses; hand the widget the new texture through SetImage instead.
CanRetainPaint
C++
bool CanRetainPaint() const overrideA live texture is NOT a disqualifier: the slice stores the texture pointer in its draw command, so a thumbnail re-rendered into the same image replays with the new pixels. Swapping the widget to a DIFFERENT texture is the case that has to announce itself, and SetImage does.
GetTypeName
C++
const char* GetTypeName() const overrideGenerated from Miri/Widgets/MImage.h via miri.json · Dec 5, 2026Version 1.1.0