您的位置:首页 > 移动开发 > Unity3D

Unity3d 截屏之后转换成Texture2d

2013-08-08 14:00 369 查看
Step 1 声明截屏的图片所放的文件地址

string _path = Application.persistentDataPath + "Screenshot.png";

Step 2 截屏

 Application.CaptureScreenshot(_path);

Step3 转换成byte[]

FileStream _fs = new FileStream(_path, FileMode.Open);

byte[] _byteDate = new byte[_fs.Length];

Step4 转换成Texture2D

Texture2D _image = new Texture2D(100, 100);

image.LoadImage(_byteDate);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Unity3D