diff --git a/Kalkimg/FormMain.Designer.cs b/Kalkimg/FormMain.Designer.cs index 9f87069..b12efc5 100644 --- a/Kalkimg/FormMain.Designer.cs +++ b/Kalkimg/FormMain.Designer.cs @@ -31,7 +31,6 @@ private void InitializeComponent() { this.scaleUp = new System.Windows.Forms.CheckBox(); this.fullSize = new System.Windows.Forms.CheckBox(); this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); - this.advancedOptions = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.currentImagePictureBox)).BeginInit(); this.SuspendLayout(); // @@ -114,24 +113,13 @@ private void InitializeComponent() { // // saveFileDialog // - this.saveFileDialog.Filter = "C2P Files (*.c2p)|*.c2p"; - // - // advancedOptions - // - this.advancedOptions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.advancedOptions.Location = new System.Drawing.Point(352, 448); - this.advancedOptions.Name = "advancedOptions"; - this.advancedOptions.Size = new System.Drawing.Size(110, 23); - this.advancedOptions.TabIndex = 9; - this.advancedOptions.Text = "Advanced Options"; - this.advancedOptions.UseVisualStyleBackColor = true; + this.saveFileDialog.Filter = "C2P Files (*.c2p)|*.c2p|All Files (*.*)|*.*"; // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(474, 481); - this.Controls.Add(this.advancedOptions); this.Controls.Add(this.fullSize); this.Controls.Add(this.scaleUp); this.Controls.Add(this.maintainAspectRatio); @@ -156,7 +144,6 @@ private void InitializeComponent() { private System.Windows.Forms.CheckBox scaleUp; private System.Windows.Forms.CheckBox fullSize; private System.Windows.Forms.SaveFileDialog saveFileDialog; - private System.Windows.Forms.Button advancedOptions; } } diff --git a/Kalkimg/FormMain.cs b/Kalkimg/FormMain.cs index 7b1a7a6..33643c0 100644 --- a/Kalkimg/FormMain.cs +++ b/Kalkimg/FormMain.cs @@ -10,6 +10,8 @@ public partial class FormMain : Form { private Bitmap currentImageOriginal; private Bitmap currentImageTransformed; + private string openedFileName; + public FormMain() { InitializeComponent(); } @@ -26,6 +28,8 @@ private void RunTransform() { private void loadImage_Click(object sender, EventArgs e) { if (openFileDialog.ShowDialog() == DialogResult.OK) { + openedFileName = Path.GetFileNameWithoutExtension(openFileDialog.FileName); + currentImageOriginal = (Bitmap) Image.FromFile(openFileDialog.FileName); bool imageSmallerThanMax = currentImageOriginal.Width < Utility.MAX_IMAGE_WIDTH && currentImageOriginal.Height < Utility.MAX_IMAGE_HEIGHT; @@ -43,6 +47,7 @@ private void saveImage_Click(object sender, EventArgs e) { return; } + saveFileDialog.FileName = openedFileName; if (saveFileDialog.ShowDialog() == DialogResult.OK) { C2PFile c2pFile = new C2PFile(currentImageTransformed);