【问题标题】:How to save Texture2D as image in gallery?如何将 Texture2D 保存为图库中的图像?
【发布时间】:2018-12-26 04:48:40
【问题描述】:

假设我有一个 2D 纹理。如何统一保存为 PNGJPG 图像。如果可能的话,请用 cmets 写出最常见的版本。

【问题讨论】:

    标签: encode texture2d


    【解决方案1】:

    Texture2D 有一个 EncodeToPNGEncodeToJPG 方法。

    【讨论】:

    • 我知道。看这个。这在 android public Save(){ string path = Application.persistentDataPath + "/image.png"; bytes = FullImageTexture.EncodeToPNG(); System.IO.File.WriteAllBytes(path, bytes); } 中不起作用
    • 图片不会出现在图库和 emulated/0/Android/data/com.companyname.programname/files 中缺少的移动设备上
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多