zoukankan      html  css  js  c++  java
  • Unity高像素截图

    本文章由cartzhang编写,转载请注明出处。 所有权利保留。
    文章链接:http://blog.csdn.net/cartzhang/article/details/51386272
    作者:cartzhang

    怎么在Unity中截图呢?
    截图还可以设置不同的大小呢?

    一、代码

    代码:

    using UnityEngine;
    using System.Collections;
    
    public class CaptureSuperImage : MonoBehaviour
    {
        [Header("放大倍数")]
        public int size = 1;
        // Use this for initialization
        void Start () {
    
        }
    
        // Update is called once per frame
        void Update ()
        {
            if ( Input.GetKeyDown(KeyCode.F9))
            {
                Application.CaptureScreenshot("Screenshot.png", size);
            }
        }
    
    }
    

    二、Application解释

     //
            // 摘要:
            //     ///
            //     Captures a screenshot at path filename as a PNG file.
            //     ///
            //
            // 参数:
            //   filename:
            //     Pathname to save the screenshot file to.
            //
            //   superSize:
            //     Factor by which to increase resolution.
            [ExcludeFromDocs]
            public static void CaptureScreenshot(string filename);
            //
            // 摘要:
            //     ///
            //     Captures a screenshot at path filename as a PNG file.
            //     ///
            //
            // 参数:
            //   filename:
            //     Pathname to save the screenshot file to.
            //
            //   superSize:
            //     Factor by which to increase resolution.
            [WrapperlessIcall]
            public static void CaptureScreenshot(string filename, [DefaultValue("0")] int superSize);

    我们使用的是最后一个,可以根据游戏窗口大小来生产窗口倍数不同的图片。
    怎么使用:
    一图胜千言
    这里写图片描述

    三、截图

    最后的截图放上一张:

    截图

    ——————–THE—————END—————

    若有问题,请随时联系!!
    非常感谢!!

    好好珍惜,你所怀念的美好,也就是曾经的现在!!!
    哈哈

  • 相关阅读:
    系统综合实践第三次作业
    系统综合实践第二次作业
    系统综合实践第一次作业
    第03组 Beta版本演示
    第03组 Beta冲刺(4/4)
    第04组 Beta版本演示
    第04组 Beta冲刺(4/4)
    第04组 Beta冲刺(3/4)
    第04组 Beta冲刺(2/4)
    第04组 Beta冲刺(1/4)
  • 原文地址:https://www.cnblogs.com/qitian1/p/6461910.html
Copyright © 2011-2022 走看看