Hi there!
Is there a way to embed an image into the FormattedTextEditInfo of an UltraFormattedTextEditor in a way, that the outcoming Data is valid html?
Because if I choose 'Embed image data in xml' it gives me an image tag, with a data attribute where the image is embedded in binary format, but which my browser won't display.
Is it possible to tweak Settings of the UltraFormattedTextEditor to make the outcoming xml valid to display properly in browsers? Or are there any other ways?
Can someone here give me a hint?
GuidoKoehler said: Hi there! Is there a way to embed an image into the FormattedTextEditInfo of an UltraFormattedTextEditor in a way, that the outcoming Data is valid html? Because if I choose 'Embed image data in xml' it gives me an image tag, with a data attribute where the image is embedded in binary format, but which my browser won't display. Is it possible to tweak Settings of the UltraFormattedTextEditor to make the outcoming xml valid to display properly in browsers? Or are there any other ways? Can someone here give me a hint?
Can you give a little more information about how you're using the UltraFormattedTextEditor?
One way out of many to achieve what you're asking would be to copy the Value of the editor to a string variable, and then:
Search for: data="
Replace with: src="data:image/jpg;base64,
Then your image tag should be valid html. Although, you may encounter problems displaying the image if it's in a file format other than JPG, since it is what we specified the data to be.
Note: Replacing what I mentioned above will cause the display of the image in the UltraFormattedTextEditor to become invalid, so you'd have to search and replace in the opposite direction if you wanted to the put the value back into the editor.
Torrey Betts said: Can you give a little more information about how you're using the UltraFormattedTextEditor? One way out of many to achieve what you're asking would be to copy the Value of the editor to a string variable, and then: Search for: data=" Replace with: src="data:image/jpg;base64, Then your image tag should be valid html. Although, you may encounter problems displaying the image if it's in a file format other than JPG, since it is what we specified the data to be. Note: Replacing what I mentioned above will cause the display of the image in the UltraFormattedTextEditor to become invalid, so you'd have to search and replace in the opposite direction if you wanted to the put the value back into the editor.
Hi, Torrey!
Im using the UltraFormattedTextEditor quite simple. I'm opening the Insert Image Dialog from the context menu, and in the dialog checking 'embed image in xml', to generate the image tag with the data=" attribute.
For testing purposes, i have implemented a second form with a WebBrowser Control to display the formatted text of the UltraFormattedTextEditor, after replacing data=" with src="data:image/jpg;base64, but the WebBrowser Control wont display the image.
Also if I save the Source of the WebBrowser Control as html File and open it in a WebBrowser (e.g. IE9) the image is not loaded.
So I would guess, the Html is not valid.
Bye the way: The image is a 197Kb jpg, I hope the size is not the problem?
Ciao,
Guido.