Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Unassigned: RichTextBox crashes with OutOfMemoryException when pasting in large image [22346]

$
0
0
I tried pasting in a 4500x3250 image into the RichTextBox, and it crashes. The RichTextBox declared as follows:

```
<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,

When pasting in the Toolkit's RichTextBox, the Toolkit's RtfFormatter will create a new MemoryStream to save the pasted data. In your case, you are using a pretty big image.
Make sure to set the platform's target of your application to x64, in Project properties, in tab Build.

For an image that big,


Viewing all articles
Browse latest Browse all 4964

Trending Articles



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