Save AcquireCameraImageBytes() from Unity ARCore to storage as an image

前端 未结 2 801
误落风尘
误落风尘 2020-12-10 18:17

Using unity, and the new 1.1 version of ARCore, the API exposes some new ways of getting the camera information. However, I can\'t find any good examples of saving this as a

2条回答
  •  抹茶落季
    2020-12-10 19:01

    Since I'm not familiar with ARCore, I shall keep this generic.

    1. Load the byte array into your Texture2D using LoadRawTextureData() and Apply()
    2. Encode the texture using EncodeToJPG()
    3. Save the encoded data with File.WriteAllBytes(path + ".jpg", encodedBytes)

提交回复
热议问题