Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » General » Downloads
 

Webpage thumbnailer

By , 17 Aug 2006
 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace net.grool.util
{   
	public partial class TestForm : Form
	{
		
		public TestForm()
		{
			InitializeComponent();
			
	     }
		PicDoc picDoc = null;
		BrowserForm browserForm=null;
		
		private void btnGo_Click(object sender, EventArgs e)
		{
			if (tbUrl.Text.Equals(string.Empty)) return;
			picDoc = new PicDoc();
			picDoc.refreshPicture += new RefreshPictureDelegate(picDoc_refreshPicture);
			picDoc.Url=tbUrl.Text;
			picDoc.PicSize = (PSize)this.cbPicSize.SelectedItem;
			browserForm.CurDoc = picDoc;
		    browserForm.getImageFromUrl(picDoc.Url);
			

		}
		/// <summary>
		/// Here I paint a border to picture and  display it
		/// </summary>
		/// <param name="im"></param>
		private void picDoc_refreshPicture(Image im) {

			Graphics g = Graphics.FromImage(im);
			g.DrawRectangle(Pens.Blue,new Rectangle(0,0,im.Width-1,im.Height-1));
			this.pPicture.BackgroundImage = im;
		
		
		}
		/// <summary>
		/// Here I populate combo box with PSize objects representing sizes available for thumbnails.
		/// Invisible BrowserForm is created  here as well.
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void TestForm_Load(object sender, EventArgs e)
		{
			cbPicSize.Items.Add(new PSize(200, 200));
			cbPicSize.Items.Add(new PSize(300,300));
			cbPicSize.SelectedIndex = 0;
			browserForm = new BrowserForm();

		}
	}
}

By viewing downloads associated with this article you agree to the Terms of use 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

About the Author

dooskoobi
Web Developer
Belgium Belgium
Member
No Biography provided

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 17 Aug 2006
Article Copyright 2006 by dooskoobi
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid