Home | Gaming | Programming | Play Online | Contact | Keyword Query
Games++ Games & Game Programming

GAMES++
Games++ Home
Games++ Gaming
Games++ Programming
Beta Testing Games
Free Online Games
Hints & Cheats

BROWSER UTILITIES
E-mail This Page
Add to Favorites

SITE SEARCH

Web Games++

AFFILIATES
Cheat Codes
Trickster Wiki
Game Ratings
Gameboy Cheats
PlayStation Cheats
BlackBerry Games
Photoshop Tutorials
Illustrator Tutorials
ImageReady Tutorials

ADVERTISEMENT

PaintBrush in C#

By Chetan V. Nadgouda

Source Code: PaintBrush.zip 9 KB

The article is the paintbrush application, which demonstrates the different aspects of C# language and certain namespaces. The concepts like EventHandling and class designs are also present.

I developed the application in VS .NET Beta1. The application is completely hand-coded so could even be compiled thru command line w/o much hassles.

Some of code snippet is here. Download zip file for full version.

public class Rectangle : Shape 
{ 
	protected Point m_Start; 
	protected Point m_End; 

	public Rectangle(Point start, Point end, Color fgColor) 
	{ 
		m_Start = start; 
		m_End = end; 
		m_Color = fgColor; 
	} 

	public override void Draw(Form canvas) 
	{ 
		if (canvas == null) 
		{ 
			return; 
		} 

		InitializeGraphics(canvas); 
		Point startPoint = canvas.PointToScreen(m_Start); 
		Point endPoint = canvas.PointToScreen(m_End); 
		MainForm mainForm = (MainForm)canvas; 
		Color bgColor = GetBackgroundColor(m_Color); 
		Size rectSize = new Size(m_End.X - m_Start.X, m_End.Y - m_Start.Y); 
		System.Drawing.Rectangle rectToDraw 
			= new System.Drawing.Rectangle(startPoint, rectSize); 
		ControlPaint.DrawReversibleFrame(rectToDraw, bgColor, FrameStyle.Thick); 
	} 
}

About the Author:

I am Technical Lead in BindView Corporation's India Development center.

Chetan V. Nadgouda
Tech Lead.
Bindview Development Corp.
Pune India

N (Off) : cnadgauda@bindview.com
N (Personal) : nchetan@iname.com

Copyright © 1998-2007, Games++ All rights reserved. | Privacy Policy