Exemplo n.º 1
0
        private void renderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                //Initilize text render dialog
                TextRenderForm renderForm = new TextRenderForm();

                //Center the dialog
                renderForm.StartPosition = FormStartPosition.CenterParent;

                // Show testDialog as a modal dialog and determine if DialogResult = OK.
                if (renderForm.ShowDialog(this) == DialogResult.OK)
                {
                    //Get text input from user
                    String textInput = renderForm.Input;

                    //Render image from user input and display
                    System.Drawing.Bitmap image = Program.RenderImageFromText(textInput);
                    pictureBox1.Image = Program.ResizeBitmap(image, 976, 87);

                    //Display preview image
                    System.Drawing.Bitmap previewImage = Program.GetWheelPreviewImage(image, pictureBox2.Width, pictureBox2.Height);
                    pictureBox2.Image = previewImage;

                    //Add Log
                    AddLog("Render Sucessfully: " + textInput);

                    //Enable Save Menu
                    saveToolStripMenuItem.Enabled = true;

                    //Enable Draw Tools
                    toolStrip1.Enabled = true;

                    //Enable color picker button
                    toolStripColorPickerButton.Enabled = true;
                }
                renderForm.Dispose();
            }
            catch (Exception exeption)
            {
                MessageBox.Show(exeption.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //Add Log
                AddLog("Error: " + exeption.Message);
            }
        }
Exemplo n.º 2
0
        private void renderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                //Initilize text render dialog
                TextRenderForm renderForm = new TextRenderForm();

                //Center the dialog
                renderForm.StartPosition = FormStartPosition.CenterParent;

                // Show testDialog as a modal dialog and determine if DialogResult = OK.
                if (renderForm.ShowDialog(this) == DialogResult.OK)
                {
                    //Get text input from user
                    String textInput = renderForm.Input;

                    //Render image from user input and display
                    System.Drawing.Bitmap image = Program.RenderImageFromText(textInput);
                    pictureBox1.Image = Program.ResizeBitmap(image, 976, 87);

                    //Display preview image
                    System.Drawing.Bitmap previewImage = Program.GetWheelPreviewImage(image, pictureBox2.Width, pictureBox2.Height);
                    pictureBox2.Image = previewImage;

                    //Add Log
                    AddLog("Render Sucessfully: " + textInput);

                    //Enable Save Menu
                    saveToolStripMenuItem.Enabled = true;

                    //Enable Draw Tools
                    toolStrip1.Enabled = true;

                    //Enable color picker button
                    toolStripColorPickerButton.Enabled = true;
                }
                renderForm.Dispose();
            }
            catch (Exception exeption)
            {
                MessageBox.Show(exeption.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //Add Log
                AddLog("Error: " + exeption.Message);
            }
        }