Esempio n. 1
0
        /// <summary>
        /// Called by the owner to get the data
        /// </summary>
        public bool GetData(RasterCodecs rasterCodecsInstance)
        {
            if (!GetFontSize())
            {
                return(false);
            }

            CodecsTxtLoadOptions txtLoadOptions = rasterCodecsInstance.Options.Txt.Load;

            // Get the TXT load settings

            txtLoadOptions.Enabled         = _enabledCheckBox.Checked;
            txtLoadOptions.UseSystemLocale = _useSystenLocaleCheckBox.Checked;

            txtLoadOptions.FaceName = _fontNameComboBox.Text;
            txtLoadOptions.FontSize = _fontSize;

            txtLoadOptions.Bold          = _fontBoldCheckBox.Checked;
            txtLoadOptions.Italic        = _fontItalicCheckBox.Checked;
            txtLoadOptions.Underline     = _fontUnderlineCheckBox.Checked;
            txtLoadOptions.Strikethrough = _fontStrikethroughCheckBox.Checked;

            txtLoadOptions.FontColor = Converters.FromGdiPlusColor(_fontColorPanel.BackColor);
            txtLoadOptions.BackColor = Converters.FromGdiPlusColor(_backColorPanel.BackColor);
            txtLoadOptions.Highlight = Converters.FromGdiPlusColor(_highlightColorPanel.BackColor);

            return(true);
        }
Esempio n. 2
0
        /// <summary>
        /// Called by the owner to initialize
        /// </summary>
        public void SetData(RasterCodecs rasterCodecsInstance)
        {
            _fontSizeComboBox.PreviewKeyDown += new PreviewKeyDownEventHandler(_textBox_PreviewKeyDown);
            _fontSizeComboBox.LostFocus      += new EventHandler(_fontSizeComboBox_LostFocus);

            FontFamily[] fontFamilies = FontFamily.Families;

            foreach (FontFamily ff in fontFamilies)
            {
                _fontNameComboBox.Items.Add(ff.Name);
            }

            // Set the state of the controls

            CodecsTxtLoadOptions txtLoadOptions = rasterCodecsInstance.Options.Txt.Load;

            _enabledCheckBox.Checked         = txtLoadOptions.Enabled;
            _useSystenLocaleCheckBox.Checked = txtLoadOptions.UseSystemLocale;

            _fontSize = txtLoadOptions.FontSize;
            _fontNameComboBox.Text             = txtLoadOptions.FaceName;
            _fontSizeComboBox.Text             = _fontSize.ToString();
            _fontBoldCheckBox.Checked          = txtLoadOptions.Bold;
            _fontItalicCheckBox.Checked        = txtLoadOptions.Italic;
            _fontUnderlineCheckBox.Checked     = txtLoadOptions.Underline;
            _fontStrikethroughCheckBox.Checked = txtLoadOptions.Strikethrough;

            _fontColorPanel.BackColor      = Converters.ToGdiPlusColor(txtLoadOptions.FontColor);
            _backColorPanel.BackColor      = Converters.ToGdiPlusColor(txtLoadOptions.BackColor);
            _highlightColorPanel.BackColor = Converters.ToGdiPlusColor(txtLoadOptions.Highlight);
        }
Esempio n. 3
0
        private void IntializeAnnContainer()
        {
            SuspendLayout();

            imageViewer      = new RasterImageViewer();
            imageViewer.Dock = DockStyle.Fill;
            imageViewer.EnableScrollingInterface = true;
            this.imageViewer.KeyDown            += new System.Windows.Forms.KeyEventHandler(this.imageViewer_KeyDown);
            this.imageViewer.DoubleClick        += new System.EventHandler(this.imageViewer_Clicked);
            // this.imageViewer.MouseMove += new System.Windows.Forms.MouseEventHandler(this._viewer_MouseMove);

            this.Controls.Add(imageViewer);



            _automationManager    = new AnnAutomationManager();
            _annAutomation        = new AnnAutomation(_automationManager, this.imageViewer);
            _annAutomation.Active = true;
            this.imageViewer.BringToFront();

            //imageViewer.



            _codec = new RasterCodecs();
            CodecsTxtLoadOptions txtOption = _codec.Options.Txt.Load;

            txtOption.Enabled = true;

            _automationManager.RasterCodecs             = _codec;
            _automationManager.RedactionRealizePassword = "";
            _automationManager.CreateDefaultObjects();
            CustomizeObjectProperty();


            PropertyForm propForm = new PropertyForm();

            _automationManager.ObjectPropertiesDialogType = propForm.GetType();
            //   _automationManager.ObjectPropertiesDialogType = null;
            AddCheckMark(_automationManager);

            _automationManager.CreateToolBar();
            _automationManager.ToolBar.BringToFront();
            imageToolBar = new ImageToolBar();
            this.imageToolBar.TifEditor = this;
            toolBar      = imageToolBar.GetExtendedToolBar(_automationManager.ToolBar);
            toolBar.Dock = DockStyle.Bottom;

            this.Controls.Add(_automationManager.ToolBar);



            topToolBar = imageToolBar.AddCustomToolBar(topToolBar);


            imageToolBar.UpdateToolBar();
            ResumeLayout();

            RasterPaintProperties prop = imageViewer.PaintProperties;

            // prop.PaintDisplayMode |= RasterPaintDisplayModeFlags.ScaleToGray | RasterPaintDisplayModeFlags.Bicubic;
            prop.PaintDisplayMode       = RasterPaintDisplayModeFlags.ScaleToGray;
            imageViewer.PaintProperties = prop;



            InitialzeEdit();
        }