在 WPF RichTextBox 中插入图像
您好,我使用以下代码插入文本和图像,但我想将图像插入“文本后面”作为 Image>Adjust with Text property in MSWord
{
int numeroInforme = Convert.ToInt32(txtNroInforme.Text);
List<informeMedico> lstInformes = getInformeMedico(numeroInforme);
FlowDocument mcFlowDoc = new FlowDocument();
Paragraph para = new Paragraph();
foreach (informeMedico info in lstInformes)
{
var signatureOne = BinaryImageConverter(info.firma1);
var signatureTwo = BinaryImageConverter(info.firma2);
para.Inlines.Add(new Run("RM Nro:" + "\t" + info.numeroinforme.ToString()));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(new Run("Sr. Dr. :" + "\t" + info.medicoCompleto.ToString()));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(new Run("NOMBRE :" + "\t" + info.pacienteCompleto.ToString()));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(new Run("EXAMEN :" + "\t" + info.estudioExamenNombre.ToString()));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(new Run("FECHA :" + "\t" + info.fechainforme.ToString()));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(new Run(info.tecnica));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(new Run(info.hallazgo));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(new Run(info.conclusion));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(signatureOne);
para.Inlines.Add(signatureTwo);
}
mcFlowDoc.Blocks.Add(para);
mainRTB.Document = mcFlowDoc;
}
提前致谢
Hi there im using the following code for insert text and images, but I want to insert the image "behind text" as Image>Adjust with Text property in MSWord
{
int numeroInforme = Convert.ToInt32(txtNroInforme.Text);
List<informeMedico> lstInformes = getInformeMedico(numeroInforme);
FlowDocument mcFlowDoc = new FlowDocument();
Paragraph para = new Paragraph();
foreach (informeMedico info in lstInformes)
{
var signatureOne = BinaryImageConverter(info.firma1);
var signatureTwo = BinaryImageConverter(info.firma2);
para.Inlines.Add(new Run("RM Nro:" + "\t" + info.numeroinforme.ToString()));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(new Run("Sr. Dr. :" + "\t" + info.medicoCompleto.ToString()));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(new Run("NOMBRE :" + "\t" + info.pacienteCompleto.ToString()));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(new Run("EXAMEN :" + "\t" + info.estudioExamenNombre.ToString()));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(new Run("FECHA :" + "\t" + info.fechainforme.ToString()));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(new Run(info.tecnica));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(new Run(info.hallazgo));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(new Run(info.conclusion));
para.Inlines.Add(new Run("\n\n"));
para.Inlines.Add(signatureOne);
para.Inlines.Add(signatureTwo);
}
mcFlowDoc.Blocks.Add(para);
mainRTB.Document = mcFlowDoc;
}
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以设置背景 段落,或个人 < a href="http://msdn.microsoft.com/en-us/library/system.windows.documents.run.aspx" rel="nofollow noreferrer">运行,到 ImageBrush:
You can set the Background of the Paragraph, or of the individual Runs, to an ImageBrush: