Announcement

Collapse
No announcement yet.

Screenshot command not works on android

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

    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

    #2
    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.

    Comment


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

      Comment


        #4
        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;
        }

        Comment

        Working...
        X