本文章由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—————

若有问题,请随时联系!!

非常感谢!!

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

Unity高像素截图的更多相关文章

  1. Unity项目接入应用宝SDK实现截图功能

    Unity项目接入应用宝SDK实现截图功能 问题由来 点击应用宝悬浮窗 如图所示 左下角有一个截图按钮 需要解决那些问题 截图信息需要由游戏引擎提供 SDK获取截图信息为同步 但是Unity引擎没有提 ...

  2. Unity 截取图片并且显示出来

    Unity 截取图片并且显示出来 近期用到了unity的截图,并且把他显示出来,摸索了很多! 讲解一个东西,android可以存储一些文件在本地,比如配置文件等! 对于不同的系统,方法不一! if ( ...

  3. 使用Unity3d做异形窗口

    项目马上上线,因为之前的登录器是使用VS2010的MFC做的,在很多电脑上会提示缺失mfcXXXX.dll,中间找寻这种解决方案,最后确定将vcredist2010_x86和我的程序打包到安装包里面, ...

  4. ubuntu中安装visual studio code-(转载)

    在Ubuntu中安装Visual Studio Code 编译自:http://itsfoss.com/install-visual-studio-code-ubuntu/ 作者: Abhishek ...

  5. Ubuntu 13.10 安装 Unity 8 试用截图

    关于 Unity 8 有很多报道,Unity 8 相对于 Unity 7 变化相当大,这是 Ubuntu 团队打造的一款通用于 PC.手机.平板的桌面. Unity 8 已经登陆 ubuntu 13. ...

  6. unity 截图 压缩 处理

    /****************************************************** unity屏幕截图,并转换成Base64码* 作者: lyb* 日期:2017年7月25 ...

  7. Unity协程截图,WWWForm、WWW配合上传

    先说一下原理.. 截图有两种方法,第一种: Application.CaptureScreenshot(url); 这个API可以截全屏并保存到指定路径 这里我们不采用此方法 下面的代码采用第二种方法 ...

  8. Unity截图

    什么都不说了,直接上代码. using UnityEngine; using System.Collections; using System.IO; public class CutImage : ...

  9. Unity 截图选择框,中间全透明,边缘半透明

    效果:点击白色框可拖拽选择区域 代码: using System.Collections; using System.Collections.Generic; using UnityEngine; u ...

随机推荐

  1. A brief preview of the new features introduced by OpenGL 3.3 and 4.0

    A brief preview of the new features introduced by OpenGL 3.3 and 4.0   The Khronos Group continues t ...

  2. ZOJ-3960 What Kind of Friends Are You?

    What Kind of Friends Are You? Time Limit: 1 Second      Memory Limit: 65536 KB Japari Park is a larg ...

  3. C# 文件压缩方法

    using System; using System.IO; using System.IO.Packaging; namespace Utility { public class ZipHelper ...

  4. js数组的各种方法

    1.检测数组 ①Instanceof: if(value instanceof Array){ } 它假定只有一个全局执行环境,若网页中包含多个框架,则存在多个不同的全局执行环境,则Instanceo ...

  5. Android基础夯实--重温动画(一)之Tween Animation

    心灵鸡汤:真正成功的人生,不在于成就的大小,而在于你是否努力地去实现自我,喊出自己的声音,走出属于自己的道路. 摘要 不积跬步,无以至千里:不积小流,无以成江海.学习任何东西我们都离不开扎实的基础知识 ...

  6. JS高级——文件操作

    https://www.cnblogs.com/mingmingruyuedlut/archive/2011/10/12/2208589.html https://blog.csdn.net/pl16 ...

  7. 基于Crypto++的aes 字符串加解密实现

    esaes.h: #ifndef ESAES_H #define ESAES_H #include <cryptopp/aes.h> #include <iostream> # ...

  8. vue项目国际化实现 vue-i18n使用详细教程

    1.安装vue-i18n: npm i vue-i18n -S 当然你也可以这样: <script src="https://unpkg.com/vue/dist/vue.js&quo ...

  9. 01C++编辑编译运行环境

    C++编辑编译运行环境 Bloodshed Dev-C++ Microsoft Visual Studio

  10. 00JAVA EE

    JAVA EE 三层架构 我们的开发架构一般都是基于两种形式,一种是C/S架构,也就是客户端/服务器,另一种是B/S架构,也就是浏览器服务器.在JavaEE开发中,几乎全都是基于B/S架构的开发.那么 ...