当前位置:网站首页>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();
}
边栏推荐
- flink二開,實現了個 batch lookup join(附源碼)
- TIPC Cluster5
- How to use ide to automatically sign and debug Hongmeng application
- Set the playback speed during the playback of UOB equipment
- php中self和static在方法中的区别
- 【付费推广】常见问题合集,推荐榜单FAQ
- Common methods of JS array
- Huawei game failed to initialize init with error code 907135000
- MySQL lethal serial question 4 -- are you familiar with MySQL logs?
- Oracle 笔记
猜你喜欢

Use of vscode tool
![[AGC] how to solve the problem that the local display of event analysis data is inconsistent with that in AGC panel?](/img/66/674a06d8e45a31ae879b81554ef373.png)
[AGC] how to solve the problem that the local display of event analysis data is inconsistent with that in AGC panel?

The most detailed MySQL installation tutorial

使用华为性能管理服务,按需配置采样率
![[TS] 1368 seconds understand typescript generic tool types!](/img/2b/58a850b52ce8a9b2e6e7b6b72b0fe5.jpg)
[TS] 1368 seconds understand typescript generic tool types!

Special topic of binary tree -- acwing 19 The next node of the binary tree (find the successor of the node in the tree)
![[quick application] there are many words in the text component. How to solve the problem that the div style next to it will be stretched](/img/5c/b0030fd5fbc07eb94013f2699c2a04.png)
[quick application] there are many words in the text component. How to solve the problem that the div style next to it will be stretched

Leetcode+ 76 - 80 storm search topic
![Luogu p5536 [xr-3] core city (greed + tree DP looking for the center of the tree)](/img/dc/2aa55c9b3f23c292820a56ea72fedd.png)
Luogu p5536 [xr-3] core city (greed + tree DP looking for the center of the tree)
![二叉树专题--洛谷 P3884 [JLOI2009]二叉树问题(dfs求二叉树深度 bfs求二叉树宽度 dijkstra求最短路)](/img/c2/bb85b681af0f78b380b1d179c7ea49.png)
二叉树专题--洛谷 P3884 [JLOI2009]二叉树问题(dfs求二叉树深度 bfs求二叉树宽度 dijkstra求最短路)
随机推荐
Analysis of hot spots in AI technology industry
洛谷 P1892 [BOI2003]团伙(并查集变种 反集)
一.STM32的开发环境,keil5/MDK5.14安装教程(附下载链接)
PCL eigen introduction and simple use
js数组常用方法
Creation and use of unified links in Huawei applinking
In the face of uncertainty, the role of supply chain
PCL projection point cloud
PCL Eigen介绍及简单使用
2022-06-17
【AI应用】海康威视iVMS-4200软件安装
Special topic of binary tree -- Logu p1229 traversal problem (the number of traversals in the middle order is calculated when the pre and post order traversals of the multiplication principle are know
[play with FPGA learning 2 in simple terms ----- design skills (basic grammar)]
二叉树专题--AcWing 19. 二叉树的下一个节点(找树中节点的后继)
flink二开,实现了个 batch lookup join(附源码)
【深入浅出玩转FPGA学习4----漫谈状态机设计】
华为联机对战服务玩家掉线重连案例总结
Point cloud projection picture
Special topic of binary tree -- [deep base 16. Example 7] ordinary binary tree (simplified version) (multiset seeks the precursor and subsequent sentry Art)
Huawei game failed to initialize init with error code 907135000