示例#1
0
        private void 快速测试F5ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            XhtmlSection sec = new XhtmlSection();

            XhtmlTags.Img img = sec.CreateXhtmlImg();
            img.Builder(new CssSection("css"), "alt", "hspace", "src", Xhtml.Align.bottom, "vspace", "1", "name");
            this.codeTextBox.Text = img.ToString();


            XhtmlTags.A a = sec.CreateXhtmlA();
            a.Builder("a", "title", Xhtml.Target._parent, 1, 't');
            this.outXmlTextBox.Text = a.ToString();
        }
示例#2
0
        public static XhtmlTags.Img GetDefaultPicHtml(string picPath, string customerId)
        {
            XhtmlSection _section = new XhtmlSection();

            XhtmlTags.Img img = _section.CreateXhtmlImg();

            Image      upImage = Image.FromFile(picPath);
            string     width   = upImage.Width.ToString();
            string     height  = upImage.Height.ToString();
            CssSection css     = new CssSection();

            css.Properties["width"]  = width;
            css.Properties["height"] = height;
            img.Builder(css, "0", "0", customerId, Xhtml.Align.left, "0", "0", "img");
            return(img);
        }
示例#3
0
        public InsertPicCodeForm(XhtmlTagElement imgEle, string path)
        {
            InitializeComponent();
            _htmldesigner = htmlDesigner;
            //_insertUserMode = htmlDesigner.InsertUseMode;

            AbsoluteFilePath = path;

            _imgEle                 = (XhtmlTags.Img)imgEle;
            picIDTextBox.Text       = _imgEle.GetAttribute("src");
            picPathTextBox.Text     = path;
            replaceWordTextBox.Text = _imgEle.GetAttribute("title");
            if (!string.IsNullOrEmpty(_imgEle.GetAttribute("width")))
            {
                PicWidthNumericUpDown.Value = Convert.ToInt32(_imgEle.GetAttribute("width"));
            }
            if (!string.IsNullOrEmpty(_imgEle.GetAttribute("height")))
            {
                PicHeightNumericUpDown.Value = Convert.ToInt32(_imgEle.GetAttribute("height"));
            }
            this.ImeMode = ImeMode.On;

            if (!string.IsNullOrEmpty(path))
            {
                Size sizeofpic = GetSizeOfPic(path);
                PicWidthNumericUpDown.Value  = sizeofpic.Width;
                PicHeightNumericUpDown.Value = sizeofpic.Height;
                ratio = Convert.ToDecimal(sizeofpic.Width) / Convert.ToDecimal(sizeofpic.Height);
                widthUnitComBox.SelectedIndex = heightUnitComboBox.SelectedIndex = 0;

                //this.widthCheckBox.Checked = true;
                //this.heightCheckBox.Checked = true;
                //this.limitCheckBox.Enabled = true;
                //this.limitCheckBox.Checked = true;
            }
        }