Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Convert rtf text in XAML

$
0
0
I am trying to convert rtf text in XAML by following  code

            TextRange textRange = new TextRange(richTextBox1.Document.ContentStart, richTextBox1.Document.ContentEnd);
            MemoryStream ms = new MemoryStream();
            textRange.Save(ms, System.Windows.DataFormats.Xaml);
            string str = UTF32Encoding.Default.GetString(ms.ToArray());
            ms.Close();

This code successfully converts rtf to XAML.

But My problem is that XAML text  str  loosing image which is inside richTextBox1.

Viewing all articles
Browse latest Browse all 18858

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>