static void SingleConvert(string path) { using (var stream = File.OpenRead(path)) { var texture = new Texture(stream); texture.SaveBitmap(Path.ChangeExtension(path, ".png")); } }
static void SingleConvert(string path) { using (var stream = File.OpenRead(path)) { var texture = new Texture(stream); texture.SaveBitmap(Path.ChangeExtension(path, ".png")); } }
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)); } } } } }
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)); } } } } }