From b79a9000dc9a91adb3c9cb8bfe92dd2190601310 Mon Sep 17 00:00:00 2001 From: Manuel Kamper Date: Fri, 16 Aug 2019 21:27:34 +0200 Subject: [PATCH] gui changes and bug fixed --- Mk0.Software.ImageSorter/Main.Designer.cs | 61 ++++++++----------- Mk0.Software.ImageSorter/Main.cs | 16 ++++- .../Mk0.Software.ImageSorter.csproj | 2 +- .../Properties/AssemblyInfo.cs | 2 +- 4 files changed, 41 insertions(+), 40 deletions(-) diff --git a/Mk0.Software.ImageSorter/Main.Designer.cs b/Mk0.Software.ImageSorter/Main.Designer.cs index 9ca8799..6fa2225 100644 --- a/Mk0.Software.ImageSorter/Main.Designer.cs +++ b/Mk0.Software.ImageSorter/Main.Designer.cs @@ -60,7 +60,7 @@ this.labelNoImages = new System.Windows.Forms.Label(); this.groupBoxRander = new System.Windows.Forms.GroupBox(); this.labelRander = new System.Windows.Forms.Label(); - this.numericUpDownRander = new System.Windows.Forms.NumericUpDown(); + this.trackBarRander = new System.Windows.Forms.TrackBar(); this.buttonRandLinks = new System.Windows.Forms.Button(); this.buttonRandRechts = new System.Windows.Forms.Button(); this.buttonRandUnten = new System.Windows.Forms.Button(); @@ -86,7 +86,7 @@ this.panelButtons.SuspendLayout(); this.panelImageBackground.SuspendLayout(); this.groupBoxRander.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownRander)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.trackBarRander)).BeginInit(); this.panelBanner.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxBanner2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxBanner1)).BeginInit(); @@ -425,14 +425,14 @@ // this.groupBoxRander.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.groupBoxRander.Controls.Add(this.labelRander); - this.groupBoxRander.Controls.Add(this.numericUpDownRander); + this.groupBoxRander.Controls.Add(this.trackBarRander); this.groupBoxRander.Controls.Add(this.buttonRandLinks); this.groupBoxRander.Controls.Add(this.buttonRandRechts); this.groupBoxRander.Controls.Add(this.buttonRandUnten); this.groupBoxRander.Controls.Add(this.buttonRandOben); - this.groupBoxRander.Location = new System.Drawing.Point(428, 362); + this.groupBoxRander.Location = new System.Drawing.Point(428, 347); this.groupBoxRander.Name = "groupBoxRander"; - this.groupBoxRander.Size = new System.Drawing.Size(109, 171); + this.groupBoxRander.Size = new System.Drawing.Size(109, 186); this.groupBoxRander.TabIndex = 18; this.groupBoxRander.TabStop = false; this.groupBoxRander.Text = "Ränder schneiden"; @@ -440,39 +440,30 @@ // // labelRander // + this.labelRander.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.labelRander.AutoSize = true; - this.labelRander.Location = new System.Drawing.Point(53, 30); + this.labelRander.Location = new System.Drawing.Point(6, 52); this.labelRander.Name = "labelRander"; - this.labelRander.Size = new System.Drawing.Size(21, 13); + this.labelRander.Size = new System.Drawing.Size(30, 13); this.labelRander.TabIndex = 12; - this.labelRander.Text = "px."; + this.labelRander.Text = "1 px."; // - // numericUpDownRander + // trackBarRander // - this.numericUpDownRander.Location = new System.Drawing.Point(6, 28); - this.numericUpDownRander.Maximum = new decimal(new int[] { - 10, - 0, - 0, - 0}); - this.numericUpDownRander.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.numericUpDownRander.Name = "numericUpDownRander"; - this.numericUpDownRander.Size = new System.Drawing.Size(41, 20); - this.numericUpDownRander.TabIndex = 11; - this.numericUpDownRander.Value = new decimal(new int[] { - 1, - 0, - 0, - 0}); + this.trackBarRander.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.trackBarRander.LargeChange = 1; + this.trackBarRander.Location = new System.Drawing.Point(6, 18); + this.trackBarRander.Minimum = 1; + this.trackBarRander.Name = "trackBarRander"; + this.trackBarRander.Size = new System.Drawing.Size(95, 45); + this.trackBarRander.TabIndex = 13; + this.trackBarRander.Value = 1; + this.trackBarRander.Scroll += new System.EventHandler(this.TrackBarRander_Scroll); // // buttonRandLinks // this.buttonRandLinks.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonRandLinks.Location = new System.Drawing.Point(6, 54); + this.buttonRandLinks.Location = new System.Drawing.Point(6, 69); this.buttonRandLinks.Name = "buttonRandLinks"; this.buttonRandLinks.Size = new System.Drawing.Size(95, 23); this.buttonRandLinks.TabIndex = 7; @@ -484,7 +475,7 @@ // buttonRandRechts // this.buttonRandRechts.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonRandRechts.Location = new System.Drawing.Point(6, 83); + this.buttonRandRechts.Location = new System.Drawing.Point(6, 98); this.buttonRandRechts.Name = "buttonRandRechts"; this.buttonRandRechts.Size = new System.Drawing.Size(95, 23); this.buttonRandRechts.TabIndex = 8; @@ -496,7 +487,7 @@ // buttonRandUnten // this.buttonRandUnten.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonRandUnten.Location = new System.Drawing.Point(6, 141); + this.buttonRandUnten.Location = new System.Drawing.Point(6, 156); this.buttonRandUnten.Name = "buttonRandUnten"; this.buttonRandUnten.Size = new System.Drawing.Size(95, 23); this.buttonRandUnten.TabIndex = 10; @@ -508,7 +499,7 @@ // buttonRandOben // this.buttonRandOben.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonRandOben.Location = new System.Drawing.Point(6, 112); + this.buttonRandOben.Location = new System.Drawing.Point(6, 127); this.buttonRandOben.Name = "buttonRandOben"; this.buttonRandOben.Size = new System.Drawing.Size(95, 23); this.buttonRandOben.TabIndex = 9; @@ -693,7 +684,7 @@ this.MinimumSize = new System.Drawing.Size(983, 605); this.Name = "Main"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Image Sorter v1.40 | © 2015-2019 by manuelkamper.com"; + this.Text = "Image Sorter v1.41 | © 2015-2019 by manuelkamper.com"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Main_FormClosing); this.Load += new System.EventHandler(this.Main_Load); this.Shown += new System.EventHandler(this.Main_Shown); @@ -709,7 +700,7 @@ this.panelImageBackground.ResumeLayout(false); this.groupBoxRander.ResumeLayout(false); this.groupBoxRander.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownRander)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.trackBarRander)).EndInit(); this.panelBanner.ResumeLayout(false); this.panelBanner.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxBanner2)).EndInit(); @@ -766,10 +757,10 @@ private System.Windows.Forms.Button buttonRander; private System.Windows.Forms.GroupBox groupBoxRander; private System.Windows.Forms.Label labelRander; - private System.Windows.Forms.NumericUpDown numericUpDownRander; private System.Windows.Forms.Button buttonRandLinks; private System.Windows.Forms.Button buttonRandRechts; private System.Windows.Forms.Button buttonRandUnten; private System.Windows.Forms.Button buttonRandOben; + private System.Windows.Forms.TrackBar trackBarRander; } } diff --git a/Mk0.Software.ImageSorter/Main.cs b/Mk0.Software.ImageSorter/Main.cs index 42f8504..ac56da6 100644 --- a/Mk0.Software.ImageSorter/Main.cs +++ b/Mk0.Software.ImageSorter/Main.cs @@ -130,11 +130,11 @@ namespace Mk0.Software.ImageSorter { Width = Properties.Settings.Default.lastWidth; } - if (Properties.Settings.Default.lastTop <= Screen.PrimaryScreen.Bounds.Height) + if (Properties.Settings.Default.lastTop <= Screen.PrimaryScreen.Bounds.Height && Properties.Settings.Default.lastTop >= 0) { Top = Properties.Settings.Default.lastTop; } - if (Properties.Settings.Default.lastLeft <= Screen.PrimaryScreen.Bounds.Width) + if (Properties.Settings.Default.lastLeft <= Screen.PrimaryScreen.Bounds.Width && Properties.Settings.Default.lastLeft >= 0) { Left = Properties.Settings.Default.lastLeft; } @@ -1463,7 +1463,7 @@ namespace Mk0.Software.ImageSorter string cutString = btn.Tag.ToString(); Image im = pictureBoxImage.Image; - int move = (int)numericUpDownRander.Value; + int move = trackBarRander.Value; int x = 0, y = 0, width = im.Width, height = im.Height; if (cutString == "links") @@ -1525,5 +1525,15 @@ namespace Mk0.Software.ImageSorter bmpImage.PixelFormat); return (Image)(bmpCrop); } + + /// + /// Ändert das Pixel-Label auf den aktuellen Wert + /// + /// + /// + private void TrackBarRander_Scroll(object sender, EventArgs e) + { + labelRander.Text = trackBarRander.Value + " px."; + } } } \ No newline at end of file diff --git a/Mk0.Software.ImageSorter/Mk0.Software.ImageSorter.csproj b/Mk0.Software.ImageSorter/Mk0.Software.ImageSorter.csproj index 17bf7e8..504f9a7 100644 --- a/Mk0.Software.ImageSorter/Mk0.Software.ImageSorter.csproj +++ b/Mk0.Software.ImageSorter/Mk0.Software.ImageSorter.csproj @@ -33,7 +33,7 @@ manuelkamper.com false 0 - 1.40.0.0 + 1.41.0.0 true true true diff --git a/Mk0.Software.ImageSorter/Properties/AssemblyInfo.cs b/Mk0.Software.ImageSorter/Properties/AssemblyInfo.cs index 2068f44..1aa05c2 100644 --- a/Mk0.Software.ImageSorter/Properties/AssemblyInfo.cs +++ b/Mk0.Software.ImageSorter/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.40.*")] +[assembly: AssemblyVersion("1.41.*")] //[assembly: AssemblyFileVersion("1.6.0.0")]