Ejemplo n.º 1
0
        private void convertDirectoryButton_Click(object sender, EventArgs e)
        {
            if (fisheyeFolderBrowserDialog.ShowDialog() == DialogResult.OK)
            {
                var files = Directory.GetFiles(fisheyeFolderBrowserDialog.SelectedPath, "*.jpg");
                if (files.Length > 0)
                {
                    var outdir = fisheyeFolderBrowserDialog.SelectedPath + "\\VR";
                    if (!Directory.Exists(outdir))
                    {
                        Directory.CreateDirectory(outdir);
                    }
                    count = 0;
                    foreach (var item in files)
                    {
                        var outfile = string.Format("{0}\\{1}", outdir, Path.GetFileName(item));
                        //Task.Run(() => {
                        FisheyeUtil.saveFisheye2equirectangular(item, Decimal.ToInt32(angleNumericUpDown.Value), outfile, mode360CheckBox.Checked);
                        count++;
                        convertCountToolStripStatusLabel.Text = string.Format("{0}/{1}", count, files.Length);
                        //});
                    }
                }

//                var str = files.Length > 0 ? files[0] : "";
//                convertCountToolStripStatusLabel.Text = string.Format("-/{0}:{1}", files.Length,str);
//                MessageBox.Show(fisheyeFolderBrowserDialog.SelectedPath);
            }
        }
Ejemplo n.º 2
0
        private void saveEquirectButton_Click(object sender, EventArgs e)
        {
            if (openFisheyeFileDialog.FileName.Length == 0 || !File.Exists(openFisheyeFileDialog.FileName))
            {
                MessageBox.Show("No File Selected !");
                return;
            }

            if (saveEquirectFileDialog.ShowDialog() == DialogResult.OK)
            {
                // TODO
                FisheyeUtil.saveFisheye2equirectangular(openFisheyeFileDialog.FileName, Decimal.ToInt32(angleNumericUpDown.Value), saveEquirectFileDialog.FileName, mode360CheckBox.Checked);
//                Fisheye2Equirectangular.saveFisheye2equirectangular(openFisheyeFileDialog.FileName, Decimal.ToInt32(angleNumericUpDown.Value), saveEquirectFileDialog.FileName, mode360CheckBox.Checked);
                equirectImg.ImageLocation = saveEquirectFileDialog.FileName;
            }
        }