
picture format in rtf code (richtext/rtf control)
Hi, Andreas:
Is your problem the displaying of the picture in the RichTextBox?
I had an application that had to include a picture (always the same pic)
between normal Text, so what I did was open that pic in WordPad and save the
file as rtf format. Then, in my form I had the RichTextBoxDisplay (for
displaying the text and picture) and another one (hidden) that stored only
the picture:
RichTextBoxPicture.LoadFile filename, rtfRTF
Then for displaying the picture in the visible RichTextBox:
RichTextBoxDisplay.SelStart = Len(RichTextBoxFax.Text)
RichTextBoxDisplay.SelLength = 0
RichTextBoxPicture.SelStart=0
RichTextBoxPicture.SelLength = 3 'Don't ask me why
RichTextBoxDisplay.SelRTF = RichTextBoxPicture.SelRTF
Maybe the 3 value of SelLength depends on the length of the picture, I don't
know, but if it doesn't work try different values.
Hope I helped you
Adrian
Quote:
>When i insert a picture in a richtext control the pic is stored in the rtf
>code like that:
>{\pict\wmetafile8\.....}
>After the rtf-head of the picture with size and scale information, the data
>of the hole picture is listed in Hex-Data.
>The source of the pic gets lost because as far as i know the richtext
>control supports no insertion of a pic as a link. It is possible to write
>this source information after the pic data for example as hidden text
(white
>textcolor), but then the connection gets lost if i move the pic with the
>mouse.
>So i have to link the pic source information for example path and filename
>to the picture data itself. So the first thing i have to know is: how is
the
>metafile coded in the rtf code or how to convert a metafile to rtf code
(and
>vice versa)
>Any ideas would be greatly appreciated.
>Sorry for my english !
>Thanks,
>Andreas Waibel.