Reputation: 2403
I'm loading a valid RTF (let's say just a binary image) string from a client application.
This RTF is loaded in a WPF RichTextBox Control, and then, wighout modifying the content, I take it from the RichTextBox to send it back to the client application (so the RTF content has not suffered any change).
But now the RTF content is quite different. Now, it's still a valid RTF (if I copy it in a 'test.rtf' file, the image is properly shown). But now in the client application, the image is not shown.
If I send again that "modified" RTF from the client app to my app, the image is shown in my app. But again, sending it back to the client app, that image is not shown there.
So, to summarize, the image is not lost, but somehow I'm guessing that the RTF Format (or standard) is changed when the content is set in my RichTextBox control.
Input RTF (from client):
{\rtf1\ansi\ansicpg1252\deff0\deflang1036{\fonttbl{\f0\fnil\fcharset0 Tahoma;}}
{\*\generator Msftedit 5.41.21.2510;}
\viewkind4\uc1\pard\sa200\f0\fs20
{\pict\wmetafile8\picw17017\pich7624\picwgoal9360\pichgoal4200
010009000003d04204000000a742040000000400000......
RTF after setting in RichTextBox:
{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}
{\f2\fcharset0 Segoe UI;}{\f3\fcharset0 Tahoma;}}
{\colortbl\red0\green0\blue0;\red255\green255\blue255;}
\loch\hich\dbch\pard\plain\ltrpar\itap0
{\lang1033\fs20\f3\cf0 \cf0\ql{\f3 {\ltrch {\*\shppict{\pict\picwgoal9360\pichgoal4200\pngblip
89504e470d0a1a0a0000000d494844......
Any help? Thanks :)
Upvotes: 0
Views: 233
Reputation: 77
WPF RichTextBox only supports limited use of processing images. Relative linking, graphic metafiles, and images not in the JPG, PNG, or GIF format are some notable incompatibilities.
Upvotes: 0