uniy3D,实现改变一条像素点的功能 并存为png图

有任何问题可以添加 QQ群 207019099

Color[] colors = new Color[tex.width / 2];
tex.SetPixels(tex.width / 2, tex.height / 2, tex.width / 2, 1, colors);
tex.SetPixels(tex.width / 2, tex.height / 2, 1, tex.height / 2, colors);

//将RenderTexture保存成一张png图片
public bool SaveRenderTextureToPNG(byte[] bytes, string contents, string pngName)
{
if (!Directory.Exists(contents))
Directory.CreateDirectory(contents);
FileStream file = File.Open(contents + “/” + pngName + “.png”, FileMode.Create);
BinaryWriter writer = new BinaryWriter(file);
writer.Write(bytes);
file.Close();
return true;
}

猜你喜欢

转载自blog.csdn.net/gaofei12300/article/details/78031423