# FString to Image? (C++ & Dynamic Materials)

**URL:** <https://forums.unrealengine.com/t/fstring-to-image-c-dynamic-materials/2322216>\
**Category:** FX\
**Tags:** unreal-engine, question\
**Created:** [February 7, 2025, 10:18pm UTC](https://forums.unrealengine.com/t/fstring-to-image-c-dynamic-materials/2322216 "2025-02-07T22:18:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [February 8, 2025, 9:51am UTC](https://forums.unrealengine.com/t/fstring-to-image-c-dynamic-materials/2322216/2 "2025-02-08T09:51:20Z")

</div>

Edit: updated refactor simplified to only use material without custom player state  
[MatName.zip](https://forums.unrealengine.com/uploads/short-url/1r8kjly2ZdENcFpZxjF5DN1Z9x6.zip) (51.1 KB)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/d/89d7cdaa6445e07825dfb69a25566baae8c302fc.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/8/b/b8bdc89c692c51d69213732eaf9568efad10fd78.jpeg)

Mostly used info from here:

> [@Use Text as Mask / Transparent Text in Opaque Background](https://forums.unrealengine.com/t/use-text-as-mask-transparent-text-in-opaque-background/1218348/4):
>
> Here’s the solution. In the widget BP: Inverted Text is an image in the designer. It’s image size is 500x100 in the brush settings. And the material: The font that you use for DrawText affects the size of the text, you have to set the legacy size in the font. [image]

OFC if you want to have a hard reference to an RT you can always swap out

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/2/7/e2706d6510d015a1bb8c8ca5d986f6d014b6c528.png)  
with a hard reference.

And if you need an image snapshot form the RT you can use Rama’s victory plugin

> [@Save Render Target as image/texture?](https://forums.unrealengine.com/t/save-render-target-as-image-texture/1222433/2):
>
> Victory Plugin does: [image] It’s free and if you want to go CPP then just download and rip it slight_smile Hope it helps. Best, Dany

---

_[View the full topic](https://forums.unrealengine.com/t/fstring-to-image-c-dynamic-materials/2322216)._
