Announcement

Collapse
No announcement yet.

Screenshot command not works on android

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • started a topic Screenshot command not works on android

    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

  • replied
    hello evehal

    I made this for desktop, but should work:

    Code:
    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;
    }

    Leave a comment:


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

    Leave a comment:


  • replied
    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.

    Leave a comment:

Working...
X