当前位置:网站首页>Resources reads 2D texture and converts it to PNG format
Resources reads 2D texture and converts it to PNG format
2022-07-02 11:14:00 【Sunshine in front of my heart】
file
Operation steps
- Picture on Read/Write Enable
- Use Texture2D Of EncodeToPNG Method to convert a texture into a byte array
- Using file streams , Store pictures to other locations
string path = Application.streamingAssetsPath + "/NewFolder";// Set storage path
Texture2D tx = Resources.Load<Texture2D>("girl");// Loading pictures
if (tx)
{
byte[] bytes;
bytes = tx.EncodeToPNG();// Convert to PNG
FileStream stream = new FileStream(path + "/test.png", FileMode.OpenOrCreate);
stream.Write(bytes, 0, bytes.Length);
stream.Close();
}
边栏推荐
- Luogu p4281 [ahoi2008] emergency gathering / gathering (tree doubling LCA)
- Openmldb meetup No.4 meeting minutes
- 力扣(LeetCode)182. 查找重复的电子邮箱(2022.07.01)
- QT学习日记7——QMainWindow
- [AI application] Hikvision ivms-4200 software installation
- PCL extracts a subset from a point cloud
- Special topic of binary tree -- acwing 47 Path with a certain value in binary tree (preorder traversal)
- Internship report skywalking distributed link tracking?
- 高德根据轨迹画线
- webauthn——官方开发文档
猜你喜欢

洛谷 P5536 【XR-3】核心城市(贪心 + 树形 dp 寻找树的中心)

三.芯片啟動和時鐘系統
![[play with FPGA learning 2 in simple terms ----- design skills (basic grammar)]](/img/50/22f2fa8fd606572b13a18cc889ca2e.png)
[play with FPGA learning 2 in simple terms ----- design skills (basic grammar)]

Openmldb meetup No.4 meeting minutes

二.Stm32f407芯片GPIO编程,寄存器操作,库函数操作和位段操作

Verilog and VHDL signed and unsigned number correlation operations

Multi line display and single line display of tqdm

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

Matlab processing of distance measurement of experimental electron microscope

二叉树专题--AcWing 1589. 构建二叉搜索树
随机推荐
TIPC introduction 1
从攻击面视角,看信创零信任方案实践
Static variables in static function
二叉树专题--AcWing 19. 二叉树的下一个节点(找树中节点的后继)
洛谷 P3398 仓鼠找 sugar(树上倍增 lca 判断树中两条路径是否相交 结论)
sqlite 修改列类型
Thanos Receiver
二叉树专题--AcWing 18. 重建二叉树(利用前、中序遍历,构建二叉树)
三.芯片啟動和時鐘系統
二叉树专题--AcWing 1589. 构建二叉搜索树
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
Luogu p5536 [xr-3] core city (greed + tree DP looking for the center of the tree)
Logu p3398 hamster looks for sugar (double LCA on the tree to judge whether the two paths in the tree intersect)
QT学习日记8——资源文件添加
【深入浅出玩转FPGA学习2----设计技巧(基本语法)】
二叉树专题--洛谷 P3884 [JLOI2009]二叉树问题(dfs求二叉树深度 bfs求二叉树宽度 dijkstra求最短路)
Binary tree topic -- Luogu p3884 [jloi2009] binary tree problem (DFS for binary tree depth BFS for binary tree width Dijkstra for shortest path)
Rest (XOR) position and thinking
V2x SIM dataset (Shanghai Jiaotong University & New York University)
TIPC Service and Topology Tracking4