Screenshot command not works on android

I tried “HighResShot 1” or “SHOT” as console command in my blueprint,it did not work on android.i didt see any screenshots in my phone. please help

I just tried it and the screenshot png was saved. Did you look in the right place? It will be in /sdcard/UE4Game/[project]/[project]/Saved/Screenshots/Android where [project] is your project’s name.

thank you for replay,but i want to put the PNGs to DCIM/Screenshots folder,any idea?

hello evehal

I made this for desktop, but should work:




bool UMyBlueprintFunctionLibrary::doScreenShot(FString filePath)
{
	if (GEngine)
	{
		FHighResScreenshotConfig &HighResScreenshotConfig = GetHighResScreenshotConfig();
		UGameViewportClient* GameViewport = GEngine->GameViewport;
		if (GameViewport)
		{
			HighResScreenshotConfig.SetHDRCapture(false);
			FViewport *Viewport = GameViewport->Viewport;
			if (Viewport)
			{
				Viewport->Invalidate();
				TArray<FColor>data;
				if (Viewport->ReadPixels(data))
				{
					for (auto& Pixel : data) { Pixel.A = 255; }
					HighResScreenshotConfig.SaveImage(filePath, data, Viewport->GetSizeXY());
					return true;
				}
			}
		}
	}
	return false;
}



1 Like