Esempio n. 1
0
        public TextShape(ScreenshotEditor editor, Color color, int thickness, PointF p, ShapeSettingsPanel panel)
            : base(editor, color, thickness, panel)
        {
            setColorAndThickness();

            addHandle("start", p);
            p.X += 100;
            p.Y += TextHeight;
            addHandle("end", p);

            sp = panel as TextSettingsPanel;

            sp.SettingsChanged += sp_SettingsChanged;
        }
Esempio n. 2
0
        public TextShape(ScreenshotEditor editor, XPathNavigator element) : base(editor, element, createSettingsPanel())
        {
            sp = (TextSettingsPanel)settingsPanel;
            sp.SettingsChanged += sp_SettingsChanged;
            setColorAndThickness();
            sp.trckOutlineWidth.Value   = int.Parse(element.GetAttribute("outlineWidth", ""));
            sp.chkUseShadow.Checked     = bool.Parse(element.GetAttribute("shadow", ""));
            sp.chkOpaqueOutline.Checked = bool.Parse(element.GetAttribute("opaqueOutline", ""));
            string fontStyle  = element.GetAttribute("fontStyle", "");
            string fontFamily = element.GetAttribute("fontFamily", "");

            XPathNodeIterator it = element.Clone().Select("text");

            it.MoveNext();
            text = it.Current.Value;

            FontStyle style = (FontStyle)Enum.Parse(typeof(FontStyle), fontStyle);

            sp.buttonFont.Font = new Font(fontFamily, 14, style, GraphicsUnit.Pixel, 0);

            fromXml = true;
        }