Export (0) Print
Expand All

image Object

Specifies an image element to display in a gadget.

Members

The image object defines the following members:

Methods

The image object defines the following methods.

MethodDescription
addGlow

Adds a glow effect to a g:image element.

addShadow

Adds a shadow effect to a g:image element.

 

Properties

The image object defines the following properties.

PropertyAccess typeDescription

blur

Read/write

Gets or sets the level of blur applied to the g:image element.

brightness

Read/write

Gets or sets the brightness of the g:image element.

height

Read/write

Gets or sets the height of the g:image element.

left

Read/write

Gets or sets the number of pixels from the left edge of the gadget to position the g:image element.

opacity

Read/write

Gets or sets the opacity of the g:image element.

rotation

Read/write

Gets or sets the degree of rotation applied to the g:image element.

softEdge

Read/write

Gets or sets the amount of edge softening that is applied to the g:image element.

src

Read/write

Gets or sets the image file used by the g:image element.

top

Read/write

Gets or sets the number of pixels from the top edge of the gadget to position the g:image element.

width

Read/write

Gets or sets the width of the g:image element.

 

Remarks

The Windows Sidebar supports JPEG, bitmap (BMP), Graphics Interchange Format (GIF), and Portable Network Graphics (PNG) image types. Only PNG supports alpha channel transparency.

This element can be declared in the gadget HTML file or created with the addImageObject method from a script file. However, if the element is declared in the HTML file, it will affect the gadget element layout rather than being part of the background.

Caution  Other than g:background, avoid images that render to the absolute edges of a gadget. In high-DPI, rounding errors can cause a magenta fringe around the border of the gadget.

This element is a $disp element.

This element requires a closing tag.

Examples

This example shows how to create a g:image element in a gadget script file that exposes all g:image members.

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

This example shows how to declare a g:image element in the gadget HTML file that exposes a subset of g:image members (similar funtionality to g:background).

<g:image src="..\aerologo.png" id="imgTest" onclick="changeText()" />

 

 

Send comments about this topic to Microsoft

Build date: 2/24/2010

Build type: SDK

Community Additions

Show:
© 2014 Microsoft