parent
0bbe5f2aa0
commit
339d9e328c
@ -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();
|
||||
|
||||
@ -1117,7 +1122,7 @@ namespace Mk0.Software.ImageSorter
|
||||
else if (zoom == "Auto")
|
||||
{
|
||||
pictureBoxImage.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
if(pictureBoxImage.Image.Width>panelImageBackground.Width || pictureBoxImage.Image.Height>panelImageBackground.Height)
|
||||
if (pictureBoxImage.Image.Width > panelImageBackground.Width || pictureBoxImage.Image.Height > panelImageBackground.Height)
|
||||
{
|
||||
pictureBoxImage.Size = new Size(panelImageBackground.Width, panelImageBackground.Height);
|
||||
pictureBoxImage.Top = 0;
|
||||
@ -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
|
||||
@ -1780,7 +1793,7 @@ namespace Mk0.Software.ImageSorter
|
||||
Properties.Settings.Default.zoom = comboBoxZoom.SelectedIndex;
|
||||
Properties.Settings.Default.Save();
|
||||
|
||||
if(pictureBoxImage.Image != null)
|
||||
if (pictureBoxImage.Image != null)
|
||||
{
|
||||
Zoom();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user