```
<toolkit:RichTextBox x:Name="richTextBox"
Grid.Row="1"
Grid.ColumnSpan="2"
Margin="10"
MaxHeight="345"
ScrollViewer.VerticalScrollBarVisibility="Auto"
Text="{Binding CurrentlySelectedNotePage.TextInRTF}">
<toolkit:RichTextBoxFormatBarManager.FormatBar>
<toolkit:RichTextBoxFormatBar />
</toolkit:RichTextBoxFormatBarManager.FormatBar>
</toolkit:RichTextBox>
```
If I try to paste the same image into a standard System.Windows.Controls.RichTextBox, the paste is successful.
And if it isn't possible to paste larger images into the WPF Toolkit RichTextBox, then maybe there should be a more elegant way of handling this?
Comments: ** Comment from web user: BoucherS **
Hi,
The RichTextBox from the Toolkit formats the Text (RTF, XAML or PlainText) and in this case (RTF), the formatting causes the OutOfMemory exception.
The problem is in file Xceed.Wpf.Toolkit/RichTextBox/Formatters/RtfFormatter.cs, in method "GetText( FlowDocument document )".
A MemoryStream is created and a TextRange tries to saves its data in this MemoryStream, in RtfFormat.
There is enough memory :
-when using a build in x64
-when using small images
-when using XamlFormat and PlainTextFormat
But you fall in a specific case (x86, large image, RtfFormat) where there is not enough memory to proceed the action. This method can always return an empty string and it will work, but the Text property will not be formatted in RTF.
The standard RichTextBox doesn't format the Text.
You can always try another formatting, or try to reduce the image size before adding it to the Toolkit's RichTextBox.