当前位置:网站首页>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();
}
边栏推荐
猜你喜欢
TIPC messaging3
二叉树专题--AcWing 1589. 构建二叉搜索树
二叉树专题--AcWing 1497. 树的遍历(利用后、中序遍历,构建二叉树)
Luogu p5536 [xr-3] core city (greed + tree DP looking for the center of the tree)
The most detailed MySQL installation tutorial
tqdm的多行显示与单行显示
Win11 arm system configuration Net core environment variable
Special topic of binary tree -- acwing 1589 Building binary search tree
三.芯片啟動和時鐘系統
What are the software product management systems? Inventory of 12 best product management tools
随机推荐
【AI应用】海康威视iVMS-4200软件安装
【深入浅出玩转FPGA学习4----漫谈状态机设计】
flink二开,实现了个 batch lookup join(附源码)
spritejs
[AGC] how to solve the problem that the local display of event analysis data is inconsistent with that in AGC panel?
TIPC 寻址2
二叉树专题--AcWing 47. 二叉树中和为某一值的路径(前序遍历)
QT学习日记8——资源文件添加
Luogu p1892 [boi2003] Gang (and search for variant anti set)
Luogu p5536 [xr-3] core city (greed + tree DP looking for the center of the tree)
TIPC Cluster5
ros gazebo相关包的安装
Resources读取2d纹理 转换为png格式
flink二開,實現了個 batch lookup join(附源碼)
sql left join 主表限制条件写在on后面和写在where后面的区别
The working day of the month is calculated from the 1st day of each month
PCL projection point cloud
How to use ide to automatically sign and debug Hongmeng application
V2X-Sim数据集(上海交大&纽约大学)
Functional interfaces and method references