在屏幕截图

时间:2018-02-26 09:03:19

标签: c# unity3d

我在向屏幕截图添加说明时遇到问题。我像这样捕捉相机屏幕:

    RenderTexture texture = new RenderTexture(Screen.width, Screen.height, 32);
    Camera.main.targetTexture = texture;
    RenderTexture.active = texture;
    Camera.main.Render();
    Texture2D texture2D = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false);
    texture2D.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0);
    texture2D.Apply();

现在我尝试在捕获的屏幕下添加带有标签的白色面板,然后将其保存到文件中。现在我有一个问题。我不知道如何将面板与图像合并。我尝试在画布上添加面板,然后使用 Application.CaptureScreenshot(); ,但它并没有按我的意愿工作。面板显示在屏幕截图上,但涵盖了一些元素。如何将面板放在屏幕截图下?

感谢您的帮助!

What I have now. Panel is on the screenshot range 我现在有什么面板位于屏幕截图范围

What I'm trying to do. Panel is added under screenshot range and doesn't cover anything 我想做什么。面板是在屏幕截图范围内添加的,并不包含任何内容

0 个答案:

没有答案