private void richTextBox3_Drop(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
FileInfo[] files = (FileInfo[])e.Data.GetData(DataFormats.FileDrop);
using (Stream s = files[0].OpenRead())
{
InlineUIContainer container = new InlineUIContainer();
BitmapImage bmp = new BitmapImage();
bmp.SetSource(s);
Image img = new Image();
img.SetValue(Image.SourceProperty, bmp);
container.Child = img;
richTextBox3.Selection.Insert(container);
}
}
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
// this doesn't have the markup from the inserted image
System.Windows.MessageBox.Show(richTextBox3.Xaml);
}
在运行时将图像插入RichTextBox以便可以持久保存到数据存储中的正确方法是什么?在Xaml属性中.
本文由 投稿者 创作,文章地址:https://blog.isoyu.com/archives/silverlight-yibianchengfangshijiangtuxiangtianjiadaorichtextbo.html
采用知识共享署名4.0 国际许可协议进行许可。除注明转载/出处外,均为本站原创或翻译,转载前请务必署名。最后编辑时间为:11 月 12, 2019 at 03:26 下午