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.
- C#
- VB.NET
public class CustomWallpaper : Component, IWisejHandler
Public Class CustomWallpaper
Inherits Component
Implements 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
CustomWallpaper()
Initializes a new instance of the CustomWallpaper class.
CustomWallpaper(container)
Initializes a new instance of the CustomWallpaper class together with the specified container.
| Name | Type | Description |
|---|---|---|
| container | IContainer | A IContainer that represents the container for the component. |
Throws:
- ArgumentNullException container is null.
Properties
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;
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.
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:
- ArgumentOutOfRangeException The value is less than 0 or greater than 10000 (10 seconds).
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")
};
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.
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:
- ArgumentOutOfRangeException The value is less than 0 or greater than 36000000 (10 hours).
Example:
Changing the image every 5 minutes with a 3 seconds cross-fade:
this.customWallpaper1.RotationInterval = 5 * 60 * 1000;
this.customWallpaper1.FadeTime = 3000;
Methods
Dispose(disposing)
When the reference count goes down to zero, kill also the static timer.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | true when this method is called by the application rather than a finalizer. |
OnAddReferences(list)
Returns a collection of referenced components or collection of components.
| Parameter | Type | Description |
|---|---|---|
| list | IList | List of referenced components or collection of components. |
OnWebRender(config)
Renders the client component.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Dynamic configuration object. |
Implements
| Name | Description |
|---|---|
| IUserData | |
| IWisejComponent | |
| IWisejHandler | |
| IWisejSerializable |