private void View_ImportClicked(object sender, EventArgs e) { var texture = _view.TextureView.SelectedTexture; if (texture != null) { var ofd = new OpenFileDialog() { AddExtension = true, Title = "Import Texture", Filter = "Portable Network Graphics (*.png)|*.png", InitialDirectory = _workingDirectory, FileName = texture.TitleName + ".png" }; if (ofd.ShowDialog() == DialogResult.OK) { var image = Image.FromFile(ofd.FileName); texture.Encode(image); _workingDirectory = new FileInfo(ofd.FileName).Directory.FullName; _textureViewController.UpdateImage(); _view.TextureView.RedrawTextureList(); } } }