Advanced .NET Framework (GDI+): Creating a Screen Saver with GDI+

This sample shows some how to create a screen saver using Visual Basic.NET.

Feature Highlights:

This how-to demonstrates many of the important features of creating screen savers that can be automated by Windows. Concepts demonstrated are:

The screen saver preview functionality is not demonstrated, since it involves several advanced threading issues.

Requirements:

Microsoft Visual Studio .NET Professional (or greater).
Windows 2000 or Windows XP.

Running the Sample:

To run the sample:

  1. Doubleclick the How-To Creating a Screensaver using GDI+.sln file. 
  2. Click the "Install" button on the main form to copy the screen saver to the Windows system folder.
  3. Go into your display settings, and set the screen saver as How-To Screen Saver.
  4. Test the screensaver.
  5. Explore the How-To Screen Saver Project project for an example of creating your own screen saver.

Notes:

When you compile your own screen saver, there are several things to keep in mind.  First, be sure to set the following Form Properties:

Also, before you can use a newly compiled screen saver, you must change its extension from .EXE to .SCR, and copy it to the Windows system directory (by default, in WinXP this is "C:\Windows\System32").

See Also:

System.Drawing, System.Drawing.Graphics