Ejemplo n.º 1
0
        static void SingleConvert(string path)
        {
            using (var stream = File.OpenRead(path))
            {
                var texture = new Texture(stream);

                texture.SaveBitmap(Path.ChangeExtension(path, ".png"));
            }
        }
Ejemplo n.º 2
0
        static void SingleConvert(string path)
        {
            using (var stream = File.OpenRead(path))
            {
                var texture = new Texture(stream);

                texture.SaveBitmap(Path.ChangeExtension(path, ".png"));
            }
        }
Ejemplo n.º 3
0
        static void BatchConvert(string path)
        {
            using (var archive = new ZipArchive(File.OpenRead(path)))
            {
                foreach (var entry in archive.Entries)
                {
                    var extension = Path.GetExtension(entry.Name);

                    if (extension.Equals(".tex", StringComparison.OrdinalIgnoreCase))
                    {
                        Console.WriteLine(entry.FullName);

                        using (var stream = entry.Open())
                        {
                            var texture = new Texture(stream);
                            var directoryName = Path.GetDirectoryName(path);
                            var fullName = Path.ChangeExtension(entry.FullName, ".png");

                            texture.SaveBitmap(Path.Combine(directoryName, fullName));
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
        static void BatchConvert(string path)
        {
            using (var archive = new ZipArchive(File.OpenRead(path)))
            {
                foreach (var entry in archive.Entries)
                {
                    var extension = Path.GetExtension(entry.Name);

                    if (extension.Equals(".tex", StringComparison.OrdinalIgnoreCase))
                    {
                        Console.WriteLine(entry.FullName);

                        using (var stream = entry.Open())
                        {
                            var texture       = new Texture(stream);
                            var directoryName = Path.GetDirectoryName(path);
                            var fullName      = Path.ChangeExtension(entry.FullName, ".png");

                            texture.SaveBitmap(Path.Combine(directoryName, fullName));
                        }
                    }
                }
            }
        }