private static void SearchAndExportBg(string baseDir, string outputDir) { foreach (string file in Directory.GetFiles(outputDir, "*.n2d", SearchOption.AllDirectories)) { string relativePath = file.Replace(outputDir, ""); string imageName = Path.GetFileNameWithoutExtension(file); string imagePath = Path.Combine(baseDir, relativePath, imageName + ".png"); try { Npck pack = new Npck(file); pack.GetBackgroundImage().Save(imagePath); } catch (Exception ex) { Console.WriteLine("Error trying to export: {0} to {1}", relativePath, imagePath); Console.WriteLine("\t" + ex.ToString()); continue; } Console.WriteLine("Exported {0} -> {1}", relativePath, imageName); } }
private static void ExtractPack(string packFile, string outputImage) { Npck npck = new Npck(packFile); npck.GetBackgroundImage().Save(outputImage); }