ScreenToGif.Modern.con_titleImage_Click C# (CSharp) Method

con_titleImage_Click() private method

private con_titleImage_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void con_titleImage_Click(object sender, EventArgs e)
        {
            Size titleFrameSize = _listFramesEdit[trackBar.Value].From().Size;
            var titleBitmap = new Bitmap(titleFrameSize.Width, titleFrameSize.Height);
            var title = new TitleFrame(titleBitmap);

            if (title.ShowDialog() == DialogResult.OK)
            {
                #region If Ok

                ResetUndoProp();

                using (Graphics grp = Graphics.FromImage(titleBitmap))
                {
                    #region Create Title Image

                    if (title.Blured)
                    {
                        #region Blured

                        this.Cursor = Cursors.WaitCursor;
                        Bitmap blured;

                        if (_listFramesEdit.Count > (trackBar.Value - 1))
                        {
                            blured = _listFramesEdit[trackBar.Value + 1].From();
                        }
                        else
                        {
                            blured = _listFramesEdit[0].From(); //If the users wants to place the Title Frame in the end, the logical next frame will be the first.
                        }

                        blured = ImageUtil.Blur(blured, new Rectangle(0, 0, pictureBitmap.Image.Width, pictureBitmap.Image.Height), 3);

                        Image bluredI = blured;
                        grp.DrawImage(bluredI, 0, 0);
                        this.Cursor = Cursors.Default;

                        blured.Dispose();
                        bluredI.Dispose();

                        #endregion
                    }
                    else
                    {
                        grp.FillRectangle(new SolidBrush(title.ColorBackground), 0, 0, titleBitmap.Width, titleBitmap.Height);
                    }

                    var strFormat = new StringFormat();
                    strFormat.Alignment = StringAlignment.Center;
                    strFormat.LineAlignment = StringAlignment.Center;

                    grp.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
                    grp.DrawString(title.Content, title.FontTitle, new SolidBrush(title.ColorForeground),
                        new RectangleF(0, 0, titleBitmap.Width, titleBitmap.Height), strFormat);

                    string fileName = _listFramesEdit[trackBar.Value].Replace(".bmp", "T.bmp");
                    titleBitmap.Save(fileName);
                    _listFramesEdit.Insert(trackBar.Value, fileName);

                    _listDelayEdit.Insert(trackBar.Value, 1000); //Inserts 1s delay.

                    trackBar.Maximum = _listFramesEdit.Count - 1;
                    pictureBitmap.Image = _listFramesEdit[trackBar.Value].From();
                    this.Text = Resources.Title_EditorFrame + trackBar.Value + " - " + (_listFramesEdit.Count - 1);

                    tvFrames.Add(1);
                    DelayUpdate();
                    GC.Collect();

                    #endregion
                }

                #endregion
            }
        }
Modern