using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Windows.Forms;
using CatalogVbLib;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;

namespace ImageCatalog
{
    public delegate void XyThreadAddold(string Info);

    public class Form1 : Form
    {

        /* TODO ERROR: Skipped RegionDirectiveTrivia */
        public Form1() : base()
        {
            base.Load += Form1_Load;

            // This call is required by the Windows Form Designer.
            InitializeComponent();

            // Add any initialization after the InitializeComponent() call

        }

        // Form overrides dispose to clean up the component list.
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components is object)
                {
                    components.Dispose();
                }
            }

            base.Dispose(disposing);
        }

        // Required by the Windows Form Designer
        private System.ComponentModel.IContainer components;

        // NOTE: The following procedure is required by the Windows Form Designer
        // It can be modified using the Windows Form Designer.  
        // Do not modify it using the code editor.
        private Button _Button1;

        internal Button Button1
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            get
            {
                return _Button1;
            }

            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                if (_Button1 != null)
                {
                    _Button1.Click -= btnCreaCatalogo_Click;
                }

                _Button1 = value;
                if (_Button1 != null)
                {
                    _Button1.Click += btnCreaCatalogo_Click;
                }
            }
        }

        internal Label Label10;
        internal Label Label17;
        internal Label Label18;
        internal Label Label19;
        internal Label Label20;
        private Button _Button6;

        internal Button Button6
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            get
            {
                return _Button6;
            }

            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                if (_Button6 != null)
                {
                    _Button6.Click -= Button6_Click;
                }

                _Button6 = value;
                if (_Button6 != null)
                {
                    _Button6.Click += Button6_Click;
                }
            }
        }

        private Button _Button5;

        internal Button Button5
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            get
            {
                return _Button5;
            }

            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                if (_Button5 != null)
                {
                    _Button5.Click -= Button5_Click;
                }

                _Button5 = value;
                if (_Button5 != null)
                {
                    _Button5.Click += Button5_Click;
                }
            }
        }

        private Button _Button7;

        internal Button Button7
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            get
            {
                return _Button7;
            }

            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                if (_Button7 != null)
                {
                    _Button7.Click -= Button7_Click;
                }

                _Button7 = value;
                if (_Button7 != null)
                {
                    _Button7.Click += Button7_Click;
                }
            }
        }

        internal Label Label27;
        internal TextBox TextBox13;
        internal Label Label16;
        internal Label Label7;
        internal TextBox TextBox7;
        internal Label Label8;
        internal TextBox TextBox8;
        internal CheckBox CheckBox2;
        internal Label Label43;
        internal CheckBox CheckBox22;
        internal TabPage TabPage4;
        internal GroupBox GroupBox6;
        internal PictureBox PictureBox2;
        private PictureBox _PictureBox1;

        internal PictureBox PictureBox1
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            get
            {
                return _PictureBox1;
            }

            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                if (_PictureBox1 != null)
                {
                    _PictureBox1.MouseMove -= PictureBox1_MouseMove;
                    _PictureBox1.MouseUp -= PictureBox1_MouseUp;
                }

                _PictureBox1 = value;
                if (_PictureBox1 != null)
                {
                    _PictureBox1.MouseMove += PictureBox1_MouseMove;
                    _PictureBox1.MouseUp += PictureBox1_MouseUp;
                }
            }
        }

        internal ComboBox ComboBox5;
        internal ComboBox ComboBox4;
        internal TextBox TextBox19;
        internal Label Label28;
        internal CheckBox CheckBox5;
        internal TextBox TextBox15;
        internal TextBox TextBox14;
        internal Label Label25;
        internal TextBox TextBox16;
        internal Label Label24;
        internal Label Label22;
        internal Label Label23;
        private Button _Button4;

        internal Button Button4
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            get
            {
                return _Button4;
            }

            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                if (_Button4 != null)
                {
                    _Button4.Click -= Button4_Click;
                }

                _Button4 = value;
                if (_Button4 != null)
                {
                    _Button4.Click += Button4_Click;
                }
            }
        }

        internal TextBox TextBox10;
        internal Label Label29;
        internal Label Label30;
        internal PictureBox PictureBox3;
        internal TabPage TabPage1;
        internal GroupBox GroupBox1;
        internal Panel Panel2;
        internal RadioButton RadioButton3;
        internal RadioButton RadioButton7;
        internal RadioButton RadioButton4;
        internal RadioButton RadioButton6;
        internal RadioButton RadioButton5;
        internal Label Label5;
        internal TextBox TextBox5;
        internal Label Label6;
        internal TextBox TextBox6;
        internal Label Label3;
        internal TextBox TextBox3;
        internal CheckBox CheckBox1;
        internal TabPage TabPage2;
        internal GroupBox GroupBox2;
        internal TextBox TextBox26;
        internal Label Label37;
        internal Label Label38;
        internal TextBox TextBox27;
        internal Label Label39;
        internal TextBox TextBox28;
        internal CheckBox CheckBox15;
        internal TabPage TabPage3;
        internal GroupBox GroupBox10;
        internal Label Label42;
        internal Label Label41;
        internal TextBox TextBox31;
        internal TextBox TextBox30;
        internal GroupBox GroupBox9;
        internal CheckBox CheckBox17;
        internal CheckBox CheckBox16;
        internal GroupBox GroupBox5;
        private Button _Button8;

        internal Button Button8
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            get
            {
                return _Button8;
            }

            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                if (_Button8 != null)
                {
                    _Button8.Click -= Button8_Click;
                }

                _Button8 = value;
                if (_Button8 != null)
                {
                    _Button8.Click += Button8_Click;
                }
            }
        }

        internal Label Label36;
        internal TextBox TextBox25;
        internal Label Label35;
        internal ComboBox ComboBox3;
        internal TextBox TextBox11;
        internal Label Label12;
        internal Label Label11;
        internal CheckBox CheckBox3;
        internal GroupBox GroupBox4;
        internal Label Label40;
        internal TextBox TextBox29;
        internal TextBox TextBox18;
        internal Label Label26;
        internal DateTimePicker DateTimePicker1;
        internal CheckBox CheckBox8;
        internal TextBox TextBox9;
        internal CheckBox CheckBox7;
        internal Label Label4;
        internal TextBox TextBox4;
        internal Label Label9;
        internal Label Label13;
        internal ComboBox ComboBox1;
        internal ComboBox ComboBox2;
        internal Label Label14;
        internal TextBox TextBox12;
        internal Label Label15;
        internal TabPage TabPage5;
        internal GroupBox GroupBox3;
        internal CheckBox CheckBox6;
        private Button _Button3;

        internal Button Button3
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            get
            {
                return _Button3;
            }

            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                if (_Button3 != null)
                {
                    _Button3.Click -= Button3_Click;
                }

                _Button3 = value;
                if (_Button3 != null)
                {
                    _Button3.Click += Button3_Click;
                }
            }
        }

        private Button _Button2;

        internal Button Button2
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            get
            {
                return _Button2;
            }

            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                if (_Button2 != null)
                {
                    _Button2.Click -= Button2_Click;
                }

                _Button2 = value;
                if (_Button2 != null)
                {
                    _Button2.Click += Button2_Click;
                }
            }
        }

        internal Label Label1;
        internal Label Label2;
        internal TextBox TextBox1;
        internal TextBox TextBox2;
        internal GroupBox GroupBox8;
        internal RadioButton RadioButton2;
        internal RadioButton RadioButton1;
        internal TextBox TextBox21;
        internal Label Label34;
        internal TextBox TextBox20;
        internal Label Label33;
        internal Label Label31;
        internal CheckBox CheckBox11;
        internal TextBox TextBox17;
        internal Label Label32;
        internal GroupBox GroupBox7;
        internal CheckBox CheckBox10;
        internal CheckBox CheckBox9;
        internal TabControl TabControl1;
        internal Label Label45;
        internal TextBox TextBox32;
        internal TextBox TextBox33;
        internal TextBox TextBox34;
        internal Label Label46;
        internal ProgressBar ProgressBar1;
        internal Panel Panel1;
        private CheckBox _CheckBox18;

        internal CheckBox CheckBox18
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            get
            {
                return _CheckBox18;
            }

            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                if (_CheckBox18 != null)
                {
                    _CheckBox18.CheckedChanged -= CheckBox18_CheckedChanged;
                }

                _CheckBox18 = value;
                if (_CheckBox18 != null)
                {
                    _CheckBox18.CheckedChanged += CheckBox18_CheckedChanged;
                }
            }
        }

        private CheckBox _CheckBox4;

        internal CheckBox CheckBox4
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            get
            {
                return _CheckBox4;
            }

            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                if (_CheckBox4 != null)
                {
                    _CheckBox4.CheckedChanged -= CheckBox4_CheckedChanged;
                }

                _CheckBox4 = value;
                if (_CheckBox4 != null)
                {
                    _CheckBox4.CheckedChanged += CheckBox4_CheckedChanged;
                }
            }
        }

        private CheckBox _CheckBox12;

        internal CheckBox CheckBox12
        {
            [MethodImpl(MethodImplOptions.Synchronized)]
            get
            {
                return _CheckBox12;
            }

            [MethodImpl(MethodImplOptions.Synchronized)]
            set
            {
                if (_CheckBox12 != null)
                {
                    _CheckBox12.CheckedChanged -= CheckBox12_CheckedChanged;
                }

                _CheckBox12 = value;
                if (_CheckBox12 != null)
                {
                    _CheckBox12.CheckedChanged += CheckBox12_CheckedChanged;
                }
            }
        }

        internal Label Label44;

        [DebuggerStepThrough()]
        private void InitializeComponent()
        {
            _Button1 = new Button();
            _Button1.Click += new EventHandler(btnCreaCatalogo_Click);
            Label10 = new Label();
            Label17 = new Label();
            Label18 = new Label();
            Label19 = new Label();
            Label20 = new Label();
            _Button6 = new Button();
            _Button6.Click += new EventHandler(Button6_Click);
            _Button5 = new Button();
            _Button5.Click += new EventHandler(Button5_Click);
            _Button7 = new Button();
            _Button7.Click += new EventHandler(Button7_Click);
            Label27 = new Label();
            TextBox13 = new TextBox();
            Label16 = new Label();
            Label7 = new Label();
            TextBox7 = new TextBox();
            Label8 = new Label();
            TextBox8 = new TextBox();
            CheckBox2 = new CheckBox();
            Label43 = new Label();
            CheckBox22 = new CheckBox();
            Label44 = new Label();
            TabPage4 = new TabPage();
            GroupBox6 = new GroupBox();
            PictureBox2 = new PictureBox();
            _PictureBox1 = new PictureBox();
            _PictureBox1.MouseMove += new MouseEventHandler(PictureBox1_MouseMove);
            _PictureBox1.MouseUp += new MouseEventHandler(PictureBox1_MouseUp);
            ComboBox5 = new ComboBox();
            ComboBox4 = new ComboBox();
            TextBox19 = new TextBox();
            Label28 = new Label();
            CheckBox5 = new CheckBox();
            TextBox15 = new TextBox();
            TextBox14 = new TextBox();
            Label25 = new Label();
            TextBox16 = new TextBox();
            Label24 = new Label();
            Label22 = new Label();
            Label23 = new Label();
            _Button4 = new Button();
            _Button4.Click += new EventHandler(Button4_Click);
            TextBox10 = new TextBox();
            Label29 = new Label();
            Label30 = new Label();
            PictureBox3 = new PictureBox();
            TabPage1 = new TabPage();
            GroupBox1 = new GroupBox();
            Label46 = new Label();
            TextBox33 = new TextBox();
            Panel2 = new Panel();
            RadioButton3 = new RadioButton();
            RadioButton7 = new RadioButton();
            RadioButton4 = new RadioButton();
            RadioButton6 = new RadioButton();
            RadioButton5 = new RadioButton();
            Label5 = new Label();
            TextBox5 = new TextBox();
            Label6 = new Label();
            TextBox6 = new TextBox();
            Label3 = new Label();
            TextBox3 = new TextBox();
            CheckBox1 = new CheckBox();
            TabPage2 = new TabPage();
            GroupBox2 = new GroupBox();
            Label45 = new Label();
            TextBox32 = new TextBox();
            TextBox26 = new TextBox();
            Label37 = new Label();
            Label38 = new Label();
            TextBox27 = new TextBox();
            Label39 = new Label();
            TextBox28 = new TextBox();
            CheckBox15 = new CheckBox();
            TabPage3 = new TabPage();
            GroupBox10 = new GroupBox();
            Label42 = new Label();
            Label41 = new Label();
            TextBox31 = new TextBox();
            TextBox30 = new TextBox();
            GroupBox9 = new GroupBox();
            CheckBox17 = new CheckBox();
            CheckBox16 = new CheckBox();
            GroupBox5 = new GroupBox();
            TextBox34 = new TextBox();
            _Button8 = new Button();
            _Button8.Click += new EventHandler(Button8_Click);
            Label36 = new Label();
            TextBox25 = new TextBox();
            Label35 = new Label();
            ComboBox3 = new ComboBox();
            TextBox11 = new TextBox();
            Label12 = new Label();
            Label11 = new Label();
            CheckBox3 = new CheckBox();
            GroupBox4 = new GroupBox();
            Label40 = new Label();
            TextBox29 = new TextBox();
            TextBox18 = new TextBox();
            Label26 = new Label();
            DateTimePicker1 = new DateTimePicker();
            CheckBox8 = new CheckBox();
            TextBox9 = new TextBox();
            CheckBox7 = new CheckBox();
            Label4 = new Label();
            TextBox4 = new TextBox();
            Label9 = new Label();
            Label13 = new Label();
            ComboBox1 = new ComboBox();
            ComboBox2 = new ComboBox();
            Label14 = new Label();
            TextBox12 = new TextBox();
            Label15 = new Label();
            TabPage5 = new TabPage();
            GroupBox3 = new GroupBox();
            CheckBox6 = new CheckBox();
            _Button3 = new Button();
            _Button3.Click += new EventHandler(Button3_Click);
            _Button2 = new Button();
            _Button2.Click += new EventHandler(Button2_Click);
            Label1 = new Label();
            Label2 = new Label();
            TextBox1 = new TextBox();
            TextBox2 = new TextBox();
            GroupBox8 = new GroupBox();
            RadioButton2 = new RadioButton();
            RadioButton1 = new RadioButton();
            TextBox21 = new TextBox();
            Label34 = new Label();
            TextBox20 = new TextBox();
            Label33 = new Label();
            Label31 = new Label();
            CheckBox11 = new CheckBox();
            TextBox17 = new TextBox();
            Label32 = new Label();
            GroupBox7 = new GroupBox();
            CheckBox10 = new CheckBox();
            CheckBox9 = new CheckBox();
            TabControl1 = new TabControl();
            ProgressBar1 = new ProgressBar();
            _CheckBox12 = new CheckBox();
            _CheckBox12.CheckedChanged += new EventHandler(CheckBox12_CheckedChanged);
            _CheckBox4 = new CheckBox();
            _CheckBox4.CheckedChanged += new EventHandler(CheckBox4_CheckedChanged);
            _CheckBox18 = new CheckBox();
            _CheckBox18.CheckedChanged += new EventHandler(CheckBox18_CheckedChanged);
            Panel1 = new Panel();
            TabPage4.SuspendLayout();
            GroupBox6.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)PictureBox2).BeginInit();
            ((System.ComponentModel.ISupportInitialize)_PictureBox1).BeginInit();
            ((System.ComponentModel.ISupportInitialize)PictureBox3).BeginInit();
            TabPage1.SuspendLayout();
            GroupBox1.SuspendLayout();
            Panel2.SuspendLayout();
            TabPage2.SuspendLayout();
            GroupBox2.SuspendLayout();
            TabPage3.SuspendLayout();
            GroupBox10.SuspendLayout();
            GroupBox9.SuspendLayout();
            GroupBox5.SuspendLayout();
            GroupBox4.SuspendLayout();
            TabPage5.SuspendLayout();
            GroupBox3.SuspendLayout();
            GroupBox8.SuspendLayout();
            GroupBox7.SuspendLayout();
            TabControl1.SuspendLayout();
            Panel1.SuspendLayout();
            SuspendLayout();
            // 
            // Button1
            // 
            _Button1.Font = new Font("Microsoft Sans Serif", 12.0f, FontStyle.Bold, GraphicsUnit.Point, Conversions.ToByte(0));
            _Button1.Location = new Point(539, 77);
            _Button1.Name = "_Button1";
            _Button1.Size = new Size(192, 39);
            _Button1.TabIndex = 2;
            _Button1.Text = "crea catalogo";
            // 
            // Label10
            // 
            Label10.Font = new Font("Microsoft Sans Serif", 14.25f, FontStyle.Bold, GraphicsUnit.Point, Conversions.ToByte(0));
            Label10.Location = new Point(539, 163);
            Label10.Name = "Label10";
            Label10.Size = new Size(192, 72);
            Label10.TabIndex = 21;
            Label10.Text = "file";
            // 
            // Label17
            // 
            Label17.AutoSize = true;
            Label17.Font = new Font("Microsoft Sans Serif", 12.0f, FontStyle.Bold, GraphicsUnit.Point, Conversions.ToByte(0));
            Label17.Location = new Point(643, 243);
            Label17.Name = "Label17";
            Label17.Size = new Size(19, 20);
            Label17.TabIndex = 38;
            Label17.Text = "0";
            // 
            // Label18
            // 
            Label18.AutoSize = true;
            Label18.Font = new Font("Microsoft Sans Serif", 12.0f, FontStyle.Bold, GraphicsUnit.Point, Conversions.ToByte(0));
            Label18.Location = new Point(643, 262);
            Label18.Name = "Label18";
            Label18.Size = new Size(19, 20);
            Label18.TabIndex = 39;
            Label18.Text = "0";
            // 
            // Label19
            // 
            Label19.AutoSize = true;
            Label19.Font = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Bold, GraphicsUnit.Point, Conversions.ToByte(0));
            Label19.Location = new Point(539, 243);
            Label19.Name = "Label19";
            Label19.Size = new Size(80, 16);
            Label19.TabIndex = 40;
            Label19.Text = "foto totali: ";
            // 
            // Label20
            // 
            Label20.AutoSize = true;
            Label20.Font = new Font("Microsoft Sans Serif", 9.75f, FontStyle.Bold, GraphicsUnit.Point, Conversions.ToByte(0));
            Label20.Location = new Point(539, 262);
            Label20.Name = "Label20";
            Label20.Size = new Size(104, 16);
            Label20.TabIndex = 41;
            Label20.Text = "foto generate:";
            // 
            // Button6
            // 
            _Button6.Font = new Font("Microsoft Sans Serif", 11.0f, FontStyle.Bold, GraphicsUnit.Point, Conversions.ToByte(0));
            _Button6.Location = new Point(539, 12);
            _Button6.Name = "_Button6";
            _Button6.Size = new Size(192, 32);
            _Button6.TabIndex = 12;
            _Button6.Text = "Carica impostazioni";
            // 
            // Button5
            // 
            _Button5.Font = new Font("Microsoft Sans Serif", 11.0f, FontStyle.Bold, GraphicsUnit.Point, Conversions.ToByte(0));
            _Button5.Location = new Point(539, 43);
            _Button5.Name = "_Button5";
            _Button5.Size = new Size(192, 32);
            _Button5.TabIndex = 43;
            _Button5.Text = "Salva impostazioni";
            // 
            // Button7
            // 
            _Button7.Font = new Font("Microsoft Sans Serif", 14.25f, FontStyle.Regular, GraphicsUnit.Point, Conversions.ToByte(0));
            _Button7.Location = new Point(539, 120);
            _Button7.Name = "_Button7";
            _Button7.Size = new Size(192, 40);
            _Button7.TabIndex = 44;
            _Button7.Text = "stop creazione";
            // 
            // Label27
            // 
            Label27.Location = new Point(591, 346);
            Label27.Name = "Label27";
            Label27.Size = new Size(140, 20);
            Label27.TabIndex = 46;
            Label27.Text = "Versione 2.0 BETA 1";
            Label27.TextAlign = ContentAlignment.MiddleRight;
            // 
            // TextBox13
            // 
            TextBox13.Location = new Point(224, 48);
            TextBox13.Name = "TextBox13";
            TextBox13.Size = new Size(56, 20);
            TextBox13.TabIndex = 20;
            TextBox13.Text = "TextBox13";
            // 
            // Label16
            // 
            Label16.ForeColor = Color.Black;
            Label16.Location = new Point(168, 48);
            Label16.Name = "Label16";
            Label16.Size = new Size(48, 16);
            Label16.TabIndex = 19;
            Label16.Text = "Suffisso";
            Label16.TextAlign = ContentAlignment.MiddleRight;
            // 
            // Label7
            // 
            Label7.AutoSize = true;
            Label7.ForeColor = Color.Black;
            Label7.Location = new Point(24, 24);
            Label7.Name = "Label7";
            Label7.Size = new Size(41, 13);
            Label7.TabIndex = 16;
            Label7.Text = "Altezza";
            // 
            // TextBox7
            // 
            TextBox7.Location = new Point(72, 24);
            TextBox7.Name = "TextBox7";
            TextBox7.Size = new Size(72, 20);
            TextBox7.TabIndex = 14;
            TextBox7.Text = "TextBox7";
            // 
            // Label8
            // 
            Label8.AutoSize = true;
            Label8.ForeColor = Color.Black;
            Label8.Location = new Point(8, 48);
            Label8.Name = "Label8";
            Label8.Size = new Size(56, 13);
            Label8.TabIndex = 17;
            Label8.Text = "Larghezza";
            // 
            // TextBox8
            // 
            TextBox8.Location = new Point(72, 48);
            TextBox8.Name = "TextBox8";
            TextBox8.Size = new Size(72, 20);
            TextBox8.TabIndex = 15;
            TextBox8.Text = "TextBox8";
            // 
            // CheckBox2
            // 
            CheckBox2.Checked = true;
            CheckBox2.CheckState = CheckState.Checked;
            CheckBox2.ForeColor = Color.Black;
            CheckBox2.Location = new Point(168, 16);
            CheckBox2.Name = "CheckBox2";
            CheckBox2.Size = new Size(120, 32);
            CheckBox2.TabIndex = 18;
            CheckBox2.Text = "Mantieni dimensioni originali";
            // 
            // Label43
            // 
            Label43.AutoSize = true;
            Label43.Location = new Point(651, 303);
            Label43.Name = "Label43";
            Label43.Size = new Size(25, 13);
            Label43.TabIndex = 49;
            Label43.Text = "000";
            // 
            // CheckBox22
            // 
            CheckBox22.AutoSize = true;
            CheckBox22.Location = new Point(539, 326);
            CheckBox22.Name = "CheckBox22";
            CheckBox22.Size = new Size(104, 17);
            CheckBox22.TabIndex = 50;
            CheckBox22.Text = "Arresta il sistema";
            CheckBox22.UseVisualStyleBackColor = true;
            // 
            // Label44
            // 
            Label44.AutoSize = true;
            Label44.Location = new Point(539, 303);
            Label44.Name = "Label44";
            Label44.Size = new Size(106, 13);
            Label44.TabIndex = 51;
            Label44.Text = "Tempo elaborazione:";
            // 
            // TabPage4
            // 
            TabPage4.Controls.Add(GroupBox6);
            TabPage4.Location = new Point(4, 22);
            TabPage4.Name = "TabPage4";
            TabPage4.Padding = new Padding(3);
            TabPage4.Size = new Size(513, 326);
            TabPage4.TabIndex = 3;
            TabPage4.Text = "Logo";
            TabPage4.UseVisualStyleBackColor = true;
            // 
            // GroupBox6
            // 
            GroupBox6.Controls.Add(PictureBox2);
            GroupBox6.Controls.Add(_PictureBox1);
            GroupBox6.Controls.Add(ComboBox5);
            GroupBox6.Controls.Add(ComboBox4);
            GroupBox6.Controls.Add(TextBox19);
            GroupBox6.Controls.Add(Label28);
            GroupBox6.Controls.Add(CheckBox5);
            GroupBox6.Controls.Add(TextBox15);
            GroupBox6.Controls.Add(TextBox14);
            GroupBox6.Controls.Add(Label25);
            GroupBox6.Controls.Add(TextBox16);
            GroupBox6.Controls.Add(Label24);
            GroupBox6.Controls.Add(Label22);
            GroupBox6.Controls.Add(Label23);
            GroupBox6.Controls.Add(_Button4);
            GroupBox6.Controls.Add(TextBox10);
            GroupBox6.Controls.Add(Label29);
            GroupBox6.Controls.Add(Label30);
            GroupBox6.Controls.Add(PictureBox3);
            GroupBox6.ForeColor = Color.FromArgb(Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(192)));
            GroupBox6.Location = new Point(6, 6);
            GroupBox6.Name = "GroupBox6";
            GroupBox6.Size = new Size(496, 224);
            GroupBox6.TabIndex = 42;
            GroupBox6.TabStop = false;
            GroupBox6.Text = "Logo";
            // 
            // PictureBox2
            // 
            PictureBox2.BorderStyle = BorderStyle.FixedSingle;
            PictureBox2.Location = new Point(144, 192);
            PictureBox2.Name = "PictureBox2";
            PictureBox2.Size = new Size(24, 24);
            PictureBox2.TabIndex = 44;
            PictureBox2.TabStop = false;
            PictureBox2.Visible = false;
            // 
            // PictureBox1
            // 
            _PictureBox1.Cursor = Cursors.Cross;
            _PictureBox1.Location = new Point(256, 56);
            _PictureBox1.Name = "_PictureBox1";
            _PictureBox1.Size = new Size(224, 160);
            _PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            _PictureBox1.TabIndex = 43;
            _PictureBox1.TabStop = false;
            // 
            // ComboBox5
            // 
            ComboBox5.Location = new Point(144, 168);
            ComboBox5.Name = "ComboBox5";
            ComboBox5.Size = new Size(96, 21);
            ComboBox5.TabIndex = 42;
            ComboBox5.Text = "ComboBox5";
            // 
            // ComboBox4
            // 
            ComboBox4.Location = new Point(144, 144);
            ComboBox4.Name = "ComboBox4";
            ComboBox4.Size = new Size(96, 21);
            ComboBox4.TabIndex = 41;
            ComboBox4.Text = "ComboBox4";
            // 
            // TextBox19
            // 
            TextBox19.Location = new Point(144, 96);
            TextBox19.Name = "TextBox19";
            TextBox19.Size = new Size(96, 20);
            TextBox19.TabIndex = 40;
            TextBox19.Text = "TextBox19";
            // 
            // Label28
            // 
            Label28.ForeColor = Color.Black;
            Label28.Location = new Point(17, 97);
            Label28.Name = "Label28";
            Label28.Size = new Size(120, 16);
            Label28.TabIndex = 39;
            Label28.Text = "Trasparenza (0-100%)";
            Label28.TextAlign = ContentAlignment.MiddleLeft;
            // 
            // CheckBox5
            // 
            CheckBox5.ForeColor = Color.Black;
            CheckBox5.Location = new Point(0, 26);
            CheckBox5.Name = "CheckBox5";
            CheckBox5.Size = new Size(72, 20);
            CheckBox5.TabIndex = 38;
            CheckBox5.Text = "Aggiungi";
            // 
            // TextBox15
            // 
            TextBox15.Location = new Point(144, 72);
            TextBox15.Name = "TextBox15";
            TextBox15.Size = new Size(96, 20);
            TextBox15.TabIndex = 19;
            TextBox15.Text = "TextBox15";
            // 
            // TextBox14
            // 
            TextBox14.Location = new Point(144, 48);
            TextBox14.Name = "TextBox14";
            TextBox14.Size = new Size(96, 20);
            TextBox14.TabIndex = 18;
            TextBox14.Text = "TextBox14";
            // 
            // Label25
            // 
            Label25.AutoSize = true;
            Label25.ForeColor = Color.Black;
            Label25.Location = new Point(17, 168);
            Label25.Name = "Label25";
            Label25.Size = new Size(95, 13);
            Label25.TabIndex = 36;
            Label25.Text = "Posizione verticale";
            Label25.TextAlign = ContentAlignment.MiddleLeft;
            // 
            // TextBox16
            // 
            TextBox16.Location = new Point(144, 120);
            TextBox16.Name = "TextBox16";
            TextBox16.Size = new Size(96, 20);
            TextBox16.TabIndex = 35;
            TextBox16.Text = "TextBox16";
            // 
            // Label24
            // 
            Label24.AutoSize = true;
            Label24.ForeColor = Color.Black;
            Label24.Location = new Point(19, 123);
            Label24.Name = "Label24";
            Label24.Size = new Size(88, 13);
            Label24.TabIndex = 34;
            Label24.Text = "Margine (pixel/%)";
            Label24.TextAlign = ContentAlignment.MiddleLeft;
            // 
            // Label22
            // 
            Label22.AutoSize = true;
            Label22.ForeColor = Color.Black;
            Label22.Location = new Point(19, 51);
            Label22.Name = "Label22";
            Label22.Size = new Size(41, 13);
            Label22.TabIndex = 20;
            Label22.Text = "Altezza";
            Label22.TextAlign = ContentAlignment.MiddleLeft;
            // 
            // Label23
            // 
            Label23.AutoSize = true;
            Label23.ForeColor = Color.Black;
            Label23.Location = new Point(19, 75);
            Label23.Name = "Label23";
            Label23.Size = new Size(56, 13);
            Label23.TabIndex = 21;
            Label23.Text = "Larghezza";
            Label23.TextAlign = ContentAlignment.MiddleLeft;
            // 
            // Button4
            // 
            _Button4.Location = new Point(464, 24);
            _Button4.Name = "_Button4";
            _Button4.Size = new Size(24, 20);
            _Button4.TabIndex = 8;
            _Button4.Text = "...";
            // 
            // TextBox10
            // 
            TextBox10.Location = new Point(144, 24);
            TextBox10.Name = "TextBox10";
            TextBox10.Size = new Size(312, 20);
            TextBox10.TabIndex = 6;
            TextBox10.Text = "TextBox10";
            // 
            // Label29
            // 
            Label29.AutoSize = true;
            Label29.ForeColor = Color.Black;
            Label29.Location = new Point(17, 147);
            Label29.Name = "Label29";
            Label29.Size = new Size(105, 13);
            Label29.TabIndex = 36;
            Label29.Text = "Posizione orizzontale";
            Label29.TextAlign = ContentAlignment.MiddleLeft;
            // 
            // Label30
            // 
            Label30.AutoSize = true;
            Label30.ForeColor = Color.Black;
            Label30.Location = new Point(19, 203);
            Label30.Name = "Label30";
            Label30.Size = new Size(93, 13);
            Label30.TabIndex = 36;
            Label30.Text = "Colore trasparente";
            Label30.TextAlign = ContentAlignment.MiddleLeft;
            Label30.Visible = false;
            // 
            // PictureBox3
            // 
            PictureBox3.BorderStyle = BorderStyle.FixedSingle;
            PictureBox3.Location = new Point(216, 192);
            PictureBox3.Name = "PictureBox3";
            PictureBox3.Size = new Size(24, 24);
            PictureBox3.TabIndex = 44;
            PictureBox3.TabStop = false;
            PictureBox3.Visible = false;
            // 
            // TabPage1
            // 
            TabPage1.Controls.Add(Panel1);
            TabPage1.Controls.Add(GroupBox1);
            TabPage1.Location = new Point(4, 22);
            TabPage1.Name = "TabPage1";
            TabPage1.Padding = new Padding(3);
            TabPage1.Size = new Size(513, 326);
            TabPage1.TabIndex = 0;
            TabPage1.Text = "Miniature";
            TabPage1.UseVisualStyleBackColor = true;
            // 
            // GroupBox1
            // 
            GroupBox1.Controls.Add(Label46);
            GroupBox1.Controls.Add(TextBox33);
            GroupBox1.Controls.Add(Panel2);
            GroupBox1.Controls.Add(Label5);
            GroupBox1.Controls.Add(TextBox5);
            GroupBox1.Controls.Add(Label6);
            GroupBox1.Controls.Add(TextBox6);
            GroupBox1.Controls.Add(Label3);
            GroupBox1.Controls.Add(TextBox3);
            GroupBox1.Controls.Add(CheckBox1);
            GroupBox1.ForeColor = Color.FromArgb(Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(192)));
            GroupBox1.Location = new Point(6, 5);
            GroupBox1.Name = "GroupBox1";
            GroupBox1.Size = new Size(350, 210);
            GroupBox1.TabIndex = 25;
            GroupBox1.TabStop = false;
            GroupBox1.Text = "Miniature";
            // 
            // Label46
            // 
            Label46.AutoSize = true;
            Label46.Location = new Point(198, 43);
            Label46.Name = "Label46";
            Label46.Size = new Size(40, 13);
            Label46.TabIndex = 21;
            Label46.Text = "Qualità";
            // 
            // TextBox33
            // 
            TextBox33.Location = new Point(244, 40);
            TextBox33.Name = "TextBox33";
            TextBox33.Size = new Size(100, 20);
            TextBox33.TabIndex = 20;
            // 
            // Panel2
            // 
            Panel2.Controls.Add(RadioButton3);
            Panel2.Controls.Add(RadioButton7);
            Panel2.Controls.Add(RadioButton4);
            Panel2.Controls.Add(RadioButton6);
            Panel2.Controls.Add(RadioButton5);
            Panel2.Location = new Point(56, 114);
            Panel2.Name = "Panel2";
            Panel2.Size = new Size(235, 90);
            Panel2.TabIndex = 19;
            // 
            // RadioButton3
            // 
            RadioButton3.AutoSize = true;
            RadioButton3.Location = new Point(15, 16);
            RadioButton3.Name = "RadioButton3";
            RadioButton3.Size = new Size(99, 17);
            RadioButton3.TabIndex = 14;
            RadioButton3.TabStop = true;
            RadioButton3.Text = "Aggiungi Scritta";
            RadioButton3.UseVisualStyleBackColor = true;
            // 
            // RadioButton7
            // 
            RadioButton7.AutoSize = true;
            RadioButton7.Location = new Point(129, 40);
            RadioButton7.Name = "RadioButton7";
            RadioButton7.Size = new Size(95, 17);
            RadioButton7.TabIndex = 18;
            RadioButton7.TabStop = true;
            RadioButton7.Text = "numero+tempo";
            RadioButton7.UseVisualStyleBackColor = true;
            // 
            // RadioButton4
            // 
            RadioButton4.AutoSize = true;
            RadioButton4.Location = new Point(15, 40);
            RadioButton4.Name = "RadioButton4";
            RadioButton4.Size = new Size(95, 17);
            RadioButton4.TabIndex = 15;
            RadioButton4.TabStop = true;
            RadioButton4.Text = "Aggiungi orario";
            RadioButton4.UseVisualStyleBackColor = true;
            // 
            // RadioButton6
            // 
            RadioButton6.AutoSize = true;
            RadioButton6.Location = new Point(129, 16);
            RadioButton6.Name = "RadioButton6";
            RadioButton6.Size = new Size(83, 17);
            RadioButton6.TabIndex = 17;
            RadioButton6.TabStop = true;
            RadioButton6.Text = "Numero foto";
            RadioButton6.UseVisualStyleBackColor = true;
            // 
            // RadioButton5
            // 
            RadioButton5.AutoSize = true;
            RadioButton5.Location = new Point(15, 65);
            RadioButton5.Name = "RadioButton5";
            RadioButton5.Size = new Size(84, 17);
            RadioButton5.TabIndex = 16;
            RadioButton5.TabStop = true;
            RadioButton5.Text = "Tempo Gara";
            RadioButton5.UseVisualStyleBackColor = true;
            // 
            // Label5
            // 
            Label5.AutoSize = true;
            Label5.ForeColor = Color.Black;
            Label5.Location = new Point(24, 88);
            Label5.Name = "Label5";
            Label5.Size = new Size(41, 13);
            Label5.TabIndex = 12;
            Label5.Text = "Altezza";
            // 
            // TextBox5
            // 
            TextBox5.Location = new Point(72, 64);
            TextBox5.Name = "TextBox5";
            TextBox5.Size = new Size(88, 20);
            TextBox5.TabIndex = 10;
            TextBox5.Text = "TextBox5";
            // 
            // Label6
            // 
            Label6.AutoSize = true;
            Label6.ForeColor = Color.Black;
            Label6.Location = new Point(8, 64);
            Label6.Name = "Label6";
            Label6.Size = new Size(56, 13);
            Label6.TabIndex = 13;
            Label6.Text = "Larghezza";
            // 
            // TextBox6
            // 
            TextBox6.Location = new Point(72, 88);
            TextBox6.Name = "TextBox6";
            TextBox6.Size = new Size(88, 20);
            TextBox6.TabIndex = 11;
            TextBox6.Text = "TextBox6";
            // 
            // Label3
            // 
            Label3.AutoSize = true;
            Label3.ForeColor = Color.Black;
            Label3.Location = new Point(24, 40);
            Label3.Name = "Label3";
            Label3.Size = new Size(44, 13);
            Label3.TabIndex = 7;
            Label3.Text = "Suffisso";
            // 
            // TextBox3
            // 
            TextBox3.Location = new Point(72, 40);
            TextBox3.Name = "TextBox3";
            TextBox3.Size = new Size(88, 20);
            TextBox3.TabIndex = 6;
            TextBox3.Text = "TextBox3";
            // 
            // CheckBox1
            // 
            CheckBox1.ForeColor = Color.Black;
            CheckBox1.Location = new Point(72, 16);
            CheckBox1.Name = "CheckBox1";
            CheckBox1.Size = new Size(104, 24);
            CheckBox1.TabIndex = 5;
            CheckBox1.Text = "Crea miniature";
            // 
            // TabPage2
            // 
            TabPage2.Controls.Add(GroupBox2);
            TabPage2.Location = new Point(4, 22);
            TabPage2.Name = "TabPage2";
            TabPage2.Padding = new Padding(3);
            TabPage2.Size = new Size(513, 326);
            TabPage2.TabIndex = 5;
            TabPage2.Text = "Foto";
            TabPage2.UseVisualStyleBackColor = true;
            // 
            // GroupBox2
            // 
            GroupBox2.Controls.Add(Label45);
            GroupBox2.Controls.Add(TextBox32);
            GroupBox2.Controls.Add(TextBox26);
            GroupBox2.Controls.Add(Label37);
            GroupBox2.Controls.Add(Label38);
            GroupBox2.Controls.Add(TextBox27);
            GroupBox2.Controls.Add(Label39);
            GroupBox2.Controls.Add(TextBox28);
            GroupBox2.Controls.Add(CheckBox15);
            GroupBox2.ForeColor = Color.FromArgb(Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(192)));
            GroupBox2.Location = new Point(3, 6);
            GroupBox2.Name = "GroupBox2";
            GroupBox2.Size = new Size(304, 156);
            GroupBox2.TabIndex = 36;
            GroupBox2.TabStop = false;
            GroupBox2.Text = "Foto grande";
            // 
            // Label45
            // 
            Label45.AutoSize = true;
            Label45.Location = new Point(11, 86);
            Label45.Name = "Label45";
            Label45.Size = new Size(40, 13);
            Label45.TabIndex = 22;
            Label45.Text = "Qualità";
            // 
            // TextBox32
            // 
            TextBox32.Location = new Point(72, 80);
            TextBox32.Name = "TextBox32";
            TextBox32.Size = new Size(72, 20);
            TextBox32.TabIndex = 21;
            TextBox32.Text = "100";
            // 
            // TextBox26
            // 
            TextBox26.Location = new Point(224, 48);
            TextBox26.Name = "TextBox26";
            TextBox26.Size = new Size(56, 20);
            TextBox26.TabIndex = 20;
            TextBox26.Text = "TextBox26";
            // 
            // Label37
            // 
            Label37.ForeColor = Color.Black;
            Label37.Location = new Point(168, 48);
            Label37.Name = "Label37";
            Label37.Size = new Size(48, 16);
            Label37.TabIndex = 19;
            Label37.Text = "Suffisso";
            Label37.TextAlign = ContentAlignment.MiddleRight;
            // 
            // Label38
            // 
            Label38.AutoSize = true;
            Label38.ForeColor = Color.Black;
            Label38.Location = new Point(24, 24);
            Label38.Name = "Label38";
            Label38.Size = new Size(41, 13);
            Label38.TabIndex = 16;
            Label38.Text = "Altezza";
            // 
            // TextBox27
            // 
            TextBox27.Location = new Point(72, 24);
            TextBox27.Name = "TextBox27";
            TextBox27.Size = new Size(72, 20);
            TextBox27.TabIndex = 14;
            TextBox27.Text = "TextBox27";
            // 
            // Label39
            // 
            Label39.AutoSize = true;
            Label39.ForeColor = Color.Black;
            Label39.Location = new Point(8, 48);
            Label39.Name = "Label39";
            Label39.Size = new Size(56, 13);
            Label39.TabIndex = 17;
            Label39.Text = "Larghezza";
            // 
            // TextBox28
            // 
            TextBox28.Location = new Point(72, 48);
            TextBox28.Name = "TextBox28";
            TextBox28.Size = new Size(72, 20);
            TextBox28.TabIndex = 15;
            TextBox28.Text = "TextBox28";
            // 
            // CheckBox15
            // 
            CheckBox15.Checked = true;
            CheckBox15.CheckState = CheckState.Checked;
            CheckBox15.ForeColor = Color.Black;
            CheckBox15.Location = new Point(168, 16);
            CheckBox15.Name = "CheckBox15";
            CheckBox15.Size = new Size(120, 32);
            CheckBox15.TabIndex = 18;
            CheckBox15.Text = "Mantieni dimensioni originali";
            // 
            // TabPage3
            // 
            TabPage3.Controls.Add(GroupBox10);
            TabPage3.Controls.Add(GroupBox9);
            TabPage3.Controls.Add(GroupBox5);
            TabPage3.Controls.Add(GroupBox4);
            TabPage3.Location = new Point(4, 22);
            TabPage3.Name = "TabPage3";
            TabPage3.Padding = new Padding(3);
            TabPage3.Size = new Size(513, 326);
            TabPage3.TabIndex = 2;
            TabPage3.Text = "Testo";
            TabPage3.UseVisualStyleBackColor = true;
            // 
            // GroupBox10
            // 
            GroupBox10.Controls.Add(Label42);
            GroupBox10.Controls.Add(Label41);
            GroupBox10.Controls.Add(TextBox31);
            GroupBox10.Controls.Add(TextBox30);
            GroupBox10.Location = new Point(316, 53);
            GroupBox10.Name = "GroupBox10";
            GroupBox10.Size = new Size(186, 73);
            GroupBox10.TabIndex = 39;
            GroupBox10.TabStop = false;
            GroupBox10.Text = "Testo foto verticali";
            // 
            // Label42
            // 
            Label42.AutoSize = true;
            Label42.Location = new Point(7, 46);
            Label42.Name = "Label42";
            Label42.Size = new Size(45, 13);
            Label42.TabIndex = 3;
            Label42.Text = "Margine";
            // 
            // Label41
            // 
            Label41.AutoSize = true;
            Label41.Location = new Point(7, 25);
            Label41.Name = "Label41";
            Label41.Size = new Size(108, 13);
            Label41.TabIndex = 2;
            Label41.Text = "Dimensione Carattere";
            // 
            // TextBox31
            // 
            TextBox31.Location = new Point(131, 46);
            TextBox31.Name = "TextBox31";
            TextBox31.Size = new Size(39, 20);
            TextBox31.TabIndex = 1;
            // 
            // TextBox30
            // 
            TextBox30.Location = new Point(131, 22);
            TextBox30.Name = "TextBox30";
            TextBox30.Size = new Size(39, 20);
            TextBox30.TabIndex = 0;
            // 
            // GroupBox9
            // 
            GroupBox9.Controls.Add(CheckBox17);
            GroupBox9.Controls.Add(CheckBox16);
            GroupBox9.Location = new Point(316, 6);
            GroupBox9.Name = "GroupBox9";
            GroupBox9.Size = new Size(186, 45);
            GroupBox9.TabIndex = 38;
            GroupBox9.TabStop = false;
            GroupBox9.Text = "Slide show";
            // 
            // CheckBox17
            // 
            CheckBox17.AutoSize = true;
            CheckBox17.Location = new Point(96, 18);
            CheckBox17.Name = "CheckBox17";
            CheckBox17.Size = new Size(84, 17);
            CheckBox17.TabIndex = 1;
            CheckBox17.Text = "Numero foto";
            CheckBox17.UseVisualStyleBackColor = true;
            // 
            // CheckBox16
            // 
            CheckBox16.AutoSize = true;
            CheckBox16.Location = new Point(6, 19);
            CheckBox16.Name = "CheckBox16";
            CheckBox16.Size = new Size(49, 17);
            CheckBox16.TabIndex = 0;
            CheckBox16.Text = "Data";
            CheckBox16.UseVisualStyleBackColor = true;
            // 
            // GroupBox5
            // 
            GroupBox5.Controls.Add(TextBox34);
            GroupBox5.Controls.Add(_Button8);
            GroupBox5.Controls.Add(Label36);
            GroupBox5.Controls.Add(TextBox25);
            GroupBox5.Controls.Add(Label35);
            GroupBox5.Controls.Add(ComboBox3);
            GroupBox5.Controls.Add(TextBox11);
            GroupBox5.Controls.Add(Label12);
            GroupBox5.Controls.Add(Label11);
            GroupBox5.Controls.Add(CheckBox3);
            GroupBox5.ForeColor = Color.FromArgb(Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(192)));
            GroupBox5.Location = new Point(6, 6);
            GroupBox5.Name = "GroupBox5";
            GroupBox5.Size = new Size(304, 120);
            GroupBox5.TabIndex = 37;
            GroupBox5.TabStop = false;
            GroupBox5.Text = "Carattere";
            // 
            // TextBox34
            // 
            TextBox34.Location = new Point(160, 91);
            TextBox34.Name = "TextBox34";
            TextBox34.Size = new Size(56, 20);
            TextBox34.TabIndex = 36;
            TextBox34.TextAlign = HorizontalAlignment.Right;
            // 
            // Button8
            // 
            _Button8.ForeColor = Color.Black;
            _Button8.Location = new Point(222, 89);
            _Button8.Name = "_Button8";
            _Button8.Size = new Size(74, 24);
            _Button8.TabIndex = 35;
            _Button8.Text = "Scegli...";
            // 
            // Label36
            // 
            Label36.ForeColor = Color.Black;
            Label36.Location = new Point(8, 60);
            Label36.Name = "Label36";
            Label36.Size = new Size(120, 19);
            Label36.TabIndex = 34;
            Label36.Text = "Dimensione miniatura";
            Label36.TextAlign = ContentAlignment.MiddleLeft;
            // 
            // TextBox25
            // 
            TextBox25.Location = new Point(160, 59);
            TextBox25.Name = "TextBox25";
            TextBox25.Size = new Size(56, 20);
            TextBox25.TabIndex = 33;
            TextBox25.Text = "TextBox25";
            // 
            // Label35
            // 
            Label35.ForeColor = Color.Black;
            Label35.Location = new Point(8, 93);
            Label35.Name = "Label35";
            Label35.Size = new Size(72, 16);
            Label35.TabIndex = 32;
            Label35.Text = "Colore RGB";
            Label35.TextAlign = ContentAlignment.MiddleLeft;
            // 
            // ComboBox3
            // 
            ComboBox3.Location = new Point(96, 8);
            ComboBox3.Name = "ComboBox3";
            ComboBox3.Size = new Size(120, 21);
            ComboBox3.TabIndex = 28;
            ComboBox3.Text = "ComboBox3";
            // 
            // TextBox11
            // 
            TextBox11.Location = new Point(160, 35);
            TextBox11.Name = "TextBox11";
            TextBox11.Size = new Size(56, 20);
            TextBox11.TabIndex = 27;
            TextBox11.Text = "TextBox11";
            // 
            // Label12
            // 
            Label12.AutoSize = true;
            Label12.ForeColor = Color.Black;
            Label12.Location = new Point(8, 38);
            Label12.Name = "Label12";
            Label12.Size = new Size(62, 13);
            Label12.TabIndex = 26;
            Label12.Text = "Dimensione";
            Label12.TextAlign = ContentAlignment.MiddleLeft;
            // 
            // Label11
            // 
            Label11.AutoSize = true;
            Label11.ForeColor = Color.Black;
            Label11.Location = new Point(56, 8);
            Label11.Name = "Label11";
            Label11.Size = new Size(28, 13);
            Label11.TabIndex = 22;
            Label11.Text = "Font";
            // 
            // CheckBox3
            // 
            CheckBox3.ForeColor = Color.Black;
            CheckBox3.Location = new Point(224, 8);
            CheckBox3.Name = "CheckBox3";
            CheckBox3.Size = new Size(72, 24);
            CheckBox3.TabIndex = 24;
            CheckBox3.Text = "Grassetto";
            // 
            // GroupBox4
            // 
            GroupBox4.Controls.Add(Label40);
            GroupBox4.Controls.Add(TextBox29);
            GroupBox4.Controls.Add(TextBox18);
            GroupBox4.Controls.Add(Label26);
            GroupBox4.Controls.Add(DateTimePicker1);
            GroupBox4.Controls.Add(CheckBox8);
            GroupBox4.Controls.Add(TextBox9);
            GroupBox4.Controls.Add(CheckBox7);
            GroupBox4.Controls.Add(Label4);
            GroupBox4.Controls.Add(TextBox4);
            GroupBox4.Controls.Add(Label9);
            GroupBox4.Controls.Add(Label13);
            GroupBox4.Controls.Add(ComboBox1);
            GroupBox4.Controls.Add(ComboBox2);
            GroupBox4.Controls.Add(Label14);
            GroupBox4.Controls.Add(TextBox12);
            GroupBox4.Controls.Add(Label15);
            GroupBox4.ForeColor = Color.FromArgb(Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(192)));
            GroupBox4.Location = new Point(6, 132);
            GroupBox4.Name = "GroupBox4";
            GroupBox4.Size = new Size(496, 186);
            GroupBox4.TabIndex = 36;
            GroupBox4.TabStop = false;
            GroupBox4.Text = "Testo da applicare";
            // 
            // Label40
            // 
            Label40.AutoSize = true;
            Label40.Location = new Point(8, 52);
            Label40.Name = "Label40";
            Label40.Size = new Size(48, 13);
            Label40.TabIndex = 40;
            Label40.Text = "Verticale";
            // 
            // TextBox29
            // 
            TextBox29.Location = new Point(72, 49);
            TextBox29.Multiline = true;
            TextBox29.Name = "TextBox29";
            TextBox29.Size = new Size(408, 44);
            TextBox29.TabIndex = 39;
            // 
            // TextBox18
            // 
            TextBox18.Location = new Point(232, 156);
            TextBox18.Name = "TextBox18";
            TextBox18.Size = new Size(100, 20);
            TextBox18.TabIndex = 38;
            // 
            // Label26
            // 
            Label26.AutoSize = true;
            Label26.ForeColor = Color.Black;
            Label26.Location = new Point(344, 156);
            Label26.Name = "Label26";
            Label26.Size = new Size(48, 13);
            Label26.TabIndex = 37;
            Label26.Text = "partenza";
            // 
            // DateTimePicker1
            // 
            DateTimePicker1.Format = DateTimePickerFormat.Time;
            DateTimePicker1.Location = new Point(392, 156);
            DateTimePicker1.Name = "DateTimePicker1";
            DateTimePicker1.Size = new Size(88, 20);
            DateTimePicker1.TabIndex = 36;
            // 
            // CheckBox8
            // 
            CheckBox8.ForeColor = Color.Black;
            CheckBox8.Location = new Point(72, 156);
            CheckBox8.Name = "CheckBox8";
            CheckBox8.Size = new Size(56, 16);
            CheckBox8.TabIndex = 35;
            CheckBox8.Text = "Orario";
            // 
            // TextBox9
            // 
            TextBox9.Location = new Point(120, 108);
            TextBox9.Name = "TextBox9";
            TextBox9.Size = new Size(56, 20);
            TextBox9.TabIndex = 20;
            TextBox9.Text = "TextBox9";
            // 
            // CheckBox7
            // 
            CheckBox7.ForeColor = Color.Black;
            CheckBox7.Location = new Point(136, 156);
            CheckBox7.Name = "CheckBox7";
            CheckBox7.Size = new Size(88, 16);
            CheckBox7.TabIndex = 34;
            CheckBox7.Text = "Tempo gara";
            // 
            // Label4
            // 
            Label4.AutoSize = true;
            Label4.ForeColor = Color.Black;
            Label4.Location = new Point(8, 24);
            Label4.Name = "Label4";
            Label4.Size = new Size(59, 13);
            Label4.TabIndex = 9;
            Label4.Text = "Orizzontale";
            // 
            // TextBox4
            // 
            TextBox4.Location = new Point(72, 24);
            TextBox4.Name = "TextBox4";
            TextBox4.Size = new Size(408, 20);
            TextBox4.TabIndex = 8;
            TextBox4.Text = "TextBox4";
            // 
            // Label9
            // 
            Label9.AutoSize = true;
            Label9.ForeColor = Color.Black;
            Label9.Location = new Point(8, 108);
            Label9.Name = "Label9";
            Label9.Size = new Size(110, 13);
            Label9.TabIndex = 19;
            Label9.Text = "Trasparenza (0-100%)";
            // 
            // Label13
            // 
            Label13.AutoSize = true;
            Label13.ForeColor = Color.Black;
            Label13.Location = new Point(16, 132);
            Label13.Name = "Label13";
            Label13.Size = new Size(52, 13);
            Label13.TabIndex = 29;
            Label13.Text = "Posizione";
            // 
            // ComboBox1
            // 
            ComboBox1.Location = new Point(72, 132);
            ComboBox1.Name = "ComboBox1";
            ComboBox1.Size = new Size(104, 21);
            ComboBox1.TabIndex = 28;
            ComboBox1.Text = "ComboBox1";
            // 
            // ComboBox2
            // 
            ComboBox2.Location = new Point(376, 132);
            ComboBox2.Name = "ComboBox2";
            ComboBox2.Size = new Size(104, 21);
            ComboBox2.TabIndex = 31;
            ComboBox2.Text = "ComboBox2";
            // 
            // Label14
            // 
            Label14.AutoSize = true;
            Label14.ForeColor = Color.Black;
            Label14.Location = new Point(304, 132);
            Label14.Name = "Label14";
            Label14.Size = new Size(67, 13);
            Label14.TabIndex = 30;
            Label14.Text = "Allineamento";
            // 
            // TextBox12
            // 
            TextBox12.Location = new Point(376, 108);
            TextBox12.Name = "TextBox12";
            TextBox12.Size = new Size(104, 20);
            TextBox12.TabIndex = 33;
            TextBox12.Text = "TextBox12";
            // 
            // Label15
            // 
            Label15.AutoSize = true;
            Label15.ForeColor = Color.Black;
            Label15.Location = new Point(296, 108);
            Label15.Name = "Label15";
            Label15.Size = new Size(75, 13);
            Label15.TabIndex = 32;
            Label15.Text = "Margine (pixel)";
            // 
            // TabPage5
            // 
            TabPage5.Controls.Add(GroupBox3);
            TabPage5.Controls.Add(GroupBox8);
            TabPage5.Controls.Add(GroupBox7);
            TabPage5.Location = new Point(4, 22);
            TabPage5.Name = "TabPage5";
            TabPage5.Padding = new Padding(3);
            TabPage5.Size = new Size(513, 326);
            TabPage5.TabIndex = 4;
            TabPage5.Text = "Generale";
            TabPage5.UseVisualStyleBackColor = true;
            // 
            // GroupBox3
            // 
            GroupBox3.Controls.Add(CheckBox6);
            GroupBox3.Controls.Add(_Button3);
            GroupBox3.Controls.Add(_Button2);
            GroupBox3.Controls.Add(Label1);
            GroupBox3.Controls.Add(Label2);
            GroupBox3.Controls.Add(TextBox1);
            GroupBox3.Controls.Add(TextBox2);
            GroupBox3.ForeColor = Color.FromArgb(Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(192)));
            GroupBox3.Location = new Point(6, 6);
            GroupBox3.Name = "GroupBox3";
            GroupBox3.Size = new Size(496, 101);
            GroupBox3.TabIndex = 35;
            GroupBox3.TabStop = false;
            GroupBox3.Text = "Directory";
            // 
            // CheckBox6
            // 
            CheckBox6.ForeColor = Color.Black;
            CheckBox6.Location = new Point(80, 64);
            CheckBox6.Name = "CheckBox6";
            CheckBox6.Size = new Size(152, 24);
            CheckBox6.TabIndex = 25;
            CheckBox6.Text = "aggiorna le sottodirectory";
            // 
            // Button3
            // 
            _Button3.Location = new Point(462, 40);
            _Button3.Name = "_Button3";
            _Button3.Size = new Size(24, 20);
            _Button3.TabIndex = 6;
            _Button3.Text = "...";
            // 
            // Button2
            // 
            _Button2.Location = new Point(462, 16);
            _Button2.Name = "_Button2";
            _Button2.Size = new Size(24, 20);
            _Button2.TabIndex = 5;
            _Button2.Text = "...";
            // 
            // Label1
            // 
            Label1.AutoSize = true;
            Label1.ForeColor = Color.Black;
            Label1.Location = new Point(6, 19);
            Label1.Name = "Label1";
            Label1.Size = new Size(50, 13);
            Label1.TabIndex = 3;
            Label1.Text = "Sorgente";
            // 
            // Label2
            // 
            Label2.AutoSize = true;
            Label2.ForeColor = Color.Black;
            Label2.Location = new Point(6, 43);
            Label2.Name = "Label2";
            Label2.Size = new Size(68, 13);
            Label2.TabIndex = 4;
            Label2.Text = "Destinazione";
            // 
            // TextBox1
            // 
            TextBox1.Location = new Point(80, 16);
            TextBox1.Name = "TextBox1";
            TextBox1.Size = new Size(376, 20);
            TextBox1.TabIndex = 0;
            TextBox1.Text = "TextBox1";
            // 
            // TextBox2
            // 
            TextBox2.Location = new Point(80, 40);
            TextBox2.Name = "TextBox2";
            TextBox2.Size = new Size(376, 20);
            TextBox2.TabIndex = 1;
            TextBox2.Text = "TextBox2";
            // 
            // GroupBox8
            // 
            GroupBox8.Controls.Add(RadioButton2);
            GroupBox8.Controls.Add(RadioButton1);
            GroupBox8.Controls.Add(TextBox21);
            GroupBox8.Controls.Add(Label34);
            GroupBox8.Controls.Add(TextBox20);
            GroupBox8.Controls.Add(Label33);
            GroupBox8.Controls.Add(Label31);
            GroupBox8.Controls.Add(CheckBox11);
            GroupBox8.Controls.Add(TextBox17);
            GroupBox8.Controls.Add(Label32);
            GroupBox8.ForeColor = Color.FromArgb(Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(192)));
            GroupBox8.Location = new Point(204, 113);
            GroupBox8.Name = "GroupBox8";
            GroupBox8.Size = new Size(192, 152);
            GroupBox8.TabIndex = 47;
            GroupBox8.TabStop = false;
            GroupBox8.Text = "Sottocartelle";
            // 
            // RadioButton2
            // 
            RadioButton2.ForeColor = Color.Black;
            RadioButton2.Location = new Point(32, 128);
            RadioButton2.Name = "RadioButton2";
            RadioButton2.Size = new Size(136, 16);
            RadioButton2.TabIndex = 38;
            RadioButton2.Text = "Numerazione files";
            // 
            // RadioButton1
            // 
            RadioButton1.Checked = true;
            RadioButton1.ForeColor = Color.Black;
            RadioButton1.Location = new Point(32, 112);
            RadioButton1.Name = "RadioButton1";
            RadioButton1.Size = new Size(152, 16);
            RadioButton1.TabIndex = 37;
            RadioButton1.TabStop = true;
            RadioButton1.Text = "Numerazione progressiva";
            // 
            // TextBox21
            // 
            TextBox21.Location = new Point(128, 88);
            TextBox21.Name = "TextBox21";
            TextBox21.Size = new Size(56, 20);
            TextBox21.TabIndex = 34;
            TextBox21.Text = "4";
            // 
            // Label34
            // 
            Label34.ForeColor = Color.Black;
            Label34.Location = new Point(8, 88);
            Label34.Name = "Label34";
            Label34.Size = new Size(112, 16);
            Label34.TabIndex = 33;
            Label34.Text = "Num. cifre contatore";
            Label34.TextAlign = ContentAlignment.MiddleRight;
            // 
            // TextBox20
            // 
            TextBox20.Location = new Point(56, 64);
            TextBox20.Name = "TextBox20";
            TextBox20.Size = new Size(128, 20);
            TextBox20.TabIndex = 32;
            TextBox20.Text = "TextBox20";
            // 
            // Label33
            // 
            Label33.ForeColor = Color.Black;
            Label33.Location = new Point(6, 67);
            Label33.Name = "Label33";
            Label33.Size = new Size(48, 16);
            Label33.TabIndex = 31;
            Label33.Text = "Suffisso";
            // 
            // Label31
            // 
            Label31.ForeColor = Color.Black;
            Label31.Location = new Point(24, 40);
            Label31.Name = "Label31";
            Label31.Size = new Size(32, 16);
            Label31.TabIndex = 30;
            Label31.Text = "ogni";
            // 
            // CheckBox11
            // 
            CheckBox11.ForeColor = Color.Black;
            CheckBox11.Location = new Point(56, 16);
            CheckBox11.Name = "CheckBox11";
            CheckBox11.Size = new Size(112, 16);
            CheckBox11.TabIndex = 29;
            CheckBox11.Text = "crea sottocartelle";
            // 
            // TextBox17
            // 
            TextBox17.Location = new Point(56, 40);
            TextBox17.Name = "TextBox17";
            TextBox17.Size = new Size(64, 20);
            TextBox17.TabIndex = 27;
            TextBox17.Text = "99";
            // 
            // Label32
            // 
            Label32.ForeColor = Color.Black;
            Label32.Location = new Point(128, 40);
            Label32.Name = "Label32";
            Label32.Size = new Size(24, 16);
            Label32.TabIndex = 28;
            Label32.Text = "file";
            // 
            // GroupBox7
            // 
            GroupBox7.Controls.Add(CheckBox10);
            GroupBox7.Controls.Add(CheckBox9);
            GroupBox7.ForeColor = Color.FromArgb(Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(0)), Conversions.ToInteger(Conversions.ToByte(192)));
            GroupBox7.Location = new Point(6, 113);
            GroupBox7.Name = "GroupBox7";
            GroupBox7.Size = new Size(192, 88);
            GroupBox7.TabIndex = 45;
            GroupBox7.TabStop = false;
            GroupBox7.Text = "Generale";
            // 
            // CheckBox10
            // 
            CheckBox10.ForeColor = Color.Black;
            CheckBox10.Location = new Point(16, 37);
            CheckBox10.Name = "CheckBox10";
            CheckBox10.Size = new Size(136, 16);
            CheckBox10.TabIndex = 1;
            CheckBox10.Text = "Rotazione automatica";
            // 
            // CheckBox9
            // 
            CheckBox9.Checked = true;
            CheckBox9.CheckState = CheckState.Checked;
            CheckBox9.ForeColor = Color.Black;
            CheckBox9.Location = new Point(16, 18);
            CheckBox9.Name = "CheckBox9";
            CheckBox9.Size = new Size(80, 16);
            CheckBox9.TabIndex = 0;
            CheckBox9.Text = "Forza Jpg";
            // 
            // TabControl1
            // 
            TabControl1.Controls.Add(TabPage5);
            TabControl1.Controls.Add(TabPage3);
            TabControl1.Controls.Add(TabPage2);
            TabControl1.Controls.Add(TabPage1);
            TabControl1.Controls.Add(TabPage4);
            TabControl1.Location = new Point(12, 12);
            TabControl1.Name = "TabControl1";
            TabControl1.SelectedIndex = 0;
            TabControl1.Size = new Size(521, 352);
            TabControl1.TabIndex = 48;
            // 
            // ProgressBar1
            // 
            ProgressBar1.Location = new Point(539, 211);
            ProgressBar1.Name = "ProgressBar1";
            ProgressBar1.Size = new Size(192, 23);
            ProgressBar1.TabIndex = 52;
            // 
            // CheckBox12
            // 
            _CheckBox12.ForeColor = Color.Black;
            _CheckBox12.Location = new Point(10, 19);
            _CheckBox12.Name = "_CheckBox12";
            _CheckBox12.Size = new Size(104, 21);
            _CheckBox12.TabIndex = 35;
            _CheckBox12.Text = "Aggiungi orario";
            // 
            // CheckBox4
            // 
            _CheckBox4.ForeColor = Color.Black;
            _CheckBox4.Location = new Point(10, 3);
            _CheckBox4.Name = "_CheckBox4";
            _CheckBox4.Size = new Size(104, 17);
            _CheckBox4.TabIndex = 34;
            _CheckBox4.Text = "Aggiungi scritta";
            // 
            // CheckBox18
            // 
            _CheckBox18.AutoSize = true;
            _CheckBox18.Location = new Point(140, 3);
            _CheckBox18.Name = "_CheckBox18";
            _CheckBox18.Size = new Size(84, 17);
            _CheckBox18.TabIndex = 36;
            _CheckBox18.Text = "Numero foto";
            _CheckBox18.UseVisualStyleBackColor = true;
            // 
            // Panel1
            // 
            Panel1.Controls.Add(_CheckBox18);
            Panel1.Controls.Add(_CheckBox4);
            Panel1.Controls.Add(_CheckBox12);
            Panel1.Location = new Point(52, 236);
            Panel1.Name = "Panel1";
            Panel1.Size = new Size(304, 73);
            Panel1.TabIndex = 26;
            Panel1.Visible = false;
            // 
            // Form1
            // 
            AutoScaleBaseSize = new Size(5, 13);
            ClientSize = new Size(740, 375);
            Controls.Add(ProgressBar1);
            Controls.Add(Label44);
            Controls.Add(CheckBox22);
            Controls.Add(Label43);
            Controls.Add(TabControl1);
            Controls.Add(Label27);
            Controls.Add(_Button7);
            Controls.Add(_Button5);
            Controls.Add(Label20);
            Controls.Add(Label19);
            Controls.Add(Label18);
            Controls.Add(Label17);
            Controls.Add(Label10);
            Controls.Add(_Button1);
            Controls.Add(_Button6);
            MaximizeBox = false;
            MaximumSize = new Size(756, 414);
            MinimumSize = new Size(756, 414);
            Name = "Form1";
            Text = "Image Catalog";
            TabPage4.ResumeLayout(false);
            GroupBox6.ResumeLayout(false);
            GroupBox6.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)PictureBox2).EndInit();
            ((System.ComponentModel.ISupportInitialize)_PictureBox1).EndInit();
            ((System.ComponentModel.ISupportInitialize)PictureBox3).EndInit();
            TabPage1.ResumeLayout(false);
            GroupBox1.ResumeLayout(false);
            GroupBox1.PerformLayout();
            Panel2.ResumeLayout(false);
            Panel2.PerformLayout();
            TabPage2.ResumeLayout(false);
            GroupBox2.ResumeLayout(false);
            GroupBox2.PerformLayout();
            TabPage3.ResumeLayout(false);
            GroupBox10.ResumeLayout(false);
            GroupBox10.PerformLayout();
            GroupBox9.ResumeLayout(false);
            GroupBox9.PerformLayout();
            GroupBox5.ResumeLayout(false);
            GroupBox5.PerformLayout();
            GroupBox4.ResumeLayout(false);
            GroupBox4.PerformLayout();
            TabPage5.ResumeLayout(false);
            GroupBox3.ResumeLayout(false);
            GroupBox3.PerformLayout();
            GroupBox8.ResumeLayout(false);
            GroupBox8.PerformLayout();
            GroupBox7.ResumeLayout(false);
            TabControl1.ResumeLayout(false);
            Panel1.ResumeLayout(false);
            Panel1.PerformLayout();
            ResumeLayout(false);
            PerformLayout();
        }

        /* TODO ERROR: Skipped EndRegionDirectiveTrivia */
        /* TODO ERROR: Skipped DefineDirectiveTrivia */
        private bool StopAttivo;
        private bool WaterSelectColor = false;
        private int ContaFotoCuori;
        private PicInfo[] TaskCuori;
        private XYThreadPool MyPool = new XYThreadPool();
        private int ContaImmaginiThread;
        private const int maxThreads = 15;

        private void setDefaults()
        {
            TextBox1.Text = "";
            TextBox2.Text = "";
            TextBox3.Text = "";
            TextBox4.Text = "";
            TextBox5.Text = "";
            TextBox6.Text = "";
            TextBox27.Text = "";
            TextBox28.Text = "";
            TextBox9.Text = "";
            TextBox11.Text = "";
            TextBox12.Text = "";
            TextBox13.Text = "";
            TextBox10.Text = "";
            TextBox14.Text = "";
            TextBox15.Text = "";
            TextBox16.Text = "";
            TextBox17.Text = "";
            TextBox19.Text = "";
            TextBox20.Text = "";
            TextBox21.Text = "";
            TextBox25.Text = "";
            TextBox26.Text = "";
            ComboBox1.Items.Add("Alto");
            ComboBox1.Items.Add("Basso");
            ComboBox1.SelectedIndex = 1;
            ComboBox2.Items.Add("Sinistra");
            ComboBox2.Items.Add("Centro");
            ComboBox2.Items.Add("Destra");
            ComboBox2.SelectedIndex = 1;
            ComboBox3.Items.Add("Arial");
            ComboBox3.Items.Add("Arial Black");
            ComboBox3.Items.Add("Arial Narrow");
            ComboBox3.Items.Add("Comic Sans MS");
            ComboBox3.Items.Add("Courier New");
            ComboBox3.Items.Add("System");
            ComboBox3.Items.Add("Times New Roman");
            ComboBox3.Items.Add("Verdana");
            ComboBox3.Items.Add("Wingdings");
            ComboBox3.SelectedIndex = 7;
            ComboBox4.Items.Add("Sinistra");
            ComboBox4.Items.Add("Centro");
            ComboBox4.Items.Add("Destra");
            ComboBox4.SelectedIndex = 2;
            ComboBox5.Items.Add("Alto");
            ComboBox5.Items.Add("Centro");
            ComboBox5.Items.Add("Basso");
            ComboBox5.SelectedIndex = 2;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Application.EnableVisualStyles();
            setDefaults();
        }

        private void FixPaths()
        {
            if (TextBox1.Text.EndsWith(@"\") == false)
            {
                TextBox1.Text += @"\";
            }

            if (TextBox2.Text.EndsWith(@"\") == false)
            {
                TextBox2.Text += @"\";
            }
        }

        private void lockUI()
        {
            TabControl1.Enabled = false;
            Button5.Enabled = false;
            Button6.Enabled = false;
            Button1.Enabled = false;
        }

        private void unlockUI()
        {
            TabControl1.Enabled = true;
            Button5.Enabled = true;
            Button6.Enabled = true;
            Button1.Enabled = true;
        }

        private void btnCreaCatalogo_Click(object sender, EventArgs e)
        {
            lockUI();
            DateTime timeStart;
            DateTime timeStop;
            timeStart = DateAndTime.TimeOfDay;
            FixPaths();
            Label10.Text = "";
            Label17.Text = "0";
            Label18.Text = "0";
            setPicSettings(TextBox1.Text, TextBox2.Text);
            /* TODO ERROR: Skipped IfDirectiveTrivia */
            ProgressBar1.Minimum = 0;
            ProgressBar1.Step = 1;
            ProgressBar1.Value = 0;
            var t1 = new Thread(creaCatalogoThread);
            t1.IsBackground = true;
            t1.Start();

            /* TODO ERROR: Skipped ElseDirectiveTrivia *//* TODO ERROR: Skipped DisabledTextTrivia *//* TODO ERROR: Skipped EndIfDirectiveTrivia */



        }

        private void creaCatalogoThread()
        {
            var timeStart = DateAndTime.TimeOfDay;
            MyPool.StopThreadPool();
            MyPool.StartThreadPool(0, maxThreads);
            ContaImmaginiThread = 0;
            creaImmaginiWithThreadMod(TextBox1.Text, TextBox2.Text);
            ThreadPoolWorkItem ThAttivo = null;
            int i = 0;
            while (i != ContaImmaginiThread)
            {
                Thread.Sleep(100);
                ThAttivo = MyPool.ExtractWorkItem();
                if (ThAttivo is object)
                {
                    i += 1;
                    // stepProgressBar()
                    setLabel10Text("File: " + ThAttivo.m_sName);

                    // setLabel18Text(ContaImmaginiThread.ToString)
                    // setLabel18Text(i.ToString)


                    // Label10.Text = "File: " & ThAttivo.m_sName
                    // Label18.Text = ContaImmaginiThread.ToString
                }
            }

            MyPool.StopThreadPool();
            var timeStop = DateAndTime.TimeOfDay;
            setLabel10Text("Finito");
            setLabel43Text(CalcTime(timeStart, timeStop));
        }

        private void creaCatalogo(DateTime timeStart, DateTime timeStop)
        {
            // asdfg
            MyPool.StopThreadPool();
            MyPool.StartThreadPool(0, maxThreads);
            ContaImmaginiThread = 0;
            creaImmaginiWithThreadMod(TextBox1.Text, TextBox2.Text);
            ThreadPoolWorkItem ThAttivo = null;
            int i = 0;
            while (i != ContaImmaginiThread)
            {
                Thread.Sleep(100);
                ThAttivo = MyPool.ExtractWorkItem();
                if (ThAttivo is object)
                {
                    i += 1;
                    Label10.Text = "File: " + ThAttivo.m_sName;
                    Label18.Text = ContaImmaginiThread.ToString();
                }
            }

            MyPool.StopThreadPool();
            timeStop = DateAndTime.TimeOfDay;
            CalcTime(timeStart, timeStop);
            Label10.Text = "Finito";
            if (CheckBox22.Checked == true)
            {
                Interaction.Shell(@"%windir%\System32\shutdown.exe");
            }
        }

        private string CalcTime(DateTime timeStart, DateTime timeStop)
        {
            long timediffH, timediffS;
            long timediffM;
            timediffM = DateAndTime.DateDiff(DateInterval.Minute, timeStart, timeStop);
            timediffS = DateAndTime.DateDiff(DateInterval.Second, timeStart, timeStop);
            timediffH = DateAndTime.DateDiff(DateInterval.Hour, timeStart, timeStop);
            // dim s As String = "H:" + timediffH.ToString + " M:" + timediffM.ToString + " S:" + timediffS.ToString
            string s = "S:" + timediffS.ToString();
            // Label43.Text = "H:" + timediffH.ToString + " M:" + timediffM.ToString + " S:" + timediffS.ToString
            return s;
        }

        private void Button2_Click(object sender, EventArgs e)
        {
            var DirSearch = new FolderBrowserDialog();
            DirSearch.SelectedPath = TextBox1.Text;
            if (DialogResult.OK == DirSearch.ShowDialog())
            {
                string DirectoryScelta = DirSearch.SelectedPath;
                if (DirectoryScelta.EndsWith(@"\") == false)
                {
                    DirectoryScelta += @"\";
                }

                TextBox1.Text = DirectoryScelta;
            }
        }

        private void Button3_Click(object sender, EventArgs e)
        {
            var DirSearch = new FolderBrowserDialog();
            DirSearch.SelectedPath = TextBox2.Text;
            if (DialogResult.OK == DirSearch.ShowDialog())
            {
                string DirectoryScelta = DirSearch.SelectedPath;
                if (DirectoryScelta.EndsWith(@"\") == false)
                {
                    DirectoryScelta += @"\";
                }

                TextBox2.Text = DirectoryScelta;
            }

            // Dim openFileDialog As OpenFileDialog = New OpenFileDialog

            // Dim openFileDialog As OpenFileDialog = New OpenFileDialog

            // openFileDialog.InitialDirectory = TextBox1.Text
            // openFileDialog.Filter = "Bitmap files (*.bmp)|*.bmp|Jpeg files (*.jpg)|*.jpg|All valid files (*.*)|*.*"
            // openFileDialog.FilterIndex = 2
            // openFileDialog.RestoreDirectory = True

            // If DialogResult.OK = openFileDialog.ShowDialog() Then
            // Dim IlNome As String = openFileDialog.FileName
            // Dim NomeFine As String = ""
            // Dim i As Integer

            // Dim Elenco As String()
            // Elenco = IlNome.Split(New Char() {"\"c})
            // For i = 0 To Elenco.Length - 1
            // NomeFine &= Elenco(i) & "\"
            // Next

            // TextBox1.Text = NomeFine
            // End If
        }

        private void Button5_Click(object sender, EventArgs e)
        {
            var SaveFileDlg = new SaveFileDialog();

            // SaveFileDlg.InitialDirectory = "c:\"
            SaveFileDlg.Filter = "Setup (*.xml)|*.xml|All valid files (*.*)|*.*";
            SaveFileDlg.FilterIndex = 0;
            SaveFileDlg.RestoreDirectory = true;
            if (DialogResult.OK == SaveFileDlg.ShowDialog())
            {
                string IlNome = SaveFileDlg.FileName;
                Module1.SetupIni.NomeFileSetup = IlNome;
                Module1.SetupIni.AggiornaParametro("DirSorgente", TextBox1.Text);
                Module1.SetupIni.AggiornaParametro("DirDestinazione", TextBox2.Text);
                Module1.SetupIni.AggiornaParametro("DirSottoDirectory", CheckBox6.Checked);
                Module1.SetupIni.AggiornaParametro("DirDividiDestinazione", CheckBox11.Checked);
                Module1.SetupIni.AggiornaParametro("DirDividiNumFile", TextBox17.Text);
                Module1.SetupIni.AggiornaParametro("DirDividiSuffisso", TextBox20.Text);
                Module1.SetupIni.AggiornaParametro("DirDividiNumCifre", TextBox21.Text);
                if (RadioButton1.Checked == true)
                {
                    Module1.SetupIni.AggiornaParametro("DirDividiTipoNumerazione", "Progressiva");
                }
                else
                {
                    Module1.SetupIni.AggiornaParametro("DirDividiTipoNumerazione", "Files");
                }

                Module1.SetupIni.AggiornaParametro("MiniatureCrea", CheckBox1.Checked);
                Module1.SetupIni.AggiornaParametro("MiniatureSuffisso", TextBox3.Text);
                Module1.SetupIni.AggiornaParametro("MiniatureAltezza", TextBox5.Text);
                Module1.SetupIni.AggiornaParametro("MiniatureLarghezza", TextBox6.Text);
                Module1.SetupIni.AggiornaParametro("MiniatureAddScritta", RadioButton3.Checked);
                Module1.SetupIni.AggiornaParametro("MiniatureAddOrario", RadioButton4.Checked);
                Module1.SetupIni.AggiornaParametro("FotoAltezza", TextBox27.Text);
                Module1.SetupIni.AggiornaParametro("FotoLarghezza", TextBox28.Text);
                Module1.SetupIni.AggiornaParametro("FotoCodice", TextBox13.Text);
                Module1.SetupIni.AggiornaParametro("FotoDimOriginali", CheckBox2.Checked);
                Module1.SetupIni.AggiornaParametro("FontDimensione", TextBox11.Text);
                Module1.SetupIni.AggiornaParametro("FontDimensioneMiniatura", TextBox25.Text);
                Module1.SetupIni.AggiornaParametro("FontBold", CheckBox3.Checked);
                Module1.SetupIni.AggiornaParametro("FontNome", ComboBox3.Text);
                Module1.SetupIni.AggiornaParametro("TestoTesto", TextBox4.Text);
                Module1.SetupIni.AggiornaParametro("TestoTrasparente", TextBox9.Text);
                Module1.SetupIni.AggiornaParametro("TestoMargine", TextBox12.Text);
                Module1.SetupIni.AggiornaParametro("TestoPosizione", ComboBox1.Text);
                Module1.SetupIni.AggiornaParametro("TestoAllineamento", ComboBox2.Text);
                Module1.SetupIni.AggiornaParametro("MarchioFile", TextBox10.Text);
                Module1.SetupIni.AggiornaParametro("MarchioAltezza", TextBox14.Text);
                Module1.SetupIni.AggiornaParametro("MarchioLarghezza", TextBox15.Text);
                Module1.SetupIni.AggiornaParametro("MarchioMargine", TextBox16.Text);
                Module1.SetupIni.AggiornaParametro("MarchioAllOrizzontale", ComboBox4.Text);
                Module1.SetupIni.AggiornaParametro("MarchioAllVerticale", ComboBox5.Text);
                Module1.SetupIni.AggiornaParametro("MarchioTrasparenza", TextBox19.Text);
                Module1.SetupIni.AggiornaParametro("MarchioAggiungi", CheckBox5.Checked);
                Module1.SetupIni.AggiornaParametro("TempoGara", CheckBox7.Checked);
                Module1.SetupIni.AggiornaParametro("Orario", CheckBox8.Checked);
                Module1.SetupIni.AggiornaParametro("EtichettaOrario", TextBox18.Text);
                Module1.SetupIni.AggiornaParametro("GeneraleForzaJpg", CheckBox9.Checked);
                Module1.SetupIni.AggiornaParametro("GeneraleRotazioneAutomatica", CheckBox10.Checked);
                Module1.SetupIni.AggiornaParametro("GrandezzaVerticale", TextBox30.Text);
                Module1.SetupIni.AggiornaParametro("MargineVerticale", TextBox31.Text);
                Module1.SetupIni.AggiornaParametro("DimensioniOriginali", CheckBox15.Checked);
                Module1.SetupIni.AggiornaParametro("TestoVerticale", TextBox29.Text);
                Module1.SetupIni.AggiornaParametro("NomeMiniatura", RadioButton6.Checked);
                Module1.SetupIni.AggiornaParametro("DataFoto", CheckBox16.Checked);
                Module1.SetupIni.AggiornaParametro("NumeroFoto", CheckBox17.Checked);
                Module1.SetupIni.AggiornaParametro("ColoreTestoRGB", TextBox34.Text);
                Module1.SetupIni.AggiornaParametro("TempoSmall", RadioButton5.Checked);
                Module1.SetupIni.AggiornaParametro("NumTempoSmall", RadioButton7.Checked);
                Module1.SetupIni.AggiornaParametro("CompressioneJpeg", TextBox32.Text);
                Module1.SetupIni.AggiornaParametro("CompressioneJpegMiniatura", TextBox33.Text);
                Module1.SetupIni.SalvaParametriSetup();
                Text = "Image Catalog - " + LeggiSoloNomeFile(IlNome);
            }
        }

        private void Button6_Click(object sender, EventArgs e)
        {
            var openFileDialog = new OpenFileDialog();

            // openFileDialog.InitialDirectory = TextBox1.Text
            openFileDialog.Filter = "Setup (*.xml)|*.xml|All valid files (*.*)|*.*";
            openFileDialog.FilterIndex = 0;
            openFileDialog.RestoreDirectory = true;
            if (DialogResult.OK == openFileDialog.ShowDialog())
            {
                string IlNome = openFileDialog.FileName;
                Module1.SetupIni.NomeFileSetup = IlNome;
                Module1.SetupIni.CaricaParametriSetup();
                TextBox1.Text = Module1.SetupIni.LeggiParametroString("DirSorgente");
                TextBox2.Text = Module1.SetupIni.LeggiParametroString("DirDestinazione");
                CheckBox6.Checked = Module1.SetupIni.LeggiParametroBoolean("DirSottoDirectory");
                CheckBox11.Checked = Module1.SetupIni.LeggiParametroBoolean("DirDividiDestinazione");
                TextBox17.Text = Module1.SetupIni.LeggiParametroString("DirDividiNumFile");
                TextBox20.Text = Module1.SetupIni.LeggiParametroString("DirDividiSuffisso");
                TextBox21.Text = Module1.SetupIni.LeggiParametroString("DirDividiNumCifre");
                string TestoTemp = Module1.SetupIni.LeggiParametroString("DirDividiTipoNumerazione");
                if (TestoTemp.ToUpper() == "PROGRESSIVA")
                {
                    RadioButton1.Checked = true;
                }
                else
                {
                    RadioButton2.Checked = true;
                }

                CheckBox1.Checked = Module1.SetupIni.LeggiParametroBoolean("MiniatureCrea");
                TextBox3.Text = Module1.SetupIni.LeggiParametroString("MiniatureSuffisso");
                TextBox5.Text = Module1.SetupIni.LeggiParametroString("MiniatureAltezza");
                TextBox6.Text = Module1.SetupIni.LeggiParametroString("MiniatureLarghezza");
                RadioButton3.Checked = Module1.SetupIni.LeggiParametroBoolean("MiniatureAddScritta");
                RadioButton4.Checked = Module1.SetupIni.LeggiParametroBoolean("MiniatureAddOrario");
                TextBox27.Text = Module1.SetupIni.LeggiParametroString("FotoAltezza");
                TextBox28.Text = Module1.SetupIni.LeggiParametroString("FotoLarghezza");
                TextBox13.Text = Module1.SetupIni.LeggiParametroString("FotoCodice");
                CheckBox2.Checked = Module1.SetupIni.LeggiParametroBoolean("FotoDimOriginali");
                TextBox11.Text = Module1.SetupIni.LeggiParametroString("FontDimensione");
                TextBox25.Text = Module1.SetupIni.LeggiParametroString("FontDimensioneMiniatura");
                CheckBox3.Checked = Module1.SetupIni.LeggiParametroBoolean("FontBold");
                ComboBox3.Text = Module1.SetupIni.LeggiParametroString("FontNome");
                if (string.IsNullOrEmpty(TextBox25.Text))
                {
                    TextBox25.Text = "0";
                }

                TextBox4.Text = Module1.SetupIni.LeggiParametroString("TestoTesto");
                TextBox9.Text = Module1.SetupIni.LeggiParametroString("TestoTrasparente");
                TextBox12.Text = Module1.SetupIni.LeggiParametroString("TestoMargine");
                ComboBox1.Text = Module1.SetupIni.LeggiParametroString("TestoPosizione");
                ComboBox2.Text = Module1.SetupIni.LeggiParametroString("TestoAllineamento");
                TextBox10.Text = Module1.SetupIni.LeggiParametroString("MarchioFile");
                TextBox14.Text = Module1.SetupIni.LeggiParametroString("MarchioAltezza");
                TextBox15.Text = Module1.SetupIni.LeggiParametroString("MarchioLarghezza");
                TextBox16.Text = Module1.SetupIni.LeggiParametroString("MarchioMargine");
                ComboBox4.Text = Module1.SetupIni.LeggiParametroString("MarchioAllOrizzontale");
                ComboBox5.Text = Module1.SetupIni.LeggiParametroString("MarchioAllVerticale");
                TextBox19.Text = Module1.SetupIni.LeggiParametroString("MarchioTrasparenza");
                CheckBox5.Checked = Module1.SetupIni.LeggiParametroBoolean("MarchioAggiungi");
                CheckBox7.Checked = Module1.SetupIni.LeggiParametroBoolean("TempoGara");
                CheckBox8.Checked = Module1.SetupIni.LeggiParametroBoolean("Orario");
                TextBox18.Text = Module1.SetupIni.LeggiParametroString("EtichettaOrario");
                CheckBox9.Checked = Module1.SetupIni.LeggiParametroBoolean("GeneraleForzaJpg");
                CheckBox10.Checked = Module1.SetupIni.LeggiParametroBoolean("GeneraleRotazioneAutomatica");
                TextBox30.Text = Module1.SetupIni.LeggiParametroString("GrandezzaVerticale");
                TextBox31.Text = Module1.SetupIni.LeggiParametroString("MargineVerticale");
                CheckBox15.Checked = Module1.SetupIni.LeggiParametroBoolean("DimensioniOriginali");
                TextBox29.Text = Module1.SetupIni.LeggiParametroString("TestoVerticale");
                RadioButton6.Checked = Module1.SetupIni.LeggiParametroBoolean("NomeMiniatura");
                CheckBox16.Checked = Module1.SetupIni.LeggiParametroBoolean("DataFoto");
                CheckBox17.Checked = Module1.SetupIni.LeggiParametroBoolean("NumeroFoto");
                RadioButton5.Checked = Module1.SetupIni.LeggiParametroBoolean("TempoSmall");
                RadioButton7.Checked = Module1.SetupIni.LeggiParametroBoolean("NumTempoSmall");
                TextBox32.Text = Module1.SetupIni.LeggiParametroString("CompressioneJpeg");
                TextBox33.Text = Module1.SetupIni.LeggiParametroString("CompressioneJpegMiniatura");
                TextBox34.Text = Module1.SetupIni.LeggiParametroString("ColoreTestoRGB");
                if (File.Exists(TextBox10.Text))
                {
                    PictureBox1.Image = Image.FromFile(TextBox10.Text);
                    if (PictureBox1.Image.Height >= PictureBox1.Image.Width)
                    {
                        PictureBox1.Height = 160;
                        PictureBox1.Width = Conversions.ToInteger(160 * PictureBox1.Image.Width / (double)PictureBox1.Image.Height);
                    }
                    else
                    {
                        PictureBox1.Width = 224;
                        PictureBox1.Height = Conversions.ToInteger(224 * PictureBox1.Image.Height / (double)PictureBox1.Image.Width);
                    }
                }

                Text = "Image Catalog - " + LeggiSoloNomeFile(IlNome);
            }
        }

        private void setPicSettings(string SourcePath, string DestPath)
        {
            var SourceDir = new DirectoryInfo(SourcePath);
            var DestDirStart = new DirectoryInfo(DestPath);
            DirectoryInfo DestDir = null;
            PicSettings.DirectorySorgente = TextBox1.Text;
            PicSettings.DirectoryDestinazione = TextBox2.Text;

            // PicSettings.DestDir = DestDir
            // PicSettings.SourceDir = SourceDir
            // PicSettings.DestDirStart = DestDirStart

            PicSettings.DimStandard = Conversions.ToInteger(TextBox11.Text);
            PicSettings.DimStandardMiniatura = Conversions.ToInteger(TextBox25.Text);
            PicSettings.UsaOrarioMiniatura = CheckBox12.Checked;
            PicSettings.UsaOrarioTestoApplicare = CheckBox8.Checked;
            PicSettings.UsaTempoGaraTestoApplicare = CheckBox7.Checked;
            PicSettings.UsaRotazioneAutomatica = CheckBox10.Checked;
            PicSettings.UsaForzaJpg = CheckBox9.Checked;
            if (CheckBox17.Checked)
            {
                PicSettings.TestoNome = true;
            }
            else
            {
                PicSettings.TestoNome = false;
            }

            if (CheckBox16.Checked)
            {
                PicSettings.NomeData = true;
            }
            else
            {
                PicSettings.NomeData = false;
            }

            PicSettings.TestoFirmaStart = TextBox4.Text;
            PicSettings.TestoFirmaStartV = TextBox29.Text;
            PicSettings.DataPartenza = DateTimePicker1.Value;
            PicSettings.TestoOrario = TextBox18.Text;
            PicSettings.AltezzaSmall = Conversions.ToInteger(TextBox5.Text);
            PicSettings.LarghezzaSmall = Conversions.ToInteger(TextBox5.Text);
            PicSettings.CreaMiniature = CheckBox1.Checked;
            PicSettings.AggiungiScritteMiniature = RadioButton3.Checked;
            PicSettings.AggTempoGaraMin = RadioButton5.Checked;
            PicSettings.AggNumTempMin = RadioButton7.Checked;
            PicSettings.DimVert = Conversions.ToInteger(TextBox30.Text);
            PicSettings.MargVert = Conversions.ToInteger(TextBox31.Text);

            // PicSettings.NomeFileChild = childFile.Name
            PicSettings.Suffisso = TextBox3.Text;
            PicSettings.Codice = TextBox13.Text;
            PicSettings.Trasparenza = Conversions.ToInteger(TextBox9.Text);
            PicSettings.IlFont = ComboBox3.SelectedItem.ToString();
            PicSettings.Grassetto = CheckBox3.Checked;
            PicSettings.Posizione = ComboBox1.SelectedItem.ToString();
            PicSettings.Allineamento = ComboBox2.SelectedItem.ToString();
            PicSettings.Margine = Conversions.ToInteger(TextBox12.Text);
            PicSettings.LogoAltezza = Conversions.ToInteger(TextBox14.Text);
            PicSettings.LogoLarghezza = Conversions.ToInteger(TextBox15.Text);
            PicSettings.fontColoreRGB = ColorTranslator.FromHtml(TextBox34.Text);
            PicSettings.LogoAggiungi = CheckBox5.Checked;
            PicSettings.LogoNomeFile = TextBox10.Text;
            PicSettings.LogoTrasparenza = TextBox19.Text;
            PicSettings.LogoMargine = TextBox16.Text;
            PicSettings.LogoPosizioneH = ComboBox4.Text;
            PicSettings.LogoPosizioneV = ComboBox5.Text;
            PicSettings.FotoGrandeDimOrigina = CheckBox15.Checked;
            PicSettings.AltezzaBig = Conversions.ToInteger(TextBox27.Text);
            PicSettings.LarghezzaBig = Conversions.ToInteger(TextBox28.Text);
            PicSettings.DimMin = Conversions.ToInteger(TextBox25.Text);
            PicSettings.TestoMin = RadioButton6.Checked;
            PicSettings.jpegQuality = Conversions.ToLong(TextBox32.Text);
            PicSettings.jpegQualityMin = Conversions.ToLong(TextBox33.Text);

            // PicSettings.mainForm = Me


        }

        private List<List<FileInfo>> makeFilesList(string SourcePath)
        {
            var SourceDir = new DirectoryInfo(SourcePath);
            DirectoryInfo DestDir = null;
            int NumFileXDir = Conversions.ToInteger(TextBox17.Text);
            string SuffixDir = TextBox20.Text;
            int NumCifreDir = Conversions.ToInteger(TextBox21.Text);
            bool DividiFile = false;
            StopAttivo = false;
            int FileConta = 0;
            int ContaFileXDir = 0;
            int ContaDirXDir = 0;
            string TestoTemp = "";
            int ContaTemp = 0;
            var picList = new List<FileInfo>();
            var dirList = new List<List<FileInfo>>();


            // controlla directory principale
            // Dim childFile As FileInfo
            // For Each childFile In SourceDir.GetFiles("*.jpg")
            // picList.Add(childFile)
            // Next

            picList = getFiles(SourceDir);
            dirList.Add(picList);

            // controlla sottodirectory
            if (CheckBox6.Checked == true)
            {
                foreach (var subDir in SourceDir.GetDirectories())
                {
                    var filesList = new List<FileInfo>();
                    filesList = getFiles(subDir);
                    dirList.Add(filesList);
                }
            }

            return dirList;
        }

        private List<FileInfo> getFiles(DirectoryInfo sourceDir)
        {
            var picList = new List<FileInfo>();
            foreach (var childFile in sourceDir.GetFiles("*.jpg"))
                picList.Add(childFile);
            return picList;
        }

        private List<List<FileInfo>> dividiLista(string SourcePath, List<List<FileInfo>> lista)
        {
            var SourceDir = new DirectoryInfo(SourcePath);
            int NumFileXDir = Conversions.ToInteger(TextBox17.Text);
            string SuffixDir = TextBox20.Text;
            int NumCifreDir = Conversions.ToInteger(TextBox21.Text);
            bool DividiFile = false;
            int FileConta = 0;
            int ContaFileXDir = 0;
            int ContaDirXDir = 0;
            string TestoTemp = "";
            int ContaTemp = 0;
            if (NumFileXDir > 0 & CheckBox11.Checked == true)
            {
                if (FileConta > NumFileXDir)
                {
                    DividiFile = true;
                }
                else
                {
                }
            }

            return default;
        }

        private void setLabel17Text(string text)
        {
            if (Label17.InvokeRequired)
            {
                Label17.Invoke(new Action<string>(setLabel17Text), text);
            }
            else
            {
                Label17.Text = text;
            }
        }

        public void stepProgressBar()
        {
            if (ProgressBar1.InvokeRequired)
            {
                ProgressBar1.Invoke(new MethodInvoker(ProgressBar1.PerformStep));
            }
            else
            {
                ProgressBar1.PerformStep();
            }

            setLabel18Text(ProgressBar1.Value.ToString());
        }

        private void setLabel10Text(string text)
        {
            if (Label10.InvokeRequired)
            {
                Label10.Invoke(new Action<string>(setLabel10Text), text);
            }
            else
            {
                Label10.Text = text;
            }
        }

        private void setProgressBarMaximum(int value)
        {
            if (ProgressBar1.InvokeRequired)
            {
                ProgressBar1.Invoke(new Action<int>(setProgressBarMaximum), (object)value);
            }
            else
            {
                ProgressBar1.Maximum = value;
            }
        }

        private void setProgressBarValue(int value)
        {
            if (ProgressBar1.InvokeRequired)
            {
                ProgressBar1.Invoke(new Action<int>(setProgressBarValue), (object)value);
            }
            else
            {
                ProgressBar1.Value = value;
            }
        }

        private void setLabel18Text(string text)
        {
            if (Label18.InvokeRequired)
            {
                Label18.Invoke(new Action<string>(setLabel18Text), text);
            }
            else
            {
                Label18.Text = text;
            }
        }

        private void setLabel43Text(string text)
        {
            if (Label43.InvokeRequired)
            {
                Label43.Invoke(new Action<string>(setLabel43Text), text);
            }
            else
            {
                Label43.Text = text;
            }
        }

        private void creaImmaginiWithThreadMod(string SourcePath, string DestPath)
        {
            var SourceDir = new DirectoryInfo(SourcePath);
            var DestDirStart = new DirectoryInfo(DestPath);
            DirectoryInfo DestDir = null;
            int NumFileXDir = Conversions.ToInteger(TextBox17.Text);
            string SuffixDir = TextBox20.Text;
            int NumCifreDir = Conversions.ToInteger(TextBox21.Text);
            bool DividiFile = false;
            StopAttivo = false;
            int FileConta = 0;
            int ContaFileXDir = 0;
            int ContaDirXDir = 0;
            string TestoTemp = "";
            int ContaTemp = 0;
            if (SourceDir.Exists)
            {
                FileConta = SourceDir.GetFiles("*.jpg").GetLength(0);
                // Label17.Text = (CType(Label17.Text, Integer) + FileConta).ToString
                string a = (Conversions.ToInteger(Label17.Text) + FileConta).ToString();
                setLabel17Text(a);
                setProgressBarMaximum(Conversions.ToInteger(a));
                if (NumFileXDir > 0 & CheckBox11.Checked == true)
                {
                    if (FileConta > NumFileXDir)
                    {
                        DividiFile = true;
                    }
                    else
                    {
                        DestDir = DestDirStart;
                        if (!DestDir.Exists)
                        {
                            DestDir.Create();
                        }

                        DividiFile = false;
                    }
                }
                else
                {
                    DestDir = DestDirStart;
                    if (!DestDir.Exists)
                    {
                        DestDir.Create();
                    }

                    DividiFile = false;
                }

                foreach (var childFile in SourceDir.GetFiles("*.jpg"))
                {
                    if (StopAttivo == true)
                    {
                        break;
                    }

                    setLabel10Text("File: " + childFile.Name);
                    string b = (Conversions.ToInteger(Label18.Text) + 1).ToString();
                    // setLabel18Text(b)
                    // setProgressBarValue(CInt(b))
                    // Label10.Text = "File: " & childFile.Name
                    // Label18.Text = (CType(Label18.Text, Integer) + 1).ToString
                    // Application.DoEvents()

                    ContaFileXDir += 1;
                    if (DividiFile == true)
                    {
                        if (ContaFileXDir == ContaDirXDir * NumFileXDir + 1)
                        {
                            ContaDirXDir += 1;
                            if (RadioButton1.Checked == true)
                            {
                                TestoTemp = ContaDirXDir.ToString();
                            }
                            else
                            {
                                TestoTemp = (ContaDirXDir * NumFileXDir).ToString();
                            }

                            var loopTo = NumCifreDir - TestoTemp.Length;
                            for (ContaTemp = 1; ContaTemp <= loopTo; ContaTemp++)
                                TestoTemp = "0" + TestoTemp;
                            if (DestDirStart.FullName.EndsWith(@"\"))
                            {
                                DestDir = new DirectoryInfo(DestDirStart.FullName + SuffixDir + TestoTemp);
                            }
                            else
                            {
                                DestDir = new DirectoryInfo(DestDirStart.FullName + @"\" + SuffixDir + TestoTemp);
                            }

                            if (!DestDir.Exists)
                            {
                                DestDir.Create();
                            }
                        }
                    }

                    // Application.DoEvents()



                    var ClsCreaImmagine = new ImageCreator();
                    ClsCreaImmagine.NomeFileChild = childFile.Name;
                    ClsCreaImmagine.DestDir = DestDir;
                    ClsCreaImmagine.SourceDir = SourceDir;
                    ClsCreaImmagine.DestDirStart = DestDirStart;
                    ContaImmaginiThread += 1;
                    MyPool.InsertWorkItem(childFile.Name, new XyThreadAdd(ClsCreaImmagine.CreaImmagineThread), new object[1] { childFile.Name }, true);
                }
                // copy all the sub-directories by recursively calling this same routine
                if (CheckBox6.Checked == true)
                {
                    foreach (var subDir in SourceDir.GetDirectories())
                        creaImmaginiWithThreadMod(subDir.FullName, Path.Combine(DestDir.FullName, subDir.Name));
                }
            }
        }

        // il posto giusto dove fare modifiche
        private void CreaImmaginiWithThread(string SourcePath, string DestPath)
        {
            var SourceDir = new DirectoryInfo(SourcePath);
            var DestDirStart = new DirectoryInfo(DestPath);
            DirectoryInfo DestDir = null;
            int NumFileXDir = Conversions.ToInteger(TextBox17.Text);
            string SuffixDir = TextBox20.Text;
            int NumCifreDir = Conversions.ToInteger(TextBox21.Text);
            bool DividiFile = false;
            StopAttivo = false;
            int FileConta = 0;
            int ContaFileXDir = 0;
            int ContaDirXDir = 0;
            string TestoTemp = "";
            int ContaTemp = 0;
            if (SourceDir.Exists)
            {
                FileConta = SourceDir.GetFiles("*.jpg").GetLength(0);
                Label17.Text = (Conversions.ToInteger(Label17.Text) + FileConta).ToString();
                if (NumFileXDir > 0 & CheckBox11.Checked == true)
                {
                    if (FileConta > NumFileXDir)
                    {
                        DividiFile = true;
                    }
                    else
                    {
                        DestDir = DestDirStart;
                        if (!DestDir.Exists)
                        {
                            DestDir.Create();
                        }

                        DividiFile = false;
                    }
                }
                else
                {
                    DestDir = DestDirStart;
                    if (!DestDir.Exists)
                    {
                        DestDir.Create();
                    }

                    DividiFile = false;
                }

                foreach (var childFile in SourceDir.GetFiles("*.jpg"))
                {
                    if (StopAttivo == true)
                    {
                        break;
                    }
                    // Label10.Text = "File: " & childFile.Name
                    // Label18.Text = (CType(Label18.Text, Integer) + 1).ToString
                    // Application.DoEvents()

                    ContaFileXDir += 1;
                    if (DividiFile == true)
                    {
                        if (ContaFileXDir == ContaDirXDir * NumFileXDir + 1)
                        {
                            ContaDirXDir += 1;
                            if (RadioButton1.Checked == true)
                            {
                                TestoTemp = ContaDirXDir.ToString();
                            }
                            else
                            {
                                TestoTemp = (ContaDirXDir * NumFileXDir).ToString();
                            }

                            var loopTo = NumCifreDir - TestoTemp.Length;
                            for (ContaTemp = 1; ContaTemp <= loopTo; ContaTemp++)
                                TestoTemp = "0" + TestoTemp;
                            if (DestDirStart.FullName.EndsWith(@"\"))
                            {
                                DestDir = new DirectoryInfo(DestDirStart.FullName + SuffixDir + TestoTemp);
                            }
                            else
                            {
                                DestDir = new DirectoryInfo(DestDirStart.FullName + @"\" + SuffixDir + TestoTemp);
                            }

                            if (!DestDir.Exists)
                            {
                                DestDir.Create();
                            }
                        }
                    }

                    Application.DoEvents();
                    var ClsCreaImmagine = new CreaImmagineSeparateThread();
                    ClsCreaImmagine.DirectorySorgente = TextBox1.Text;
                    ClsCreaImmagine.DirectoryDestinazione = TextBox2.Text;
                    ClsCreaImmagine.DestDir = DestDir;
                    ClsCreaImmagine.SourceDir = SourceDir;
                    ClsCreaImmagine.DestDirStart = DestDirStart;
                    ClsCreaImmagine.DimStandard = Conversions.ToInteger(TextBox11.Text);
                    ClsCreaImmagine.DimStandardMiniatura = Conversions.ToInteger(TextBox25.Text);
                    ClsCreaImmagine.UsaOrarioMiniatura = CheckBox12.Checked;
                    ClsCreaImmagine.UsaOrarioTestoApplicare = CheckBox8.Checked;
                    ClsCreaImmagine.UsaTempoGaraTestoApplicare = CheckBox7.Checked;
                    ClsCreaImmagine.UsaRotazioneAutomatica = CheckBox10.Checked;
                    ClsCreaImmagine.UsaForzaJpg = CheckBox9.Checked;
                    if (CheckBox17.Checked)
                    {
                        ClsCreaImmagine.TestoNome = true;
                    }
                    else
                    {
                        ClsCreaImmagine.TestoNome = false;
                    }

                    if (CheckBox16.Checked)
                    {
                        ClsCreaImmagine.NomeData = true;
                    }
                    else
                    {
                        ClsCreaImmagine.NomeData = false;
                    }

                    ClsCreaImmagine.TestoFirmaStart = TextBox4.Text;
                    ClsCreaImmagine.TestoFirmaStartV = TextBox29.Text;
                    ClsCreaImmagine.DataPartenza = DateTimePicker1.Value;
                    ClsCreaImmagine.TestoOrario = TextBox18.Text;
                    ClsCreaImmagine.AltezzaSmall = Conversions.ToInteger(TextBox5.Text);
                    ClsCreaImmagine.LarghezzaSmall = Conversions.ToInteger(TextBox5.Text);
                    ClsCreaImmagine.CreaMiniature = CheckBox1.Checked;
                    ClsCreaImmagine.AggiungiScritteMiniature = RadioButton3.Checked;
                    ClsCreaImmagine.AggTempoGaraMin = RadioButton5.Checked;
                    ClsCreaImmagine.AggNumTempMin = RadioButton7.Checked;
                    ClsCreaImmagine.DimVert = Conversions.ToInteger(TextBox30.Text);
                    ClsCreaImmagine.MargVert = Conversions.ToInteger(TextBox31.Text);
                    ClsCreaImmagine.NomeFileChild = childFile.Name;
                    ClsCreaImmagine.Suffisso = TextBox3.Text;
                    ClsCreaImmagine.Codice = TextBox13.Text;
                    ClsCreaImmagine.Trasparenza = Conversions.ToInteger(TextBox9.Text);
                    ClsCreaImmagine.IlFont = ComboBox3.SelectedItem.ToString();
                    ClsCreaImmagine.Grassetto = CheckBox3.Checked;
                    ClsCreaImmagine.Posizione = ComboBox1.SelectedItem.ToString();
                    ClsCreaImmagine.Allineamento = ComboBox2.SelectedItem.ToString();
                    ClsCreaImmagine.Margine = Conversions.ToInteger(TextBox12.Text);
                    ClsCreaImmagine.LogoAltezza = Conversions.ToInteger(TextBox14.Text);
                    ClsCreaImmagine.LogoLarghezza = Conversions.ToInteger(TextBox15.Text);

                    // ClsCreaImmagine.FontColoreR = CType(TextBox22.Text, Integer)
                    // ClsCreaImmagine.FontColoreG = CType(TextBox23.Text, Integer)
                    // ClsCreaImmagine.FontColoreB = CType(TextBox24.Text, Integer)
                    ClsCreaImmagine.fontColoreRGB = ColorTranslator.FromHtml(TextBox34.Text);
                    ClsCreaImmagine.LogoAggiungi = CheckBox5.Checked;
                    ClsCreaImmagine.LogoNomeFile = TextBox10.Text;
                    ClsCreaImmagine.LogoTrasparenza = TextBox19.Text;
                    ClsCreaImmagine.LogoMargine = TextBox16.Text;
                    ClsCreaImmagine.LogoPosizioneH = ComboBox4.Text;
                    ClsCreaImmagine.LogoPosizioneV = ComboBox5.Text;
                    ClsCreaImmagine.FotoGrandeDimOrigina = CheckBox15.Checked;
                    ClsCreaImmagine.AltezzaBig = Conversions.ToInteger(TextBox27.Text);
                    ClsCreaImmagine.LarghezzaBig = Conversions.ToInteger(TextBox28.Text);
                    ClsCreaImmagine.DimMin = Conversions.ToInteger(TextBox25.Text);
                    ClsCreaImmagine.TestoMin = RadioButton6.Checked;
                    ClsCreaImmagine.jpegQuality = Conversions.ToLong(TextBox32.Text);
                    ClsCreaImmagine.jpegQuality = Conversions.ToLong(TextBox33.Text);
                    ContaImmaginiThread += 1;
                    MyPool.InsertWorkItem(childFile.Name, new XyThreadAdd(ClsCreaImmagine.CreaImmagineThread), new object[1] { childFile.Name }, true);
                }
                // copy all the sub-directories by recursively calling this same routine
                if (CheckBox6.Checked == true)
                {
                    foreach (var subDir in SourceDir.GetDirectories())
                        CreaImmaginiWithThread(subDir.FullName, Path.Combine(DestDir.FullName, subDir.Name));
                }
            }
        }

        private void CopyDirectoryFile(string SourcePath, string DestPath, bool OverWrite = false)
        {
            var SourceDir = new DirectoryInfo(SourcePath);
            var DestDir = new DirectoryInfo(DestPath);
            if (SourceDir.Exists)
            {
                if (!DestDir.Exists)
                {
                    DestDir.Create();
                    // copy all the files of the current directory
                }

                foreach (var childFile in SourceDir.GetFiles())
                {
                    if (OverWrite)
                    {
                        childFile.CopyTo(Path.Combine(DestDir.FullName, childFile.Name), true);
                    }
                    // if overwrite = false, copy the file only if it does not exist
                    // this is done to avoid an IOException if a file already exists
                    // this way the other files can be copied anyway...
                    else if (!File.Exists(Path.Combine(DestDir.FullName, childFile.Name)))
                    {
                        childFile.CopyTo(Path.Combine(DestDir.FullName, childFile.Name), false);
                    }
                    // copy all the sub-directories by recursively calling this same routine
                }

                foreach (var subDir in SourceDir.GetDirectories())
                    CopyDirectoryFile(subDir.FullName, Path.Combine(DestDir.FullName, subDir.Name), OverWrite);
            }
        }

        public Size NewthumbSize(int currentwidth, int currentheight, int MaxPixel, string TipoSize)
        {
            // Calculate the Size of the New image  
            // *** Larghezza, Altezza, Auto

            double tempMultiplier;
            if ((TipoSize.ToUpper() ?? "") == ("Larghezza".ToUpper() ?? ""))
            {
                tempMultiplier = MaxPixel / (double)currentwidth;
            }
            else if ((TipoSize.ToUpper() ?? "") == ("Altezza".ToUpper() ?? ""))
            {
                tempMultiplier = MaxPixel / (double)currentheight;
            }
            else if (currentheight > currentwidth) // portrait  
            {
                tempMultiplier = MaxPixel / (double)currentheight;
            }
            else
            {
                tempMultiplier = MaxPixel / (double)currentwidth;
            }

            var NewSize = new Size((int)Math.Round(currentwidth * tempMultiplier), (int)Math.Round(currentheight * tempMultiplier));
            return NewSize;
        }

        private void Button7_Click(object sender, EventArgs e)
        {
            StopAttivo = true;
            MyPool.StopThreadPool();
            unlockUI();
        }

        private void Button4_Click(object sender, EventArgs e)
        {
            var openFileDialog = new OpenFileDialog();

            // openFileDialog.InitialDirectory = TextBox1.Text
            openFileDialog.Filter = "Immagini jpg (*.jpg)|*.jpg|Immagini gif (*.gif)|*.gif|Tutti i file (*.*)|*.*";
            if (TextBox10.Text.Length > 0)
            {
                openFileDialog.FileName = TextBox10.Text;
            }

            openFileDialog.FilterIndex = 0;
            openFileDialog.RestoreDirectory = true;
            if (DialogResult.OK == openFileDialog.ShowDialog())
            {
                TextBox10.Text = openFileDialog.FileName;
                PictureBox1.Image = Image.FromFile(TextBox10.Text);
                if (PictureBox1.Image.Height >= PictureBox1.Image.Width)
                {
                    PictureBox1.Height = 160;
                    PictureBox1.Width = Conversions.ToInteger(160 * PictureBox1.Image.Width / (double)PictureBox1.Image.Height);
                }
                else
                {
                    PictureBox1.Width = 224;
                    PictureBox1.Height = Conversions.ToInteger(224 * PictureBox1.Image.Height / (double)PictureBox1.Image.Width);
                }
            }
        }

        private string LeggiSoloNomeFile(string FileName)
        {
            string Testo = FileName;
            string Risposta = "";
            var Nomi = Testo.Split(new char[] { '\\' });
            if (Nomi.Length > 1)
            {
                Risposta = Nomi[Nomi.Length - 1];
            }

            return Risposta;
        }

        private void PictureBox1_MouseMove(object sender, MouseEventArgs e)
        {
            // GetColor()
            // GetPixelColor(PictureBox1.PointToScreen(e.Location)).ToArgb.ToString("X8")

        }

        private void PictureBox1_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                WaterSelectColor = true;
            }
            else
            {
                WaterSelectColor = false;
            }
        }


        // Private Declare Function CreateDC Lib "gdi32.dll" (ByVal strDriver As String, ByVal strDevice As String, ByVal strOutput As String, ByVal pData As IntPtr) As IntPtr
        // Private Declare Function DeleteDC Lib "gdi32.dll" (ByVal hdc As IntPtr) As Boolean
        // Private Declare Function GetPixel Lib "gdi32.dll" (ByVal hdc As IntPtr, ByVal x As Integer, ByVal y As Integer) As Integer
        // Private Declare Function GetCursorPos Lib "user32.dll" (ByRef lpPoint As Point) As Boolean


        // ''' <summary>
        // ''' Get the color relative to mouse position
        // ''' </summary>
        // Private Sub GetColor()
        // Dim hdcScreen As IntPtr = CreateDC("Display", Nothing, Nothing, IntPtr.Zero)
        // Dim pt As Point = New Point
        // GetCursorPos(pt)
        // Dim cr As Integer = GetPixel(hdcScreen, pt.X, pt.Y)
        // DeleteDC(hdcScreen)
        // Dim clr As Color = Color.FromArgb((cr And &HFF), (cr And &HFF00) >> 8, (cr And &HFF0000) >> 16)
        // PictureBox3.BackColor = clr
        // If WaterSelectColor = True Then
        // PictureBox2.BackColor = clr
        // End If
        // WaterSelectColor = False
        // End Sub


        private Color[] GetPixelColor(Point screenLocation)
        {
            // Dim bm As New Bitmap(1, 1, Imaging.PixelFormat.Format24bppRgb)
            // Dim g As Graphics = Graphics.FromImage(bm)
            // g.CopyFromScreen(screenLocation, New Point(0, 0), New Size(1, 1))
            // Dim result As Color = bm.GetPixel(0, 0)
            // g.Dispose()
            // bm.Dispose()
            // Return result
            return null;
        }

        private void Button8_Click(object sender, EventArgs e)
        {
            var MyDialog = new ColorDialog();
            MyDialog.AllowFullOpen = true;
            // If TextBox22.Text.Length > 0 And TextBox23.Text.Length > 0 And TextBox24.Text.Length > 0 Then
            // If CType(TextBox22.Text, Integer) >= 0 And CType(TextBox23.Text, Integer) >= 0 And CType(TextBox24.Text, Integer) >= 0 Then
            // MyDialog.Color = Color.FromArgb(0, CType(TextBox22.Text, Integer), CType(TextBox23.Text, Integer), CType(TextBox24.Text, Integer))
            // End If
            // End If

            if (MyDialog.ShowDialog() == DialogResult.OK)
            {
                // TextBox22.Text = MyDialog.Color.R.ToString
                // TextBox23.Text = MyDialog.Color.G.ToString
                // TextBox24.Text = MyDialog.Color.B.ToString
                TextBox34.Text = ColorTranslator.ToHtml(MyDialog.Color);
                TextBox34.BackColor = MyDialog.Color;
            }
        }

        private void TextBox27_TextChanged(object sender, EventArgs e)
        {
        }

        private void CheckBox18_CheckedChanged(object sender, EventArgs e)
        {
            CheckBox4.Checked = false;
            CheckBox12.Checked = false;
        }

        private void CheckBox4_CheckedChanged(object sender, EventArgs e)
        {
            CheckBox18.Checked = false;
        }

        private void CheckBox12_CheckedChanged(object sender, EventArgs e)
        {
            CheckBox18.Checked = false;
        }
    }

    public class PicInfoold
    {
        public DirectoryInfo DirSource, DirDest, DirDestStart;
        public string NomeImmagine;

        public PicInfoold(DirectoryInfo Dir_Source, DirectoryInfo Dir_Dest, DirectoryInfo Dir_DestStart, string Nome_Immagine)
        {
            DirSource = Dir_Source;
            DirDest = Dir_Dest;
            DirDestStart = Dir_DestStart;
            NomeImmagine = Nome_Immagine;
        }
    }
}