Code:
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace Crtanje
{
public class MainForm : Form
{
public MainForm()
{
this.Paint += new System.Windows.Forms.PaintEventHandler(this.MainFormPaint);
}
void MainFormPaint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(20, 80, 14, 40),
Color.LightGreen, Color.Yellow, 35);
g.FillRectangle(brush, new Rectangle(10, 10, 150, 100));
g.DrawLine(new Pen(Color.Red), new Point(30, 160), new Point(94, 58));
Font f = new Font("Tahoma", 40);
LinearGradientBrush brush2 = new LinearGradientBrush(new Rectangle(20, 80, 14, 40),
Color.Red, Color.LightSkyBlue, 35);
g.DrawString("Crtanje", f, brush2, 50, 50);
}
[STAThread]
public static void Main(string[] args)
{
Application.Run(new MainForm());
}
}
}