Export (0) Print
Expand All

g:background.addTextObject Method

Adds a g:text element to the g:background element.

Syntax

retVal = g:background.addTextObject(
  strText,
  strFont,
  intFontSize,
  strColor,
  intXOffset,
  intYOffset
)

Parameters

strText [in]
String

A string that specifies the text to be added.

strFont [in]
String

A string that specifies the font name in which to render the text.

intFontSize [in]
int

An integer that specifies the absolute value for the point-size in which to render the text. This value is limited to an integer; there are no overload methods that allow the use of alternate HTML-standard values such as absolute sizes (xx-small | x-small | small | medium | large | x-large | xx-large), relative sizes (larger | smaller), percentages, or other length specifications (cm, mm, in, pc, px, em, or ex).

strColor [in]
String

A string that specifies the color of the text.

intXOffset [in]
int

An integer specifying the horizontal position of the text relative to the top-left corner of the background.

intYOffset [in]
int

An integer specifying the vertical position of the image relative to the top-left corner of the background.

Return Value

HRESULT

If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The default font and size is 12-point Times New Roman if the specified font and size are not available on the system.

Examples

The following example demonstrates how to add text to a gadget background.

\\ imgBackground is the value of the 'id' attribute for the g:background element.
var txtShadow = imgBackground.addTextObject("test", "Verdana", 25, "Red", 50, 50);

See Also

Reference
background
text

 

 

Send comments about this topic to Microsoft

Build date: 2/24/2010

Build type: SDK

Community Additions

Show:
© 2014 Microsoft