# CustomWallpaper

The CustomWallpaper extender component enhances the Desktop, the MainPage or any Control control by rotating a list of custom images over the control’s background.

{% embed url="<https://github.com/iceteagroup/wisej-extensions/tree/master/Wisej.Web.Ext.CustomWallpaper>" %}
CustomWallpaper Source Code
{% endembed %}

## Code Example

```csharp
Panel panel = new Panel();
panel.Dock = DockStyle.Fill;
this.Controls.Add(panel);

CustomWallpaper paper = new CustomWallpaper();
paper.Control = panel;
paper.Images = new ImageListEntry[] {
    new ImageListEntry("Images\\apple.png", "apple"),
    new ImageListEntry("Images\\frog.png", "frog"),
    new ImageListEntry("Images\\tree.jpg", "tree")};
paper.RotationInterval = 1000;
```

This code snippet first creates a Panel and sets the DockStyle to fill so that it will fill the entire page. It then creates a new CustomWallpaper and sets the *Control* property of the CustomWallpaper to be the panel. This means that the images of the CustomWallpaper will be displayed in the panel.

Next the *Images* of the CustomWallpaper are set. There are 3 images- apple.png, frog.png, and tree.jpg, all stored in a folder called Images. The Images folder is located in the root directory of the project.

Finally the *RotationInterval* is set to 1000. This means that the images will rotate every 1000 milliseconds, or every second.

## How to Use

The **CustomWallpaper** extension can be added to a Wisej.NET project using NuGet Package Manager.

{% embed url="<https://www.nuget.org/packages/Wisej-3-CustomWallpaper>" %}

You can control the Animation with *EnableAnimation* and *FadeTime* (in milliseconds).\
The *RotationInterval* (in milliseconds) defines the interval to switch between your *Images*.

{% hint style="info" %}
Find more information in our CustomWallpaper example in [C#](https://github.com/iceteagroup/wisej-examples/tree/master/CustomWallpaper) or in [VB.NET](https://github.com/iceteagroup/wisej-examples-vb/tree/main/CustomWallpaper).
{% endhint %}
