Is it possible to embed an image in a formatted tooltip? ie. using an img tag or similar construct?
Under the ToolTip section in the properties window there is a ToolTipTextFormatted property. When you click on the button an editor pops up and you can insert an image from a URL or a file.
Steve,
Ah... so it is possible.... it looks like the resulting text (from the window pictured in your post) is something like this:
<img style="width:##px; height:##px" data="encoded string of the image" />
Since I am looking to set this tooltip programmatically, all I have left to do is to figure out how to encode the image as a string.
Thanks Steve for finding that!
BCCORP said:Since I am looking to set this tooltip programmatically, all I have left to do is to figure out how to encode the image as a string.
There's a method on the FormattedLinkLabel and/or FormattedTextEditor control for this.
this.ultraFormattedTextEditor1.EditInfo.EncodeImage(img);
I can't find this on the FormattedLinkLabel, there is no EditInfo property (presumably because it isn't editable...)
FormattedTextEditInfo.EncodeImage is public but not static, however the FormattedTextEditInfo ctor is internal so I can't instantiate it.
This fn just calls FormattedLinkLabel.Parser.EncodeImage but both Parser and EncodeImage are internal (but static, so why isn't FormattedTextEditInfo.EncodeImage static... this would solve the problem)
In turn this just calls AppStyling.StyleUtilities.ValueToXmlString which is static internal.
So I can see no alternative to having to Instantiate a FormattedTextEditor to encode an image for use in a FormattedLinkLabel... doh
--
Also it doesn't help that the data attribute of img is not described in the help in any detail, neither is an example given in the help, nor are images demonstrated in the FormattedLinkLabel Sample application.
cheers
Martin
Hello,
You can access the static method for EncodeImage for FromattedLinkLabel as below
Infragistics.Win.
FormattedLinkLabel.FormattedLinkEditor.EncodeImage();
You will also find the DecodeImage() method at the same location