implemented #6

This commit is contained in:
Manuel Kamper 2023-08-11 10:30:48 +02:00
parent 18c4eaaf16
commit 861174edcd
4 changed files with 114 additions and 40 deletions

View File

@ -491,7 +491,7 @@
this.groupBoxRander.Controls.Add(this.buttonRandOben);
this.groupBoxRander.Location = new System.Drawing.Point(161, 397);
this.groupBoxRander.Name = "groupBoxRander";
this.groupBoxRander.Size = new System.Drawing.Size(125, 136);
this.groupBoxRander.Size = new System.Drawing.Size(123, 136);
this.groupBoxRander.TabIndex = 18;
this.groupBoxRander.TabStop = false;
this.groupBoxRander.Text = "Ränder schneiden";
@ -504,7 +504,7 @@
this.buttonRandAlle.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.buttonRandAlle.FlatAppearance.BorderColor = System.Drawing.Color.Silver;
this.buttonRandAlle.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonRandAlle.Location = new System.Drawing.Point(64, 102);
this.buttonRandAlle.Location = new System.Drawing.Point(76, 102);
this.buttonRandAlle.Name = "buttonRandAlle";
this.buttonRandAlle.Size = new System.Drawing.Size(23, 23);
this.buttonRandAlle.TabIndex = 16;
@ -519,7 +519,7 @@
this.buttonRandObenUnten.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.buttonRandObenUnten.FlatAppearance.BorderColor = System.Drawing.Color.Silver;
this.buttonRandObenUnten.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonRandObenUnten.Location = new System.Drawing.Point(35, 102);
this.buttonRandObenUnten.Location = new System.Drawing.Point(47, 102);
this.buttonRandObenUnten.Name = "buttonRandObenUnten";
this.buttonRandObenUnten.Size = new System.Drawing.Size(23, 23);
this.buttonRandObenUnten.TabIndex = 15;
@ -534,7 +534,7 @@
this.buttonRandLinksRechts.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.buttonRandLinksRechts.FlatAppearance.BorderColor = System.Drawing.Color.Silver;
this.buttonRandLinksRechts.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonRandLinksRechts.Location = new System.Drawing.Point(6, 102);
this.buttonRandLinksRechts.Location = new System.Drawing.Point(18, 102);
this.buttonRandLinksRechts.Name = "buttonRandLinksRechts";
this.buttonRandLinksRechts.Size = new System.Drawing.Size(23, 23);
this.buttonRandLinksRechts.TabIndex = 14;
@ -738,7 +738,7 @@
this.groupBoxTransformation.Controls.Add(this.buttonMirrorHorizontal);
this.groupBoxTransformation.Location = new System.Drawing.Point(46, 445);
this.groupBoxTransformation.Name = "groupBoxTransformation";
this.groupBoxTransformation.Size = new System.Drawing.Size(109, 88);
this.groupBoxTransformation.Size = new System.Drawing.Size(99, 88);
this.groupBoxTransformation.TabIndex = 17;
this.groupBoxTransformation.TabStop = false;
this.groupBoxTransformation.Text = "Transformation";
@ -871,7 +871,7 @@
this.KeyPreview = true;
this.MinimumSize = new System.Drawing.Size(983, 605);
this.Name = "Main";
this.Text = "Image Sorter v2.5 | © 2015-2023 by kmpr.at";
this.Text = "Image Sorter v2.6 | © 2015-2023 by kmpr.at";
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);

View File

