public void SetupTreeView(FRMFile file) { treeView1.Nodes.Clear(); //string[] directions = { "Northeast", "East", "Southeast", "South", "Southwest", "West", "Northeast" }; TreeNode[] rootChildren = new TreeNode[6]; for (int i = 0; i < 6; i++) { TreeNode tn = new TreeNode("Orientation " + i); tn.Tag = i; rootChildren[i] = tn; } for (int i = 0; i < 6; i++) { for (int j = 0; j < file.listArray[i].Count; j++) { TreeNode frmNode = new TreeNode("FRAME " + j + ""); frmNode.Tag = j; rootChildren[i].Nodes.Add(frmNode); } } treeView1.Nodes.Add(new TreeNode("Frame Collection - " + file.actionFrame + ", " + file.framesPerDir, rootChildren)); }
private void firstFRM2PNGInDirectoryToolStripMenuItem_Click(object sender, EventArgs e) { if (commonColors == null) { return; } DialogResult s = folderBrowserDialog1.ShowDialog(); if (s == System.Windows.Forms.DialogResult.OK) { DirectoryInfo di = new DirectoryInfo(folderBrowserDialog1.SelectedPath); int c = 0; foreach (FileInfo f in di.GetFiles()) { if (f.Name.EndsWith(".FRM")) { string name = folderBrowserDialog1.SelectedPath + "\\" + f.Name; currentFile = new FRMFile(name); currentFile.frames[0].toBitmap(commonColors).Save(name + ".PNG", System.Drawing.Imaging.ImageFormat.Png); c++; } } MessageBox.Show(c + " file(s) processed.", "Batch Job Terminated", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void loadFRMToolStripMenuItem_Click(object sender, EventArgs e) { ofdFRMLoad.ShowDialog(); try { currentFile = new FRMFile(ofdFRMLoad.FileName); toolStripStatusLabel1.Text = "Frame File Successfully Loaded."; } catch (Exception eee) { MessageBox.Show(eee.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (currentFile != null & commonColors != null) { // MessageBox.Show(commonColors.entry[0].R + " red " + commonColors.entry[0].G + " green " + commonColors.entry[0].B + " blue "); // MessageBox.Show(currentFile + " FRAMES" + currentFile.frames[0]); pictureBox1.Image = currentFile.frames[0].toBitmap(commonColors); SetupTreeView(currentFile); // MessageBox.Show("DUn"); } }