public void load(string filePath, int index) { LBXReader lbx = new LBXReader(filePath); LBXBlock block = new LBXBlock(); lbx.read(block, index); load(block); lbx.close(); }
private void mainForm_Load(object sender, EventArgs e) { //blockViewTabControl.SelectedTab = tabPage2; // load config file, if it exists if (File.Exists(defaultConfigFileName)) { loadConfigFromFile(defaultConfigFileName); } // else set the root of the folder dialog to My Computer else { folderBrowserDialog1.RootFolder = Environment.SpecialFolder.MyComputer; } // initialize a few controls currentLBXFileName = ""; errorLabel.Visible = false; // 1 LBXReader used form-wide lbxReader = new LBXReader(); // create the Bitmaps for the palette boxes and clear 'em white externalPalettePictureBox.Image = new Bitmap(162, 162); internalPalettePictureBox.Image = new Bitmap(162, 162); mixedPalettePictureBox.Image = new Bitmap(162, 162); Graphics g = Graphics.FromImage(externalPalettePictureBox.Image); g.Clear(Color.White); g = Graphics.FromImage(internalPalettePictureBox.Image); g.Clear(Color.White); g = Graphics.FromImage(mixedPalettePictureBox.Image); g.Clear(Color.White); internalPaletteLockButton.Enabled = false; // load up some palettes loadPalettes(); loadFonts(); }