Unreal Engine 4.25
I’m getting this compile error:
error C2664: 'bool IImageWrapper::GetRaw(const ERGBFormat,int32,TArray<uint8,FDefaultAllocator> &)': cannot convert argument 3 from 'const TArray<uint8,FDefaultAllocator> *' to 'TArray<uint8,FDefaultAllocator64> &'
I noticed there is an overloaded function for GetRaw built in to the engine that makes it either look for a TArray OR a TArray64
And for the life of me I can’t get this to compile. I’ve tried using TArray64 for “BinaryArray” and “RawData” variables, but it still compiled with the same error…
What am I missing about this?.. Most likely I don’t understand something, but I also wonder if this is a bug/issue with 4.25…
UE_LOG(LogTemp, Log, TEXT("Try to load a png!"));
FString PngFile = FString(TEXT(""));
IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked<IImageWrapperModule>(FName("ImageWrapper"));
//IImageWrapperPtr PNGImageWrapper = ImageWrapperModule.CreateImageWrapper(EImageFormat::PNG);
//^^^ Noticed this was depreciated! It suggested using the next line instead.
TSharedPtr<IImageWrapper> PNGImageWrapper = ImageWrapperModule.CreateImageWrapper(EImageFormat::PNG);
TArray<uint8> BinaryArray;
if(FFileHelper::LoadFileToArray(BinaryArray, *PngFile))
{
UE_LOG(LogTemp, Log, TEXT("LoadFileToArray() success"));
if(PNGImageWrapper.IsValid())
{
UE_LOG(LogTemp, Log, TEXT("its valid, keep going"));
const TArray<uint8>* RawData = NULL;
if(PNGImageWrapper->GetRaw(ERGBFormat::BGRA, 8, RawData))
{
UE_LOG(LogTemp, Log, TEXT("GetRaw success keep going"));
}
}
}
if I comment out the GetRaw() line and the whole if statement my UE_LOG shows:
Try to load a png!
LogTemp: LoadFileToArray() success
LogTemp: its valid, keep going
Alternatively I might be missing something dumb with pointer/address stuff when passing this in? But it is strange that it’s getting confused about what type of argument it is with that overload funciton situation.