fixed #19 and maybe #20

This commit is contained in:
Manuel Kamper 2024-08-18 15:34:44 +02:00
parent 0bbe5f2aa0
commit 339d9e328c

View File

@ -48,16 +48,18 @@ namespace Mk0.Software.ImageSorter
public string[] Args;
private FormWindowState lastState = FormWindowState.Minimized;
private string defaultWindowName;
private bool blockZoom = false;
public Main()
{
blockZoom = true;
InitializeComponent();
defaultWindowName = Text;
banner = new Banner(components, panelBanner, pictureBoxBanner1, pictureBoxBanner2, labelBanner1, labelBanner2);
pictureBoxImage.Cursor = grabCursor;
DoubleBuffered = true;
blockZoom = false;
SetDefaultPath();
comboBoxZoom.SelectedIndex = Properties.Settings.Default.zoom;
//file assoc prüfen und in einstellungen richtig setzen
if(FileAssociation.Check("Image_Sorter_JPG", Application.ExecutablePath, "JPG Bild", $@"{Application.StartupPath}\AssocIcons\jpg.ico") &&
@ -159,6 +161,7 @@ namespace Mk0.Software.ImageSorter
/// <param name="e"></param>
private void Main_Shown(object sender, EventArgs e)
{
comboBoxZoom.SelectedIndex = Properties.Settings.Default.zoom;
if (Properties.Settings.Default.fullScreen)
{
WindowState = FormWindowState.Maximized;
@ -1095,6 +1098,8 @@ namespace Mk0.Software.ImageSorter
/// <param name="sender"></param>
/// <param name="e"></param>
private void Zoom()
{
if (!blockZoom)
{
string zoom = comboBoxZoom.SelectedItem.ToString();
@ -1137,10 +1142,18 @@ namespace Mk0.Software.ImageSorter
return;
}
if (pictureBoxImage.Image != null)
{
xFaktor = pictureBoxImage.Width / (double)pictureBoxImage.Image.Width;
yFaktor = pictureBoxImage.Height / (double)pictureBoxImage.Image.Height;
labelZoom2.Text = "x" + Math.Round(yFaktor, 1);
}
else
{
labelZoom2.Text = "x?";
}
}
}
/// <summary>
/// Mausklicks in picturebox verwalten