2
\$\begingroup\$

I have a Color[,] variable and I already know how to convert it to a Texture2D. How do I then save it as .png image?

\$\endgroup\$
3
\$\begingroup\$

As specified in the doc

public void SaveAsPng (
         Stream stream,
         int width,
         int height
)

Did you try:

// myTexture = something
Stream stream = File.Create("file.png"); 
myTexture.SaveAsPng( stream, myTexture.Width, myTexture.Height );
stream.Dispose();
myTexture.Dispose();
| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.