一 在ue4 中用系统自带软件打开编辑图片视频等资源
1:将资源放在Movies文件下(为了打包之后找到资源路径):
2;
LaunchFileInDefaultExternalApplication中ELaunchVerb::Edit:可编辑,ELaunchVerb::Open 只打开
void AOpenInExternalEditor::ExecuteOpenInExternalEditor(FString ResolvedFilePaths)
{
FString ProjectContentDir = FPaths::ConvertRelativePathToFull(FPaths::ProjectContentDir());
ProjectContentDir += "Movies";
ProjectContentDir += "/qqq.png";
FPlatformProcess::LaunchFileInDefaultExternalApplication(*ProjectContentDir, NULL, ELaunchVerb::Edit);
GEngine->AddOnScreenDebugMessage(-1, 20, FColor::Red, "ProjectContentDir path " + ProjectContentDir);
}
运行结果:
二 拉起外部程序
void AOpenInExternalEditor::Runexe()
{
FString str = "C:\\Program Files (x86)\\Tencent\\TIM\\Bin\\QQScLauncher.exe";
FPlatformProcess::CreateProc(*str, NULL, true, false, false, nullptr, -1, nullptr, nullptr);
}
效果图
参考:官方文档
原创声明,转载注明出处:https://blog.csdn.net/weixin_36369675/article/details/80786984
附一个参考http://www.v5xy.com/?p=696