参考:
谢谢这位大哥,按照你的讲解,做了一个出来。
https://www.bilibili.com/video/BV1UE411Z7uY?t=1496
步骤一:
添加模块引用
PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
"ImageWrapper"
// ... add private dependencies that you statically link with here ...
}
);
截图如下:
第二步:
加载图片到纹理
static TSharedPtrGetImageWrapperByExtention(const FString path)
{
IImageWrapperModule& module = FModuleManager::LoadModuleChecked(FName("ImageWrapper"));
if (path.EndsWith(".png"))
{
return module.CreateImageWrapper(EImageFormat::PNG);
}
if (path.Ends