Programmatically adding Images to RTF Document

后端 未结 5 637
时光说笑
时光说笑 2020-11-27 04:40

I am trying to add a image to a RTF document which I am creating. I would prefer to not use \'copy/paste\' methods (that involve pasting the image within a RichTextBox and t

5条回答
  •  醉梦人生
    2020-11-27 05:16

    I found that most of RTF boxes using the following format:

    {\object\objemb{\*\objclass Paint.Picture}\objw2699\objh4799{\*\objdata [hex/bin]}}
    

    When [hex/bin] is large amount of hex strings representing the image format. This way working both for Word rtf, and both for RTF box - so it is more efficient.

    In my computer image in a size of 180x320 pixels been converted to 2699x4799 twips, which means 1pix=15 twips, as far as I can see, it is like this in 3 computers that I've been testing, between them WinXP prof, WinXP home and Win 7.

提交回复
热议问题