string fixImg(string text) { // <img src="C:\Jiver\tooltip album artwork\wvy.png" size="379x100">, Regex re = new Regex("<img(.+?)>", RegexOptions.IgnoreCase); Match m = re.Match(text); int pos = 0; while (m.Success) { ELImg img = ELImg.Parse(m.Groups[1].Value); string html = img.ToHTML(); text = text.Remove(m.Index, m.Length); text = text.Insert(m.Index, html); pos = m.Index + html.Length; m = re.Match(text, pos); } return(text); }
public InsertImg(string tag) : this() { ELImg img = ELImg.Parse(tag); txtPath.Text = img.path ?? ""; if (img.width > 0) { txtWidth.Text = img.width.ToString(); } if (img.height > 0) { txtHeight.Text = img.height.ToString(); } switch (img.valign?.ToLower()) { case "top": case "middle": case "bottom": comboVAlign.Text = img.valign; chkVAlign.Checked = true; break; } SelectedImg = img; }