当前位置:网站首页>Resources读取2d纹理 转换为png格式
Resources读取2d纹理 转换为png格式
2022-07-02 07:33:00 【心前阳光】
文档
操作步骤
- 图片开启 Read/Write Enable
- 使用Texture2D的EncodeToPNG方法将纹理转换为字节数组
- 使用文件流,存储图片到其他位置
string path = Application.streamingAssetsPath + "/NewFolder";//设置存储路径
Texture2D tx = Resources.Load<Texture2D>("girl");//加载图片
if (tx)
{
byte[] bytes;
bytes = tx.EncodeToPNG();//转换为PNG
FileStream stream = new FileStream(path + "/test.png", FileMode.OpenOrCreate);
stream.Write(bytes, 0, bytes.Length);
stream.Close();
}
边栏推荐
- nodejs+express+mysql简单博客搭建
- [AI application] Hikvision ivms-4200 software installation
- 【AI应用】海康威视iVMS-4200软件安装
- 华为游戏初始化init失败,返回错误码907135000
- 点云投影图片
- 洛谷 P5536 【XR-3】核心城市(贪心 + 树形 dp 寻找树的中心)
- HDU1234 开门人和关门人(水题)
- Implement custom drawer component in quick application
- Jsp webshell Free from killing - The Foundation of JSP
- Hdu1234 door opener and door closer (water question)
猜你喜欢

One trick to quickly realize custom application titlebar

三.芯片启动和时钟系统

Use Huawei performance management service to configure the sampling rate on demand
![二叉树专题--洛谷 P3884 [JLOI2009]二叉树问题(dfs求二叉树深度 bfs求二叉树宽度 dijkstra求最短路)](/img/c2/bb85b681af0f78b380b1d179c7ea49.png)
二叉树专题--洛谷 P3884 [JLOI2009]二叉树问题(dfs求二叉树深度 bfs求二叉树宽度 dijkstra求最短路)

二叉树专题--AcWing 18. 重建二叉树(利用前、中序遍历,构建二叉树)
![[TS] 1368 seconds understand typescript generic tool types!](/img/2b/58a850b52ce8a9b2e6e7b6b72b0fe5.jpg)
[TS] 1368 seconds understand typescript generic tool types!

一.STM32的开发环境,keil5/MDK5.14安装教程(附下载链接)

618 what is the secret of dominating the list again? Nike's latest financial report gives the answer

VSCode工具使用

【AGC】构建服务3-认证服务示例
随机推荐
华为应用市场应用统计数据问题大揭秘
Special topic of binary tree -- acwing 19 The next node of the binary tree (find the successor of the node in the tree)
static 函数中的静态变量
Set the playback speed during the playback of UOB equipment
In the face of uncertainty, the role of supply chain
PCL 投影点云
Special topic of binary tree -- acwing 3540 Binary search tree building (use the board to build a binary search tree and output the pre -, middle -, and post sequence traversal)
二叉树专题--AcWing 1589. 构建二叉搜索树
P1055 [noip2008 popularization group] ISBN number
Jsp webshell Free from killing - The Foundation of JSP
MySQL keyword
JVM之垃圾回收器
二叉树专题--AcWing 18. 重建二叉树(利用前、中序遍历,构建二叉树)
How to use ide to automatically sign and debug Hongmeng application
Special topic of binary tree -- acwing 18 Rebuild the binary tree (construct the binary tree by traversing the front and middle order)
【深入浅出玩转FPGA学习5-----复位设计】
【深入浅出玩转FPGA学习2----设计技巧(基本语法)】
集成学习概览
V2X-Sim数据集(上海交大&纽约大学)
点云投影图片