private void OnGenerateClick(object sender, RoutedEventArgs e) { Pixelart pixelart; BlockOrientation orientation = BlockOrientation.TOP; if (topRadio.IsChecked.Value) { orientation = BlockOrientation.TOP; } if (bottomRadio.IsChecked.Value) { orientation = BlockOrientation.BOTTOM; } if (vertRadio.IsChecked.Value) { orientation = BlockOrientation.VERTICAL; } int width = 0, height = 0; if (int.TryParse(WidthTextBox.Text, out width) && int.TryParse(HeightTextBox.Text, out height)) { pixelart = new Pixelart(data, width, height, image, DitherCheckBox.IsChecked.Value, orientation); } else { pixelart = new Pixelart(data, image, DitherCheckBox.IsChecked.Value, orientation); } Result resultWindow = new Result(pixelart, data, this); resultWindow.Show(); }
public Result(Pixelart result, Data data, MainWindow window) { InitializeComponent(); art = result; image = art.GetImage(); this.data = data; this.window = window; GenerationResult.Source = Util.BitmapToBitmapImage(image); AddMaterials(); }