g:background.addImageObject Method

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

Syntax

image_element = g:background.addImageObject(
  strUNC,
  intXOffset,
  intYOffset
)

Parameters

strUNC [in]
BSTR

A UNC string that specifies the new image to be added.

intXOffset [in]
int

An integer that specifies the horizontal position of the image relative to the top-left corner of the background.

intYOffset [in]
int

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

image_element [out]
object

Returns a g:image object.

Return Value

HRESULT

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

Remarks

The initial background image remains at the bottom of the z-order and is overlayed with the new image, which effectively becomes part of the background.

Valid image types are .JPG, .BMP, .GIF, and .PNG.

Examples

The following example demonstrates how to add an image to a gadget background.

\\ imgBackground is the value of the 'id' attribute for the g:background element.
var imgGlow = imgBackground.addImageObject("file://img.png", 0, 0);

See Also

g:background
Reference
image
text

 

 

Send comments about this topic to Microsoft

Build date: 2/24/2010

Build type: SDK

Community Additions

Show: