| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- #include "DynamicLoader.h"
- #include "Runtime/Engine/Classes/Engine/Engine.h"
- #include "Runtime/Core/Public/Async/Async.h"
- #include "IImageWrapper.h"
- #include "ImageUtils.h"
- #include "IImageWrapperModule.h"
- #include "BlueprintUtilityBPLibrary.h"
- #include "Engine/Texture2D.h"
- void UImageLoader::LoadImageAsync(const FString& ImagePath,const FString &inputID)
- {
- AsyncTask(ENamedThreads::AnyThread, [=]()
- {
- LoadID = inputID;
- UTexture2D* reTexture;
- reTexture = LoadImageFromDisk(ImagePath);
- LoadCompleted.Broadcast(reTexture,LoadID);
- });
- }
- UTexture2D* UImageLoader::LoadImageFromDisk( const FString& ImagePath)
- {
- bool Succss; int32 Weight;
- int32 Highting;
-
- return UBlueprintUtilityBPLibrary::LoadTexture2DFromFile(ImagePath,Succss, Weight,Highting);
- }
- AExeActor::AExeActor()
- {
- // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
- PrimaryActorTick.bCanEverTick = true;
- }
- bool AExeActor::Getstat()
- {
- bool a = FPlatformProcess::IsProcRunning(CheckProc);
- return a;
- //return true;
- }
- // Called when the game starts or when spawned
- void AExeActor::BeginPlay()
- {
- Super::BeginPlay();
- UE_LOG(LogTemp, Warning, TEXT("EXE Begin"));
- }
- void AExeActor::Tick(float DeltaTime)
- {
- //Super::Tick();
- Super::Tick(DeltaTime);
- //UE_LOG(LogTemp, Warning, TEXT("I AM IN There"));
- bool a = FPlatformProcess::IsProcRunning(CheckProc);
- if (!a && !bisShutDown)
- {
- UE_LOG(LogTemp, Warning, TEXT("EXE End"));
- bisShutDown = true;
- ProcShutdown.Broadcast(true);
- PrimaryActorTick.bCanEverTick = false;
- Destroy();
- }
- //return true;
- }
|