Click here to Skip to main content
15,922,630 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: analyzing the return value Pin
mtzlplyk15-Oct-04 6:11
mtzlplyk15-Oct-04 6:11 
GeneralRe: analyzing the return value Pin
David Crow15-Oct-04 8:01
David Crow15-Oct-04 8:01 
QuestionHow do I gray out a radio button? Pin
tpbzdw15-Oct-04 5:13
tpbzdw15-Oct-04 5:13 
AnswerRe: How do I gray out a radio button? Pin
David Crow15-Oct-04 5:38
David Crow15-Oct-04 5:38 
GeneralRe: How do I gray out a radio button? Pin
tpbzdw15-Oct-04 5:41
tpbzdw15-Oct-04 5:41 
AnswerRe: How do I gray out a radio button? Pin
mtzlplyk15-Oct-04 6:04
mtzlplyk15-Oct-04 6:04 
GeneralRe: How do I gray out a radio button? Pin
tpbzdw15-Oct-04 11:35
tpbzdw15-Oct-04 11:35 
GeneralPicking in Opengl Pin
rage98915-Oct-04 5:06
rage98915-Oct-04 5:06 
GeneralDifferent techniques to handle license control Pin
anderslundsgard15-Oct-04 4:55
anderslundsgard15-Oct-04 4:55 
GeneralPlease help - individual chars in a CString Pin
...---...15-Oct-04 4:53
...---...15-Oct-04 4:53 
GeneralRe: Please help - individual chars in a CString Pin
David Crow15-Oct-04 5:39
David Crow15-Oct-04 5:39 
GeneralRe: Please help - individual chars in a CString Pin
...---...15-Oct-04 6:23
...---...15-Oct-04 6:23 
GeneralRe: Please help - individual chars in a CString Pin
David Crow15-Oct-04 6:37
David Crow15-Oct-04 6:37 
GeneralRe: Please help - individual chars in a CString Pin
...---...15-Oct-04 9:30
...---...15-Oct-04 9:30 
GeneralRe: Please help - individual chars in a CString Pin
David Crow15-Oct-04 9:37
David Crow15-Oct-04 9:37 
GeneralRe: Please help - individual chars in a CString Pin
BlackDice15-Oct-04 8:46
BlackDice15-Oct-04 8:46 
GeneralReceiving Messsage from ActiveX Control Pin
Manoj Singh K.15-Oct-04 4:30
Manoj Singh K.15-Oct-04 4:30 
GeneralCOM: Get Interface from one process to another Pin
peterchen15-Oct-04 3:43
peterchen15-Oct-04 3:43 
GeneralRe: COM: Get Interface from one process to another Pin
mtzlplyk15-Oct-04 5:34
mtzlplyk15-Oct-04 5:34 
GeneralRe: COM: Get Interface from one process to another Pin
peterchen15-Oct-04 6:02
peterchen15-Oct-04 6:02 
QuestionWhere is wrong when I try to get the recordset? Pin
chocm15-Oct-04 3:42
chocm15-Oct-04 3:42 
AnswerRe: Where is wrong when I try to get the recordset? Pin
David Crow15-Oct-04 4:39
David Crow15-Oct-04 4:39 
AnswerRe: Where is wrong when I try to get the recordset? Pin
Andrzej Markowski15-Oct-04 18:33
Andrzej Markowski15-Oct-04 18:33 
GeneralProblem Parsing Pictures from Rich-Text (RTF) File Pin
Popeye Doyle Murray15-Oct-04 2:48
Popeye Doyle Murray15-Oct-04 2:48 
I am writing software that parses out an RTF file. One of the things I want to do is extract pictures and save them to a file. The following is taken directly from Microsoft's RTF FAQ (version 1.3):

---- From RTF FAQ ---

The picture in hexadecimal or binary format follows the picture-destination control words. The following example illustrates the destination format:
{\pict\wbitmap0\picw170\pich77\wbmbitspixel1\wbmplanes1\wbmwidthbytes22
\picwgoal505
\pichgoal221
\picscalex172
\picscaley172
49f2000000000273023d1101a030
3901000a000000000273023d98
0048000200000275
02040000200010275023e000000000
273023d000002b90002b90002
b90002b90002b9
0002b90002b90002b90002b90002b90002
b92222b90002b90002b90
002b90002b9
0002b90002b90002b90002b9000

---- End of Stuff from RTF FAQ ---

I am able to parse out all of the bytes (in this example, beginning 49f2...) and I convert them from their text representation to real bytes (i.e., the character sequence "49" is converted to 0x49), but what I get is not a readable picture.

Here is more detail: Suppose I have a bitmap file. I take the same picture and embed it in an RTF document. I can open up the document in Notepad and view the hexidecimal represeantion of the image. I have also written a program that can read a binary file such as a bitmap and convert it to the text equivalent of a hexidecimal as it would appear embedded in the RTF document. I then visually compare the hex I generated directly from the hex embeded in the RTF file.

The hex from the RTF file is the same as the hex I generate directly from the disk file... EXCEPT for the first several hundred bytes! Each source starts out different, but after a hundred byts or so, each is then the same, so I know my encode/decode should be working.

But why is the hexidecimal of the embedded picture not exactly the same as the hexidecmal of the disk file? According to the RTF FAQ, they should be. What can I do to extract the picture? Did Microsoft do something to encode the first series of bytes for a picture so that no one else can extract it?

I have found this problem with both bitmaps and GIF files. I am using MS Word 95 to generate the RTF files with pictures embedded.






GeneralRe: Problem Parsing Pictures from Rich-Text (RTF) File Pin
Henry miller15-Oct-04 7:01
Henry miller15-Oct-04 7:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.