Unity3D-屏幕截图
来源:互联网 发布:手机屏幕写字的软件 编辑:程序博客网 时间:2024/06/11 11:00
public static IEnumerator ScreenShot() { yield return new WaitForEndOfFrame(); int width = Screen.width; int height = Screen.height; Texture2D tex = new Texture2D(width, height, TextureFormat.RGB24, false); tex.ReadPixels(new Rect(0, 0, width, height), 0, 0, true); byte[] imagebytes = tex.EncodeToPNG(); tex.Compress(false); string imagePath = ""; string name = System.DateTime.Now.ToString("yyyyMMddhhmmss") + ".png"; if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer) imagePath = Application.persistentDataPath + "/ScreenShot"; else if (Application.platform == RuntimePlatform.WindowsPlayer) imagePath = Application.dataPath + "/ScreenShot"; else if (Application.platform == RuntimePlatform.WindowsEditor) { imagePath = Application.dataPath; imagePath = imagePath.Replace("/Assets", "ScreenShot"); } imagePath = imagePath + "/" + name; System.IO.File.WriteAllBytes(imagePath, imagebytes); yield return new WaitForEndOfFrame(); //TODO }
0 0
- unity3d屏幕截图功能
- unity3d 屏幕截图
- Unity3D-屏幕截图
- Unity3d屏幕截图方法
- unity3d 屏幕截图多种写法
- unity3d 屏幕截图多种写法
- unity3d 屏幕截图 核心代码
- unity3d 屏幕截图多种写法
- Unity3D游戏开发之“屏幕截图”
- 屏幕截图
- 屏幕截图
- 屏幕截图
- 屏幕截图
- 屏幕截图
- 屏幕截图
- 屏幕截图
- 屏幕截图
- 屏幕截图
- stl——括号匹配
- Leetcode 233. Number of Digit One
- 使用SqlBulkCopy实现批量插入
- 被说了很多遍的设计模式---中介者模式
- 前台表格代码
- Unity3D-屏幕截图
- LeetCode 396. Rotate Function
- LeetCode Max Consecutive Ones
- java从入门到弃坑第四天
- C# 启动调试 开始执行(不调试)多线程程序执行效果不一样 Mutex(已解决)
- 软件工程从头学起(大数据方向)
- Java反射获取Android系统属性值
- fatal: unable to access 'https://github.com/taoge1024/kityminder.git/': SSL cert ificate problem: un
- 高斯日记