Graphics

Unknown | 12:50 AM |

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace WindowsFormsApplication1
{
    public partial class graphics : Form
    {
        public graphics()
        {
            InitializeComponent();
        }

        private void graphics_Load(object sender, EventArgs e)
        {

        }

        private void graphics_Paint(object sender, PaintEventArgs e)
        {
            Graphics g;
            g = this.CreateGraphics();
            Pen p = new Pen(Brushes.Purple, 3);
            g.DrawEllipse(p, 100, 100, 100, 100);
            g.FillEllipse(Brushes.Plum, 200, 100, 100, 200);
            g.DrawLine(p, new Point(100, 200), new Point(200, 100));
            Point[] p1 = new Point[5];
            p1[0] = new Point(100, 50);
            p1[1] = new Point(200, 100);
            p1[2] = new Point(250, 100);
            p1[3] = new Point(200, 50);
            p1[4] = new Point(100, 250);
            g.DrawPolygon(p, p1);
            System.Drawing.Font f = new Font("Times New Roman", 15, FontStyle.Bold);
            StringFormat f1 = new StringFormat(StringFormatFlags.NoClip);
            StringFormat f2 = new StringFormat(f1);
            f1.LineAlignment = StringAlignment.Center;
            f2.FormatFlags = StringFormatFlags.DirectionVertical;
            f2.Alignment = StringAlignment.Far;
            Rectangle r=new Rectangle(100,100,100,100);
            g.DrawRectangle(Pens.Brown, r);
            g.DrawString("Hello world", f, Brushes.Red, r.X, r.Y, f1);
            g.DrawString("Hai", f, Brushes.SlateBlue, r.Left, r.Top, f2);




        }
    }}



Category:

About http://dotnetvisual.blogspot.in/:
DOT NET TO ASP.NET is a web application framework marketed by Microsoft that programmers can use to build dynamic web sites, web applications and web services. It is part of Microsoft's .NET platform and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime, allowing programmers to write ASP.NET code using any Microsoft .NET language. create an application very easily ....