当前位置:网站首页>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();
}
边栏推荐
- What are the software product management systems? Inventory of 12 best product management tools
- Importerror: impossible d'importer le nom « graph» de « graphviz»
- static 函数中的静态变量
- ctf 记录
- Gaode draws lines according to the track
- TIPC 寻址2
- How to transfer event objects and user-defined parameters simultaneously in Huawei express applications
- Internship report skywalking distributed link tracking?
- 二叉树专题--AcWing 47. 二叉树中和为某一值的路径(前序遍历)
- V2X-Sim数据集(上海交大&纽约大学)
猜你喜欢
![[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

How to use ide to automatically sign and debug Hongmeng application
![[applinking practical case] share in app pictures through applinking](/img/12/5616f1fa55387b81e25e55a98022b9.png)
[applinking practical case] share in app pictures through applinking

I STM32 development environment, keil5/mdk5.14 installation tutorial (with download link)

QT learning diary 8 - resource file addition

VS2019代码中包含中文内容导致的编译错误和打印输出乱码问题

TIPC Cluster5

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

How to transfer event objects and user-defined parameters simultaneously in Huawei express applications

The most detailed MySQL installation tutorial
随机推荐
C# 文件与文件夹操作
ros缺少xacro的包
三.芯片启动和时钟系统
三.芯片啟動和時鐘系統
金山云——2023届暑期实习
QT learning diary 8 - resource file addition
STM32单片机编程学习
Luogu p5536 [xr-3] core city (greed + tree DP looking for the center of the tree)
PCL eigen introduction and simple use
ctf 记录
TIPC addressing 2
mmrotate旋转目标检测框架使用记录
How does the whole network display IP ownership?
高德根据轨迹画线
LVM操作
二叉树专题--AcWing 1589. 构建二叉搜索树
PCL projection point cloud
Is the account above changtou school safe?
enumrate的start属性的坑
Special topic of binary tree -- acwing 19 The next node of the binary tree (find the successor of the node in the tree)