Unity3d 截屏之后转换成Texture2d
2013-08-08 14:00
411 查看
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);
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的Texture2D与opencv的Mat之间的相互转换
- unity3D ShaderLab <五>漫反射光照改善技巧之使用2D ramp texture来创建一个假的BRDF(双向反射分布函数)
- Unity3D 把Texture2D保存到文件
- Unity3d Texture2D打包图集
- Unity3D-gif转Texture2D
- Unity3d-Texture2D.ReadPixels
- (VR, AR)unity3d和Android java通信 传输 byte图片在Texture2d显示
- Directx 将2D texture转换成Volume Texture的方法
- MonoGame 3.2 下,截屏与 Texture2D 的保存
- Unity3D中的Texture2D纹理失真解决办法
- unity3d texture2d动画(纹理动画)
- Unity在运行时,将Texture2D转换成Sprite格式
- 二维纹理 Texture 2D
- unity3d技术---在2d游戏中用shader模拟阴影
- Unity 中 Png转Texture2D再转Sprite
- Color32[]赋给Texture2D是否太过丧病,开玩笑,我只是试一下……
- Unity3d 导入图片 自动修改Texture Type为Sprite (2D and UI) 及设置 Packing Tag为文件夹名
- css3属性之2D转换、3D转换、过度、动画
- 将“Cocos2dx-截屏并设置图片尺寸 ”中cocos2d-x代码转换为2.2的代码
- Unity3D中的socket通信之八(字节数组与数据转换dll-byte int string float)