|
Post by irvbingham on Jan 2, 2021 17:01:32 GMT -5
If the image data looks like ASCII, it is probably Code64, which is how email images are converted into ASCII to avoid sending illegal binary characters.
|
|
ernie
New Member
Posts: 44
|
Post by ernie on Jan 2, 2021 20:39:59 GMT -5
tsh73 your code works! In Windows 10 when I replace your header: {\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Calibri;}} {\*\generator Riched20 10.0.19041}\viewkind4\uc1 \pard\sa200\sl240\slmult1\f0\fs22\lang9{\pict{\*\picprop}\wmetafile8\picw8229\pich8652\picwgoal4665\pichgoal4905 with: {\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Calibri;}} {\*\generator Riched20 10.0.19041}\viewkind4\uc1 \pard\sa200\sl240\slmult1\f0\fs22\lang9{\pict{\*\picprop}\wmetafile8\picw8229\pich8652\picwgoal4665\pichgoal4905 424D46350600000000004200000028000000370100004701000001002000030000000435060000 the RTF opens in Word 3565 but not Wordpad. I've also experimented with the files below and place your bin code between the preamble and footer with those supplied by wordpad. Same result (works in Word but not Wordpad) I suspect it is the bin creating the compatability issue. What do you think?
Thank you! Rod and tsh73:
the graphic file I am using can be found at:
The wordpad rtf file that contains columns.bmp can be found at: This rtf was created by inserting columns.bmp into wordpad on Windows 10.
The wordpad version looks like pure ascii to me. What do you think?
I have modified your code tsh73 to work with the columns.bmp graphic (link above) and the preamble and postcript taken from the wordpad columns.rtf (link above)
I have lots to learn and will dig into.
Attachments:testing5.bas (1.96 KB)
|
|
|
Post by Walt Decker on Jan 3, 2021 10:42:40 GMT -5
Here is a thought. Use the API to load the bmp into memory. Use the API to get each pixel color. Translate each pixel color to hex using LB. Embed that in your rtf file.
|
|
ernie
New Member
Posts: 44
|
Post by ernie on Jan 3, 2021 13:44:50 GMT -5
That would indeed contain all the image data.
I have to learn how to write a bmp header.
|
|
|
Post by tsh73 on Jan 3, 2021 14:09:26 GMT -5
ernie, glad you have it worked out. Judging by "works in Wordpad / doesnt't work in Word" and vice versa elsewhere in the 'Net Microsoft made it harder then necessary
|
|
ernie
New Member
Posts: 44
|
Post by ernie on Jan 3, 2021 23:01:03 GMT -5
tsh73 - placing a bitmap creatad with the code you wrote into my Liberty Basic-generated RTF document (about 6 pages), wordpad opens it hex bmp and all. MS-Word, too.
|
|