Extracting images from RichTextBox

后端 未结 2 1397
醉梦人生
醉梦人生 2021-01-14 13:35

I have an application where users may insert images into a RichTextBox. I\'d like to be able to replace all the images in the RTF with some token and store the images in se

相关标签:
2条回答
  • 2021-01-14 13:51

    You can use this RTF Converter to extract the images of a RichTextBox using the class RtfVisualImageAdapter.

    Check out the examples:

    • RichTextBox: RtfWinForms (Windows Forms), RtfWindows (WPF)
    • Image Handling: Rtf2Html
    0 讨论(0)
  • 2021-01-14 13:57

    A picture would look like this:

    {\*\shppict {\pict \emfblip ..... }}{\nonshppict {\pict ....}}
    

    or even

    {\pict ...}
    

    You can check the rtf of the document containing the picture and write a regular expression to extract the images (replacing them with tokens). Another regex replace can restore the images.

    0 讨论(0)
提交回复
热议问题