예제 #1
0
        // Handles the save dialogue for saving the cards.
        private void SaveCardImage()
        {
            if (currentCard.Length > 0)
            {
                ImageFormat format = ImageFormat.Png;
                if (saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    string extension = System.IO.Path.GetExtension(saveFileDialog.FileName);
                    switch (extension)
                    {
                    case ".png":
                        format = ImageFormat.Png;
                        break;

                    default:
                        format = ImageFormat.Png;
                        break;
                    }
                    if (currentCard.Equals(saveFileDialog.FileName))
                    {
                        MessageBox.Show("Cannot override current file.", "Warning!");
                        return;
                    }
                    else
                    {
                        CardIO.WriteCard(pictureBox_card.Image, GetStatLabels()).Save(saveFileDialog.FileName, format);
                    }
                }
            }
            else
            {
                MessageBox.Show("No image loaded.", "Warning!");
                return;
            }
        }
예제 #2
0
        // Begins the mass-file writing.
        // Checks if the path is empty. If not, we'll set the extension and format. Then we'll call CardIO to do the heavy lifting.
        private void button_OK_Click(object sender, EventArgs e)
        {
            if (!EmptyPath())
            {
                string ext = "png";
                System.Drawing.Imaging.ImageFormat format = System.Drawing.Imaging.ImageFormat.Png;
                switch (comboBox_format.SelectedIndex)
                {
                case 0:
                    ext    = "png";
                    format = System.Drawing.Imaging.ImageFormat.Png;
                    break;

                case 1:
                    ext    = "jpg";
                    format = System.Drawing.Imaging.ImageFormat.Jpeg;
                    break;

                case 2:
                    ext    = "bmp";
                    format = System.Drawing.Imaging.ImageFormat.Bmp;
                    break;

                default:
                    break;
                }


                CardIO.MultiWriteFiles(textBox_stats_file.Text, textBox_source_folder.Text, textBox_destination_folder.Text, textBox_counting.Text, ext, mainForm.GetStatLabels(), format);
            }
            else
            {
                MessageBox.Show(Program.language.GetValue(LanguageFileConsts.KEY_WARN_STATS_PATH_EMPTY), Program.language.GetValue(LanguageFileConsts.KEY_LABEL_WARNING));
            }
        }