Skip to main content

CustomWallpaper

Namespace: Wisej.Web.Ext.CustomWallpaper

Assembly: Wisej.Web.Ext.CustomWallpaper (4.1.0.0)

Changes the background image of the Desktop or any target Control to rotate through a custom list of images.

public class CustomWallpaper : Component, IWisejHandler

The images are cross-faded (see FadeTime) every RotationInterval milliseconds, optionally with a slow zoom effect (see EnableAnimation). Images can be Image objects, which are served by the component itself, or URLs.

Example:

Rotating three images on the desktop every 30 seconds:

var wallpaper = new CustomWallpaper
{
RotationInterval = 30000,
FadeTime = 2000,
Images = new[]
{
new ImageListEntry("Images/Wallpapers/beach.jpg"),
new ImageListEntry("Images/Wallpapers/mountains.jpg"),
new ImageListEntry("https://example.com/images/city.jpg")
}
};

Constructors​

Instance member CustomWallpaper()​

Initializes a new instance of the CustomWallpaper class.

Instance member CustomWallpaper(container)​

Initializes a new instance of the CustomWallpaper class together with the specified container.

NameTypeDescription
containerIContainerA IContainer that represents the container for the component.

Throws:

Properties​

Instance member Control​

Control: Returns or sets the control that will receive the background images. (Default: null)

When null (the default), the images are applied to the current Desktop or, if the application doesn't use a desktop, to the main Page. The property is reset to null automatically when the target control is disposed.

Example:

Using the wallpaper as the background of a panel:

this.customWallpaper1.Control = this.panelHeader;

Instance member EnableAnimation​

Boolean: Returns or sets whether a simple zoom animation is applied when rotating images. (Default: True)

When enabled, the incoming image is slowly scaled to 105% over five times the FadeTime.

Instance member FadeTime​

Int32: Returns or sets the fade in/out time in milliseconds. (Default: 1000)

This is the duration of the cross-fade between the current image and the next one. When EnableAnimation is true, the zoom animation lasts five times this value. The default is 1000.

Throws:

Instance member Images​

ImageListEntry[]: Returns or sets the list of images to rotate. (Default: null)

Each ImageListEntry can specify either an Image object, which is streamed to the browser by the component, or an image source (URL or application-relative path). Images are scaled to cover the target control. Assigning a new array immediately fades in the next image; changing the elements of the existing array doesn't update the client.

Example:

Mixing an embedded image with image URLs:

this.customWallpaper1.Images = new[]
{
new ImageListEntry(Properties.Resources.CompanyBackground),
new ImageListEntry("Images/Wallpapers/office.jpg")
};

Instance member RandomOrder​

Boolean: Returns or sets whether the images are displayed in random order. (Default: False)

The list is shuffled every time the component is updated and sent to the client.

Instance member RotationInterval​

Int32: Returns or sets the rotation interval in milliseconds. (Default: 60000)

Set to 0 to disable the rotation: only the first image is displayed. The default is 60000 (one minute).

Throws:

Example:

Changing the image every 5 minutes with a 3 seconds cross-fade:

this.customWallpaper1.RotationInterval = 5 * 60 * 1000;
this.customWallpaper1.FadeTime = 3000;

Methods​

Protected member Dispose(disposing)​

When the reference count goes down to zero, kill also the static timer.

ParameterTypeDescription
disposingBooleantrue when this method is called by the application rather than a finalizer.

Protected member OnAddReferences(list)​

Returns a collection of referenced components or collection of components.

ParameterTypeDescription
listIListList of referenced components or collection of components.

Protected member OnWebRender(config)​

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Implements​