예제 #1
0
        private void SingleTextureDirectives_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                DrawablesGenerator generator = new DrawablesGenerator(imagePath);

                bool fade = chkFade.IsChecked.Value;

                generator = DrawableUtilities.SetUpGenerator(generator, tbxHandX.Text, tbxHandY.Text, tbxIgnoreColor.Text);
                generator.ReplaceBlank = !fade;
                generator.ReplaceWhite = true;

                DrawablesOutput output = generator.Generate();

                int j = 64;
                int.TryParse(tbxSourceImageSize.Text, out j);
                (new OutputWindow("Single Texture Directives:", DrawableUtilities.GenerateSingleTextureDirectives(output, j, fade), false)).Show();
            }
            catch (FormatException)
            {
                MessageBox.Show("Invalid format. Did you provide a correct ignore color code? (hexadecimal RRGGBB or RRGGBBAA)");
            }
            catch (ArgumentNullException)
            {
                MessageBox.Show("Argument may not be null. Did you select a valid image?");
            }
            catch (DrawableException exc)
            {
                MessageBox.Show(exc.Message);
                return;
            }
        }