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\$

1 Answer 1

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();
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .