|
using System.Windows.Forms;
using System.Drawing;
namespace OCP
{
class Square : IShapes
{
#region IShapes Members
/// <summary>
///
/// </summary>
/// <param name="frm"></param>
public void DrawShapes(Form frm)
{
Graphics grph = frm.CreateGraphics();
//Fill the background with violet color
grph.Clear(Color.Violet);
System.Drawing.Rectangle rect = frm.ClientRectangle;
rect.Height -= 50;
rect.Width = rect.Height;
//To Draw Square
grph.FillRectangle(new SolidBrush(Color.Green), 20, 20,
rect.Width, rect.Height);
//To Draw string
grph.DrawString("Square", new Font("Arial", 20),
new SolidBrush(Color.WhiteSmoke), 50, 50);
}
#endregion
}
}
|
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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.