UI fixes for #3
This commit is contained in:
parent
03ea31e187
commit
0f9320b554
|
@ -849,10 +849,10 @@
|
|||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.ClientSize = new System.Drawing.Size(967, 566);
|
||||
this.Controls.Add(this.groupBoxTransformation);
|
||||
this.Controls.Add(this.groupBoxRander);
|
||||
this.Controls.Add(this.buttonChristmas);
|
||||
this.Controls.Add(this.buttonHeart);
|
||||
this.Controls.Add(this.groupBoxRander);
|
||||
this.Controls.Add(this.groupBoxTransformation);
|
||||
this.Controls.Add(this.panelPreview);
|
||||
this.Controls.Add(this.buttonPreview);
|
||||
this.Controls.Add(this.buttonHintergrund);
|
||||
|
|
|
@ -2000,54 +2000,60 @@ namespace Mk0.Software.ImageSorter
|
|||
/// </summary>
|
||||
private void ShowPreviewImages()
|
||||
{
|
||||
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
|
||||
int previewBildmitAbstand = previewImageWidth + previewImageAbstand; //breite eines preview-bildes plus abstand
|
||||
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++)
|
||||
try
|
||||
{
|
||||
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);
|
||||
}
|
||||
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
|
||||
int previewBildmitAbstand = previewImageWidth + previewImageAbstand; //breite eines preview-bildes plus abstand
|
||||
int previewNumber = panelWidthAvailable / previewBildmitAbstand; //anzahl der möglichen preview-bilder
|
||||
int bildAbstand = (panelPreview.Width - 22 - (previewNumber * previewImageWidth)) / previewNumber; //errechneter Bildabstand für bessere verteilung
|
||||
|
||||
int pIndex = imageIndex;
|
||||
foreach (PictureBox pb in panelPreview.Controls.OfType<PictureBox>())
|
||||
{
|
||||
//preview laden
|
||||
if (images.Count() > pIndex)
|
||||
for (int i = 1; i <= previewNumber; i++)
|
||||
{
|
||||
pIndex += 1;
|
||||
if (pIndex >= images.Count() || pIndex < 0)
|
||||
int moveNext = (i * previewImageWidth) + (bildAbstand * i) - 80;
|
||||
PictureBox pb = new PictureBox
|
||||
{
|
||||
pIndex = 0;
|
||||
}
|
||||
pb.ImageLocation = images.ElementAt(pIndex);
|
||||
pb.BackgroundImage = null;
|
||||
pb.Tag = pIndex;
|
||||
pb.Click += new System.EventHandler(this.LoadPictureFromPreview_Click);
|
||||
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);
|
||||
}
|
||||
else
|
||||
|
||||
int pIndex = imageIndex;
|
||||
foreach (PictureBox pb in panelPreview.Controls.OfType<PictureBox>())
|
||||
{
|
||||
pb.BackgroundImage = Resources.no_picture;
|
||||
//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 System.EventHandler(this.LoadPictureFromPreview_Click);
|
||||
}
|
||||
else
|
||||
{
|
||||
pb.BackgroundImage = Resources.no_picture;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue