0

I'm trying to save a texture from the Raw Image, however when I save the saved ima

Ruina Minite
  • 1
  • 1
  • 6
  • Your issue may be solved because you are running this on the Editor. When you start building it, you realize that this code will fail. You can't write save data to `Application.streamingAssetsPath` during run-time. You can can only read from it. – Programmer Jan 23 '18 at 13:47

1 Answers1

1
 texture.SetPixels(texture.GetPixels());

You are copying the pixels from texture into texture. Are you trying to copy the pixels from frame into texture?

    Texture2D frameTexture = (Texture2D) frame.mainTexture;
    Texture2D texture = new Texture2D(frameTexture.width, frameTexture.height);

    texture.SetPixels(frameTexture.GetPixels());
    texture.Apply();