private void btnConvertToTiff_Click(object sender, EventArgs e)
        {
            dlgOpenFileDialog.Multiselect = true;
            dlgOpenFileDialog.Filter      = "Image files (.jpg, .jpeg)|*.jpg;*.jpeg";

            if (dlgOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    TiffImageConverter.ConvertJpegToTiff(dlgOpenFileDialog.FileNames, chkIsMultipage.Checked);
                    MessageBox.Show("Image conversion completed.");
                }
                catch (Exception ex)
                {
                    MessageBox.Show("An error occurred: " + ex.Message, "Error");
                }
            }
        }
        private void btnConvertToJpeg_Click(object sender, EventArgs e)
        {
            dlgOpenFileDialog.Multiselect = false;
            dlgOpenFileDialog.Filter      = "Image files (.tif, .tiff)|*.tif;*.tiff";

            if (dlgOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    TiffImageConverter.ConvertTiffToJpeg(dlgOpenFileDialog.FileName);
                    MessageBox.Show("Image conversion completed.");
                }
                catch (Exception ex)
                {
                    MessageBox.Show("An error occurred: " + ex.Message, "Error");
                }
            }
        }
Example #3
0
        private void btnConvertToJpeg_Click(object sender, EventArgs e)
        {
            dlgOpenFileDialog.Multiselect = false;
            dlgOpenFileDialog.Filter      = "Image files (.tif, .tiff)|*.tif;*.tiff";

            if (dlgOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    TiffImageConverter.ConvertTiffToJpeg(dlgOpenFileDialog.FileName);
                    MessageBox.Show("图像转换完成.");
                }
                catch (Exception ex)
                {
                    MessageBox.Show("出现错误: " + ex.Message, "错误");
                }
            }
        }