Reputation: 594
The issue is that RTF files with images are not showing when I compile on my Win10 PC.
Recently I changed my PC and with that I upgraded the OS to Win10 and VS to VS2017. Win10 is up to date and VS2017 tells me it has all the upgrades that it needs for C#. I have been writing and upgrading this app for more that two years on the Win 7 plus VS2015 system with no problem. I have also compiled the same app with code changes on the Win10 plus VS2017 system with no problems.
For the help I use a rich text file which I pull into a Rich Text box. I first
private RichTextBox rtb_help;
then on form load I use
rtb_help.Rtf = Resources.Help;
This allows the people writing this file to have no knowledge of programming and just drop me the new file which I compile. This is what happened earlier this week. When I had compiled the app and pressed for help I see no pictures in the file. I found if I take the .RTF file back to my Win7 PC and resave it with Wordpad and then compile it on my Win10 system it works.
When I diff the file from Win7 Wordpad and that from Win10 Wordpad I see the following difference around the images.
Win7 = \pard\nowidctlpar\qc\f2\fs22{\pict\wmetafile8\picw5318\pich6694\picwgoal1839\pichgoal2315
Win10 = \pard\nowidctlpar\qc\f2\fs22{\pict{\*\picprop}\wmetafile8\picw5318\pich6694\picwgoal1839\pichgoal2315
Win10 appears to reference properties of the image with {*\picprop} from elsewhere in the file. This means a richtextbox cannot read the file properly so leaves out the images and gives no error/alert.
I can see no setting in Wordpad to change this but maybe they are hidden and I need a special key sequence?
How do I make the richtextbox show the images from both files correctly?
Upvotes: 1
Views: 515
Reputation: 594
By accident I found an article on how to make RTF and Doc file smaller. It seems you can restrict the file to one copy of the image.
The suggestion is in Win10 to find registry item
HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Word\Options
and add a string called
ExportPictureWithMetafile = 0
I was totally surprised when I now save the RTF file in Win10 and compile it into the app I see the pictures. So far this is the solution that has worked for me.
Upvotes: 1