Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Gadgets
Windows Sidebar
image
g:image Element | image Object

Specifies an image element to display in a gadget.

Members Table

The following table lists the members exposed by the image object.

Methods

MethodDescription
addGlow Adds a glow effect to a g:image element.
addShadow Adds a shadow effect to a g:image element.

Properties

PropertyDescription
blur Gets or sets the level of blur applied to the g:image element.
brightness Gets or sets the brightness of the g:image element.
height Gets or sets the height of the g:image element.
left Gets or sets the number of pixels from the left edge of the gadget to position the g:image element.
OPACITYopacity Gets or sets the opacity of the g:image element.
ROTATIONrotation Gets or sets the degree of rotation applied to the g:image element.
softEdge Gets or sets the amount of edge softening that is applied to the g:image element.
SRCsrc Gets or sets the image file used by the g:image element.
top Gets or sets the number of pixels from the top edge of the gadget to position the g:image element.
width 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 block 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()" />
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker