Esempio n. 1
0
        public static void Clear()
        {
            Graphics g = Graphics.FromImage(Mybitmap);

            g.Clear(Color.White);
            Mypanel.Invalidate();
        }
Esempio n. 2
0
        public static void DrawRectangle(int width, int height)
        {
            Graphics g = Graphics.FromImage(Mybitmap);

            g.DrawRectangle(new Pen(Color.Black, penT), xPos, yPos, width, height);
            Mypanel.Invalidate();
        }
Esempio n. 3
0
        public static void DrawCircle(int radius)
        {
            Graphics g = Graphics.FromImage(Mybitmap);

            g.DrawEllipse(new Pen(Color.Aqua, penT), xPos, yPos, radius, radius);
            Mypanel.Invalidate();
        }
Esempio n. 4
0
        public static void DrawPen(int x, int y)
        {
            Graphics g = Graphics.FromImage(Mybitmap);

            g.DrawLine(new Pen(Color.Purple, penT), new Point(xPos, yPos), new Point(x, y));
            PenPosition(x, y);
            Mypanel.Invalidate();
        }
Esempio n. 5
0
        public static void DrawTriangle(int firstSide, int secondSide)
        {
            Point[] triPoints = new Point[3];
            triPoints[0] = new Point(xPos, yPos);
            triPoints[1] = new Point(firstSide + xPos, firstSide + yPos);
            triPoints[2] = new Point(triPoints[1].X - secondSide, triPoints[1].Y);

            Graphics g = Graphics.FromImage(Mybitmap);

            g.DrawPolygon(new Pen(Color.Red, penT), triPoints);
            Mypanel.Invalidate();
        }
    public Form1()
    {
        InitializeComponent();
        this.AutoScroll = true;
        int i = 0;

        Mypanel[] p = new Mypanel[10];
        for (int j = 0; j < 10; j++)
        {
            p[j]          = new Mypanel();
            p[j].Location = new Point(0, (i++) * 80);
            this.Controls.Add(p[j]);
        }
    }