Click here to Skip to main content
15,886,765 members
Articles / Desktop Programming / MFC

Ramakrishna's Code Project Screen Saver

Rate me:
Please Sign up or sign in to vote.
4.29/5 (4 votes)
19 May 2002CPOL9 min read 197.3K   2.3K   31  
This is a screen saver written in C# and Managed C++ to display data from The Code Project web site
using System;

namespace CP.Apps.ScreenSaver.Effects
{
	public enum MovementDirection
	{
		Up = 0,
		Down = 1,
		Left = 2,
		Right = 3
	}

	public delegate void ComputeMovementDelegate(ref int x, ref int y, int step);

	public class Movement
	{
		public static void GetImageSizeForMovement(ref int width, ref int height, int step, MovementDirection dir)
		{
			switch(dir)
			{
				case MovementDirection.Down:
				case MovementDirection.Up:
					height += step;
					break;
				default:
					width += step;
					break;
			}
		}

		public static void GetImagePosForMovement(ref int x, ref int y, int step, MovementDirection dir)
		{
			switch(dir)
			{
				case MovementDirection.Down:
					y += step;
					break;
				case MovementDirection.Right:
					x += step;
					break;
			}
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions