Exemplo n.º 1
0
 private void UI_Btn_UpdatePreview_Click(object sender, RoutedEventArgs e)
 {
     using (Bitmap bmp = new Bitmap(LoadedImg))
     {
         RegionFill.FillRegionList(getShapeType(), bmp, (int)UI_CustomSlider_X.Value + 1, (int)UI_CustomSlider_Y.Value + 1);
         bmp.Save(tempImgFile);
     }
     reloadImgFromTemp();
 }
Exemplo n.º 2
0
        private void UI_Btn_Compute_Click(object sender, RoutedEventArgs e)
        {
            string OutputFile = Path.Combine(UI_txtBox_Path.Text, UI_txtBox_FileName.Text);

            using (Bitmap bmp = new Bitmap(LoadedImg))
            {
                if (UI_RadioBtn_Svg.IsChecked == true)
                {
                    OutputExtention = ".svg";
                    OutputFile     += OutputExtention;
                    if (!UI_Btn_Compute_Click_ContinueOperations(OutputFile))
                    {
                        return;
                    }

                    BasicSVG svg = RegionFill.FillRegionList(getShapeType(), bmp, (int)UI_CustomSlider_X.Value + 1, (int)UI_CustomSlider_Y.Value + 1);
                    svg.endInit();
                    File.WriteAllText(OutputFile, svg.ToString());
                }
                else if (UI_RadioBtn_Image.IsChecked == true)
                {
                    OutputExtention = Path.GetExtension(InputFile);
                    OutputFile     += OutputExtention;
                    if (!UI_Btn_Compute_Click_ContinueOperations(OutputFile))
                    {
                        return;
                    }

                    RegionFill.FillRegionList(getShapeType(), bmp, (int)UI_CustomSlider_X.Value + 1, (int)UI_CustomSlider_Y.Value + 1);
                    bmp.Save(tempImgFile);
                    bmp.Save(OutputFile);
                }

                UI_Grid_OutputButtons.IsEnabled = true;
            }
        }