@ -17,6 +17,7 @@ using System.Threading;
using System.Windows.Forms;
using Mk0.Software.OnlineUpdater;
using System.Threading.Tasks;
using System.Reflection;
namespace Mk0.Software.ImageSorter
{
@ -865,7 +866,7 @@ namespace Mk0.Software.ImageSorter
CountPicsInPath();
LoadPicture(imageIndex);
CheckUndo();
ShowPreviewImages();
ShowPreviewImages(false, true);
if (Properties.Settings.Default.fading)
{
@ -970,7 +971,7 @@ namespace Mk0.Software.ImageSorter
CountPicsInPath();
LoadPicture(imageIndex);
CheckUndo();
ShowPreviewImages();
ShowPreviewImages(true);
}
/// <summary>
@ -1072,7 +1073,7 @@ namespace Mk0.Software.ImageSorter
CountPicsInPath();
LoadPicture(imageIndex);
ShowDeletedMessage(myImg, pfad);
ShowPreviewImages();
ShowPreviewImages(false, true);
}
/// <summary>
@ -1769,7 +1770,7 @@ namespace Mk0.Software.ImageSorter
CountPicsInPath();
LoadPicture(imageIndex - 1);
CheckUndo();
ShowPreviewImages();
ShowPreviewImages(true);
}
/// <summary>
@ -1782,7 +1783,7 @@ namespace Mk0.Software.ImageSorter
CountPicsInPath();
LoadPicture(imageIndex + 1);
CheckUndo();
ShowPreviewImages();
ShowPreviewImages(false, true);
}
/// <summary>
@ -1827,7 +1828,7 @@ namespace Mk0.Software.ImageSorter
Image myImg = CopyImage.GetCopyImage(targetPath);
ShowDuplicatedMessage(myImg, targetPath);
ShowPreviewImages();
ShowPreviewImages(true);
}
/// <summary>
@ -2008,11 +2009,10 @@ namespace Mk0.Software.ImageSorter
/// <summary>
/// Bildvorschau erzeugen und laden
/// </summary>
private void ShowPreviewImages()
private void ShowPreviewImages(bool left = false, bool right = false)
{
try
{
panelPreview.Controls.Clear();
int panelWidthAvailable = panelPreview.Width - 11; //verfügbare breite abzüglich ränder links+rechts
int previewImageWidth = 80; //breite eines preview-bildes
int previewImageAbstand = 11; //abstand zwischen preview-bildern
@ -2020,44 +2020,118 @@ namespace Mk0.Software.ImageSorter
int previewNumber = panelWidthAvailable / previewBildmitAbstand; //anzahl der möglichen preview-bilder
int bildAbstand = (panelPreview.Width - 22 - (previewNumber * previewImageWidth)) / previewNumber; //errechneter Bildabstand für bessere verteilung
for (int i = 1; i <= previewNumber; i++)
if (left)
{
int moveNext = (i * previewImageWidth) + (bildAbstand * i) - 80;
PictureBox pb = new PictureBox
//links neues bild laden
//rechte pb entfernen
panelPreview.Controls.Remove(panelPreview.Controls.OfType<PictureBox>().Last());
int newPbX = panelPreview.Controls.OfType<PictureBox>().First().Location.X;
//alle nach rechts verschieben
foreach (PictureBox pb in panelPreview.Controls.OfType<PictureBox>())
{
pb.Location = new Point(pb.Location.X + bildAbstand + previewImageWidth, pb.Location.Y);
}
//links neue pb erstellen
int pIndex = imageIndex;
pIndex += 1;
if (pIndex >= images.Count() || pIndex < 0)
{
pIndex = 0;
}
PictureBox pbn = new PictureBox
{
Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left,
BackgroundImage = Resources.no_picture,
BackgroundImageLayout = ImageLayout.Stretch,
BorderStyle = BorderStyle.None,
Location = new Point(moveNext, previewImageAbstand),
Name = "pictureBoxPreview" + i,
Location = new Point(newPbX, previewImageAbstand),
Size = new Size(previewImageWidth, previewImageWidth),
TabIndex = 0,
TabStop = false,
SizeMode = PictureBoxSizeMode.Zoom
SizeMode = PictureBoxSizeMode.Zoom,
ImageLocation = images.ElementAt(pIndex),
Tag = pIndex
};
panelPreview.Controls.Add(pb);
panelPreview.SuspendLayout();
panelPreview.Controls.Add(pbn);
panelPreview.Controls.SetChildIndex(pbn, 0);
panelPreview.ResumeLayout();
pbn.Click += new EventHandler(LoadPictureFromPreview_Click);
}
int pIndex = imageIndex;
foreach (PictureBox pb in panelPreview.Controls.OfType<PictureBox>())
else if (right)
{
//preview laden
if (images.Count() > pIndex)
//rechts neues bild laden
//linke pb entfernen
panelPreview.Controls.Remove(panelPreview.Controls.OfType<PictureBox>().First());
int newPbX = panelPreview.Controls.OfType<PictureBox>().Last().Location.X;
//alle nach links verschieben
foreach (PictureBox pb in panelPreview.Controls.OfType<PictureBox>())
{
pIndex += 1;
if (pIndex >= images.Count() || pIndex < 0)
{
pIndex = 0;
}
pb.ImageLocation = images.ElementAt(pIndex);
pb.BackgroundImage = null;
pb.Tag = pIndex;
pb.Click += new System.EventHandler(this.LoadPictureFromPreview_Click);
pb.Location = new Point(pb.Location.X - bildAbstand - previewImageWidth, pb.Location.Y);
}
else
//rechts neue pb erstellen
int pIndex = imageIndex;
pIndex += previewNumber;
if (pIndex >= images.Count() || pIndex < 0)
{
pb.BackgroundImage = Resources.no_picture;
pIndex = 0;
}
PictureBox pbn = new PictureBox
{
Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left,
BackgroundImageLayout = ImageLayout.Stretch,
BorderStyle = BorderStyle.None,
Location = new Point(newPbX, previewImageAbstand),
Size = new Size(previewImageWidth, previewImageWidth),
TabIndex = 0,
TabStop = false,
SizeMode = PictureBoxSizeMode.Zoom,
ImageLocation = images.ElementAt(pIndex),
Tag = pIndex
};
panelPreview.Controls.Add(pbn);
pbn.Click += new EventHandler(LoadPictureFromPreview_Click);
}
else
{
panelPreview.Controls.Clear();
for (int i = 1; i <= previewNumber; i++)
{
int moveNext = (i * previewImageWidth) + (bildAbstand * i) - 80;
PictureBox pb = new PictureBox
{
Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left,
BackgroundImage = Resources.no_picture,
BackgroundImageLayout = ImageLayout.Stretch,
BorderStyle = BorderStyle.None,
Location = new Point(moveNext, previewImageAbstand),
Name = "pictureBoxPreview" + i,
Size = new Size(previewImageWidth, previewImageWidth),
TabIndex = 0,
TabStop = false,
SizeMode = PictureBoxSizeMode.Zoom
};
panelPreview.Controls.Add(pb);
}
int pIndex = imageIndex;
foreach (PictureBox pb in panelPreview.Controls.OfType<PictureBox>())
{
//preview laden
if (images.Count() > pIndex)
{
pIndex += 1;
if (pIndex >= images.Count() || pIndex < 0)
{
pIndex = 0;
}
pb.ImageLocation = images.ElementAt(pIndex);
pb.BackgroundImage = null;
pb.Tag = pIndex;
pb.Click += new EventHandler(LoadPictureFromPreview_Click);
}
else
{
pb.BackgroundImage = Resources.no_picture;
}
}
}
}

View File

@ -33,7 +33,7 @@
<PublisherName>manuelkamper.com</PublisherName>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>2.5.0.0</ApplicationVersion>
<ApplicationVersion>2.6.0.0</ApplicationVersion>
<UseApplicationTrust>true</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<ExcludeDeploymentUrl>true</ExcludeDeploymentUrl>

View File

@ -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("2.5.*")]
[assembly: AssemblyVersion("2.6.*")]
//[assembly: AssemblyFileVersion("1.6.0.0")]