Click here to Skip to main content
15,892,674 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.4K   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;
using System.Text;
using System.Drawing;

namespace CP.Apps.ScreenSaver
{
	/// <summary>
	/// Utilities for various purposes
	/// </summary>
	public class Util
	{
		public static string StripHtml(string text)
		{
			StringBuilder stripped = new StringBuilder(text.Length);
			bool strip = false;

			foreach(char c in text)
			{
				if (c == '<')
					strip = true;
				
				if (c == '>')
				{
					if (strip)
					{
						strip = false;
						continue;
					}
				}
				
				if (!strip)
					stripped.Append(c);
			}
		
			return stripped.ToString();
		}
	
		public static Bitmap MakeOpaqueBitmap(Image img, Color backColor)
		{
			Bitmap bmp = new Bitmap(img.Width, img.Height);
			Graphics g = Graphics.FromImage(bmp);
			g.Clear(backColor);
			g.DrawImageUnscaled(img, 0, 0);
			g.Dispose();
			
			return bmp;
		}
	}
}

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