picture format in rtf code (richtext/rtf control) 
Author Message
 picture format in rtf code (richtext/rtf control)

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.



Sun, 23 Jul 2000 03:00:00 GMT  
 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.



Sun, 23 Jul 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. picture format in rtf code (richtext/rtf control)

2. Disable RTF format in a RTF Box

3. RichText Box and RTF Codes

4. RTF - inserting text - difficulties with RTF code stripped by Outlook

5. Better RTF control than RichText Box

6. Hidden Information in a RichText/rtf control

7. Better RTF control than RichText Box

8. Hidden Text in RichText/RTF control

9. Hidden Information in a RichText/rtf control

10. Appending RTF strings to an RTF control

11. How to get RTF into a Word7 document from VB RTF control

12. RTF format codes

 

 
Powered by phpBB® Forum Software