Exemplo n.º 1
0
        public static Microsoft.Xna.Framework.Graphics.Texture2D GetTextureOnEnd(Microsoft.Xna.Framework.Graphics.Texture2D texture)
        {
            texture.Name = _nameGetTextureRoughPass.Replace('/', '_').Replace('\\', '_');
            //Console.WriteLine("TEXTURE!");
            var path = Workspace.MDKFolder + Path.DirectorySeparatorChar + texture.Name + ".png";

            if (!File.Exists(path))
            {
                using (Stream dumpstream = File.Open(path, FileMode.OpenOrCreate, FileAccess.Write))
                {
                    texture.SaveAsPng(dumpstream, texture.Width, texture.Height);
                }
            }
            return(texture);
        }
Exemplo n.º 2
0
 public static void Save(this Microsoft.Xna.Framework.Graphics.Texture2D texture, string fileName)
 {
     texture.SaveAsPng(new FileStream(fileName, FileMode.Create, FileAccess.Write), texture.Width, texture.Height);
 }