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?
1 Answer
\$\begingroup\$
\$\endgroup\$
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();