private void picPathBtn_Click(object sender, EventArgs e) { string filepath = ""; string picId = ""; _htmldesigner.OpenPicDialog(); if (File.Exists(picId)) { filepath = picId; } //else // filepath = _htmldesigner.GetResourceAbsolutePath(picId); if (!string.IsNullOrEmpty(filepath)) { picIDTextBox.Text = picId; picPathTextBox.Text = filepath; Size sizeofpic = GetSizeOfPic(filepath); 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; } MediaPath = filepath; }
public static void InsertImage(HTMLDesignerContrl htmlDesigner) { string htmlCode = htmlDesigner.OpenPicDialog(); /* InsertPicCodeForm insertpic = new InsertPicCodeForm(); * insertpic.HtmlDesigner = htmlDesigner; * if (insertpic.ShowDialog() == DialogResult.OK) * { * InsertElementHelper.AddToSelection(htmlDesigner.DesignWebBrowser.idoc2, insertpic.InsertImageHTML, ""); * }*/ InsertElementHelper.AddToSelection(htmlDesigner.DesignWebBrowser.idoc2, htmlCode, ""); }