I’d like to load a file at runtime, chop it up into squares, and put each of the squares into an image in its own widget. I think that when I chop up a bitmap I will end up with a material, so I’m trying to use the brush on an image and use that to put the picture from the material into an image.
I am not 100% sure, but:
In blueprints:
Create a material
Create a dynamitc material instance
Set brush from material
Set brush from material node to appy the material
If so i tried it about year ago, there are functions in C++, however they are low level and i kind of could not find documentation of formats they use (like format and settings to properly load for eg TGA file).
Also there was some problems with invalid pointers (and usual result crashing to desktop).
I could presumably write more C++ code to parse the incoming file into square bitmaps, but I thought it might be cleaner to do in blueprints instead. (I might need one lib for PNG, another one for TIFF, and yet another one for JPG)
I am thinking that in theory once I have the bitmap loaded I can use a dynamic material to grab the square that I want from the bitmap, and pass that along to an image in a widget for display onscreen.
However, when I try to apply a material to an image on my widget, nothing seems to be happening - Set Brush Resource To Material seems to not be working for me.
Here is the layout of the widget, it has only one child, the image:
Thanks KingOfChaos! I tried using CreateDynamicdMaterialInstance, but I still get an empty material, even though the print statement gives me a name of a material. Any ideas?