Exemplo n.º 1
0
        internal void AddText()
        {
            if (m_frmMain.rbDoSingle.Checked)
            {
                bmpOutput = m_Controller.AddText(new Rectangle(
                                                     Convert.ToInt32(m_frmMain.txtOtherUL.Text),
                                                     Convert.ToInt32(m_frmMain.txtOtherUR.Text),
                                                     Convert.ToInt32(m_frmMain.txtOtherLL.Text),
                                                     Convert.ToInt32(m_frmMain.txtOtherLR.Text)
                                                     ), "Hello new caption!", new Font(new FontFamily("Courier New"), 12),
                                                 Brushes.Black);
            }
            else if (m_frmMain.rbAddToAuto.Checked)
            {
                List <object> ArgList = new List <object>();
                ArgList.Add(new Rectangle(
                                Convert.ToInt32(m_frmMain.txtOtherUL.Text),
                                Convert.ToInt32(m_frmMain.txtOtherUR.Text),
                                Convert.ToInt32(m_frmMain.txtOtherLL.Text),
                                Convert.ToInt32(m_frmMain.txtOtherLR.Text)
                                ));
                ArgList.Add((string)"Hello new caption!");
                ArgList.Add(new Font(new FontFamily("Courier New"), 12));
                ArgList.Add((int)12);

                m_Controller.Automation_AddOperation(Constants.Operations.AddText, ArgList);
            }
            else if (m_frmMain.rbBatch.Checked)
            {
                List <object> ArgList = new List <object>();
                ArgList.Add(new Rectangle(
                                Convert.ToInt32(m_frmMain.txtOtherUL.Text),
                                Convert.ToInt32(m_frmMain.txtOtherUR.Text),
                                Convert.ToInt32(m_frmMain.txtOtherLL.Text),
                                Convert.ToInt32(m_frmMain.txtOtherLR.Text)
                                ));
                ArgList.Add((string)"Hello new caption!");
                ArgList.Add(new Font(new FontFamily("Courier New"), 12));
                ArgList.Add((int)12);
                bmpOutput = m_Controller.BatchOp(Constants.Operations.AddText, ArgList);
            }
        }
Exemplo n.º 2
0
        internal void AddText()
        {
            if (!m_bAutoMode)
            {
                //Generate Font
                FontStyle fsPreview = new FontStyle();

                if (BoldForAddText)
                {
                    fsPreview = FontStyle.Bold;
                }
                if (ItalicForAddText)
                {
                    fsPreview = FontStyle.Italic;
                }
                if (UnderlineForAddText)
                {
                    fsPreview = FontStyle.Underline;
                }
                if (StrikethroughForAddText)
                {
                    fsPreview = FontStyle.Strikeout;
                }

                Font fntPreview = new Font(FontNameForAddText, FontSizeForAddText, fsPreview);

                bmpOutput = m_Controller.AddText(m_frmMain.mpbMain.CropBounds, TextForAddText, fntPreview,
                                                 new SolidBrush(Color.FromName(FontColorForAddText)));

                m_frmMain.tlImageHistory.AddElement(new Bitmap(1, 1), "Add Text");
            }
            else if (m_bAutoMode)
            {
                //Generate Font
                FontStyle fsPreview = new FontStyle();

                if (BoldForAddText)
                {
                    fsPreview = FontStyle.Bold;
                }
                if (ItalicForAddText)
                {
                    fsPreview = FontStyle.Italic;
                }
                if (UnderlineForAddText)
                {
                    fsPreview = FontStyle.Underline;
                }
                if (StrikethroughForAddText)
                {
                    fsPreview = FontStyle.Strikeout;
                }

                Font fntPreview = new Font(FontNameForAddText, FontSizeForAddText, fsPreview);

                List <object> ArgList = new List <object>();
                ArgList.Add(m_frmMain.mpbMain.CropBounds);
                ArgList.Add(TextForAddText);
                ArgList.Add(fntPreview);
                ArgList.Add(new SolidBrush(Color.FromName(FontColorForAddText)));

                m_Controller.Automation_AddOperation(Constants.Operations.AddText, ArgList);

                m_frmMain.tlAutomationActions.AddElement(new Bitmap(1, 1), "Add Text");
            }

            //Hide our selection rectangle now that we've added our text
            m_frmMain.mpbMain.HideSelectionRectangle();
        }