The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Unit: SDL_htmllab
Class: none
Declaration: function RenderHTMLTextOnCanvas (HtmlCode: string; Canvas: TCanvas; xpos, ypos: integer; SuppressExceptions: boolean; ForceTxtColor: boolean; TxtColor: TColor): integer;

The function RenderHTMLTextOnCanvas renders the text HTML code contained in the parameter HtmlCode on the canvas Canvas. The parameters xpos and ypos specify the position of the rendered text (in pixels, top left corner is origin).

If the parameter SuppressExceptions is set TRUE, any exceptions which may occur during the parsing of the HTML code are suppressed. By default the text is rendered using the color, size and style of the canvas font. The color of the text may be controlled by the parameter TxtColor if ForceTxtColor is set TRUE (otherwise the color is controlled by the canvas font and the HTML tags.

The function returns the length of the rendered text in pixels.

Hint: Please note that the HTML code interpreted by this function is rather restricted. See the section "Using THtmlLab" for a description of the supported tags.

Last Update: 2012-Oct-20