Beispiel #1
0
        private void button_Open_Click(object sender, EventArgs e)
        {
            openFileDialog1.Multiselect      = false;
            openFileDialog1.Title            = "Select a Image file";
            openFileDialog1.Filter           = "Image files (*.tif;*.pdf)|*.tif;*.pdf";
            openFileDialog1.InitialDirectory = "c:\\";
            openFileDialog1.FileName         = "";

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                string fileName = openFileDialog1.FileName.ToLower();

                if (fileName.EndsWith(".pdf"))
                {
                    fileName = PdfToImage.Convert(fileName);
                }

                // save previous session
                if (imageLoaded == true)
                {
                    annotations.Write(imagePath + ".xml");
                }

                annotations.Clear();

                OpenImage(fileName);

                imagePath = openFileDialog1.FileName;

                annotations.Read(imagePath + ".xml");

                ButtonStates.SetStateAll(toolStrip1);
                imageLoaded = true;

                this.Text = "Drawing Dimension Tool - " + fileName;

                SetScrollBarValues();
            }
        }
Beispiel #2
0
 private void button_CalibrateNo_Click(object sender, EventArgs e)
 {
     ButtonStates.RestoreState(toolStrip1);//, sender);
 }