private byte rawData;
void Update()
{
Texture2D tex = (Texture2D)rawImage.texture;
rawData = tex.EncodeToPNG();
}
Give me: Unsupported texture format - Texture2D::EncodeTo functions do not support compressed texture formats.
private byte rawData;
void Update()
{
Texture2D tex = (Texture2D)rawImage.texture;
rawData = tex.EncodeToPNG();
}
Give me: Unsupported texture format - Texture2D::EncodeTo functions do not support compressed texture formats.
What is the question?
Texture2D.EncodeTo functions do not support compressed texture formats.
This function works only on
uncompressed, non-HDR texture formats.
After a lot of research, i found this post which kind of fixed my problem but doesn’t work perfectly. The end result is a jpg file, yes but it’s dimensions are messed up. I think you’ll have to play around with the settings a bit to make it work correctly…