次の方法で共有


background.addImageObject method

[The Windows Gadget Platform/Sidebar is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. ]

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

Syntax

objRetVal = background.addImageObject(
  strUNC,
  intXOffset,
  intYOffset
)

Parameters

strUNC [in]

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

intXOffset [in]

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

intYOffset [in]

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

Return value

Returns a g:image object.

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);

Requirements

Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
End of client support
Windows 7
End of server support
Windows Server 2008
IDL
Sidebar.idl
DLL
Sidebar.Exe (version 1.00 or later)

See also

Reference

background

image

text