Click here to Skip to main content
15,892,674 members
Articles / Programming Languages / C#

Webpage thumbnailer

Rate me:
Please Sign up or sign in to vote.
4.75/5 (25 votes)
17 Aug 20062 min read 168.8K   6K   98  
An article on how to get a webpage thumbnail and give your favorite links a face.
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace net.grool.util
{
	public delegate void RefreshPictureDelegate(Image im);
	public class PicDoc
	{
		public event RefreshPictureDelegate refreshPicture;
		string url = string.Empty;

		public string Url
		{
			get { return url; }
			set { url = value; }
		}
		PSize picSize = null;
		Image im = null;


		public Image Image
		{
			get { return im; }
			set
			{
				im = value;
				refreshPicture(im);
			}
		}
		public PSize PicSize
		{
			get { return picSize; }
			set { picSize = value; }
		}
		public Image getSizedImage(Image im)
		{
			return new Bitmap(im, picSize.getBaseSize);
		}

	}

	public class PSize
	{
		Size pSize;

		public Size getBaseSize
		{
			get { return pSize; }
			set { pSize = value; }
		}

		public int Width
		{
			get { return pSize.Width; }
			set { pSize.Width = value; }
		}
		public int Height
		{
			get { return pSize.Height; }
			set { pSize.Height = value; }
		}
		public PSize(int width, int height)
		{
			pSize.Width = width;
			pSize.Height = height;

		}
		public override string ToString()
		{
			return string.Format("{0}X{1}", pSize.Width, pSize.Height);
		}

	}
}

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 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


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

Comments and Discussions