Picture in RichTextBox - InfoPath Dev
in

InfoPath Dev

Picture in RichTextBox

Last post 05-19-2010 05:36 AM by nsdolic. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-13-2010 07:46 AM

    Picture in RichTextBox

    Hi guys,

     is it possible to insert picture into RichTextBox infopath form programatically. Here are more details:

    User clicks on button and opens Openfile dialog.

    User selects picture and clicks OK.  

    The picture is inserted into RichTextBox on infopath form.

    I would prefer (*.tif) format if possible.

     

    Thank you very much

  • 05-14-2010 11:39 AM In reply to

    Is this the right forum for this type of question?

     Thanks.

  • 05-14-2010 08:31 PM In reply to

     You need to insert an <img> node into your rich text as follows:

         <img xmlns="http://www.w3.org/1999/xhtml" src="msoinline/identifier" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"
        xd:inline="img data" />

    You can also include a style="" attribute if you like.

    I haven't been able to find any good information on how identifier is determined, but from my experimentation, it seems like InfoPath doesn't care as long as it's a non-empty string of letters and numbers.  img data is the image's bytes in Base-64 encoding.  If you're having the user attach the image via a Picture control, you can take the string right from there.  If you're loading the bytes from somewhere outside the form, you should be able to use the framework function Convert.ToBase64String()

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 05-19-2010 05:36 AM In reply to

    Thanks Jimmy

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.