Make texture2D readable in runtime/script Unity3D [duplicate]

心已入冬 提交于 2019-12-06 15:24:32

If you have the files in your project, you can select the texture in the inspector, set the texture type to "Advanced," then set "Read and write enabled" to true.

If not, you can try using GetRawTextureData() on the texture you have, then create a new texture with the same width and height and call LoadImage() on the new texture with the data you got from the old one, making sure markNonReadable is false. Then you should be able to do what you want on the new texture and display that while the user is cropping the image.

http://docs.unity3d.com/ScriptReference/Texture2D.GetRawTextureData.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!