Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Multi-monitor Warp Speed Screen Saver

0.00/5 (No votes)
21 Dec 2008 1  
High-speed screen saver simulating a warp-speed effect; will span multiple monitors.

Introduction

My son and I were watching a sci-fi show on television and saw a cool effect that simulated a spacecraft approaching light speed. Later he asked me if we could do something similar on the computer as a screen saver - this was our go at it.

Background

I found several C# starter programs that produced screen savers, but none of them I found would span multiple screens - this one does. It’s simple enough to be a good starting point for any other screen saver ideas you might have - if not, you can simply enjoy having this screen saver option in your collection.

Using the Code

To deploy the screen saver on your computer, you simply need to copy the binary file “Warp Speed.scr” to your Windows system32 folder (typically C:\Windows\system32\). Once there, the screen saver should appear on your system just like any other. There is a detailed set of options to tinker with for effect and the preview window works as well. Note that if you make modifications to the program and recompile, you will need to rename “Warp Speed.exe” to “Warp Speed.scr” and redeploy to your system folder. Here are some of the available options:

WarpSpeedOptions.JPG

Points of Interest

Of special interest to those wanting to write a screen saver that spans multiple monitors will be the ScreenArea class, here is an excerpt:

/// <summary>
/// Gets the least "x" coordinate of all screens on the system
/// </summary>
/// <returns>The smallest visible "x" screen coordinate</returns>
public static int LeftMostBound
{
    get
    {
        int leftBound = int.MaxValue;

        // Return the left-most "x" screen coordinate
        foreach (Screen display in Screen.AllScreens)
        {
            if (leftBound > display.Bounds.X)
                leftBound = display.Bounds.X;
        }

        return leftBound;
    }
}

This class allows the screen saver to calculate the bounds across all attached screens as follows:

// Screen saver is in full screen mode 
// (i.e., not the preview window) - make form span all available system screens
Left = ScreenArea.LeftMostBound;
Top = ScreenArea.TopMostBound;
Width = ScreenArea.TotalWidth;
Height = ScreenArea.TotalHeight;

History

  • 21st December, 2008: Initial post

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here