Example #1
0
        public void VeXeTang(Graphics g)
        {
            Point Z       = Point.FakeToReal(xe.getX(), xe.getY());
            HT    banhxe1 = new HT(Z.getX(), Z.getY(), 15);
            HT    banhxe2 = new HT(Z.getX() + 33 * 5, Z.getY(), 15);

            banhxe1.Midpoint_htron(g, Color.Black);
            banhxe2.Midpoint_htron(g, Color.Black);
            Elip xich = new Elip(Z.getX() + 16 * 5, Z.getY(), 14 * 5, 2 * 5);

            xich.VeElip(g, Color.Green);
            Line AB, BC, CD, DA;
            int  xa, xb, xc, xd, ya, yb, yc, yd;

            xa = xe.getX() + 19;
            ya = xe.getY() + 18;
            xb = xa + 10;
            yb = ya;
            xc = xa + 10;
            yc = ya + 2;
            xd = xa;
            yd = ya + 2;

            Point A = Point.FakeToReal(xa, ya);
            Point B = Point.FakeToReal(xb, yb);
            Point C = Point.FakeToReal(xc, yc);
            Point D = Point.FakeToReal(xd, yd);

            AB = new Line(A.getX(), A.getY(), B.getX(), B.getY(), Color.Red);
            BC = new Line(B.getX(), B.getY(), C.getX(), C.getY(), Color.Red);
            CD = new Line(C.getX(), C.getY(), D.getX(), D.getY(), Color.Red);
            DA = new Line(A.getX(), A.getY(), D.getX(), D.getY(), Color.Red);
            AB.DDA_Line(g, Color.Red);
            CD.DDA_Line(g, Color.Red);
            BC.DDA_Line(g, Color.Red);
            DA.DDA_Line(g, Color.Red);
            xa = xe.getX() + 7;
            ya = xe.getY() + 3;
            xb = xa + 18;
            yb = ya;
            xc = xa + 18;
            yc = ya + 10;
            xd = xa;
            yd = ya + 10;
            A  = Point.FakeToReal(xa, ya);
            B  = Point.FakeToReal(xb, yb);
            C  = Point.FakeToReal(xc, yc);
            D  = Point.FakeToReal(xd, yd);
            AB = new Line(A.getX(), A.getY(), B.getX(), B.getY(), Color.Red);
            BC = new Line(B.getX(), B.getY(), C.getX(), C.getY(), Color.Red);
            CD = new Line(C.getX(), C.getY(), D.getX(), D.getY(), Color.Red);
            DA = new Line(A.getX(), A.getY(), D.getX(), D.getY(), Color.Red);
            AB.DDA_Line(g, Color.Red);
            CD.DDA_Line(g, Color.Red);
            BC.DDA_Line(g, Color.Red);
            DA.DDA_Line(g, Color.Red);
            HT nap = new HT(Z.getX() + 16 * 5, Z.getY() - 13 * 5, 7 * 5);

            nap.Midpoint_htron2(g, Color.BlueViolet);
        }
Example #2
0
        public Fish(int x, int y, int size)
        {
            Point a = Point.FakeToReal(x, y);

            this.size = size;
            this.x    = a.getX();
            this.y    = a.getY();
            size      = size * 5;
            than      = new Elip(this.x, this.y, size, size / 2);
            Random r = new Random();
            int    n = r.Next(0, 2);

            if (n == 0)
            {
                R2L = true;
            }
            else
            {
                R2L = false;
            }
            if (R2L)
            {
                duoi1 = new Line(this.x + size, this.y, this.x + 2 * size, this.y + size / 2, Color.Black);
                duoi2 = new Line(this.x + size, this.y, this.x + 2 * size, this.y - size / 2, Color.Black);
                duoi3 = new Line(this.x + 2 * size, this.y + size / 2, this.x + 2 * size, this.y - size / 2, Color.Black);
                mat   = new Point(this.x - size / 2, this.y - size / 4);
            }
            else
            {
                duoi1 = new Line(this.x - size, this.y, this.x - 2 * size, this.y + size / 2, Color.Black);
                duoi2 = new Line(this.x - size, this.y, this.x - 2 * size, this.y - size / 2, Color.Black);
                duoi3 = new Line(this.x - 2 * size, this.y + size / 2, this.x - 2 * size, this.y - size / 2, Color.Black);
                mat   = new Point(this.x + size / 2, this.y - size / 4);
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            int x = Int32.Parse(numericUpDown1.Value.ToString());
            int y = Int32.Parse(numericUpDown2.Value.ToString());

            a = Int32.Parse(numericUpDown3.Value.ToString()) * 5;//thử nhá
            b = Int32.Parse(numericUpDown4.Value.ToString()) * 5;

            A                 = Point.FakeToReal(x, y);
            hinhelip          = new Elip(A.getX(), A.getY(), a, b);
            this.DialogResult = DialogResult.OK;
            checkchange       = true;
            this.Close();
        }
Example #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            int x = Int32.Parse(numericUpDown1.Value.ToString());
            int y = Int32.Parse(numericUpDown2.Value.ToString());

            a = Int32.Parse(numericUpDown3.Value.ToString());
            b = Int32.Parse(numericUpDown4.Value.ToString());

            if (a == 0)
            {
                MessageBox.Show("Bạn chưa nhập a !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (b == 0)
            {
                MessageBox.Show("Bạn chưa nhập b !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                A                = Point.FakeToReal(x, y);
                hinhelip         = new Elip(A.getX(), A.getY(), a * 5, b * 5);
                this.checkchange = true;
                this.Close();
            }
        }
Example #5
0
        public void setFish(int x, int y, int size)
        {
            Point a = Point.FakeToReal(x, y);

            this.size = size;
            this.x    = a.getX();
            this.y    = a.getY();
            size      = size * 5;
            than      = new Elip(this.x, this.y, size, size / 2);
            if (R2L)
            {
                duoi1 = new Line(this.x + size, this.y, this.x + 2 * size, this.y + size / 2, Color.Black);
                duoi2 = new Line(this.x + size, this.y, this.x + 2 * size, this.y - size / 2, Color.Black);
                duoi3 = new Line(this.x + 2 * size, this.y + size / 2, this.x + 2 * size, this.y - size / 2, Color.Black);
                mat   = new Point(this.x - size / 2, this.y - size / 4);
            }
            else
            {
                duoi1 = new Line(this.x - size, this.y, this.x - 2 * size, this.y + size / 2, Color.Black);
                duoi2 = new Line(this.x - size, this.y, this.x - 2 * size, this.y - size / 2, Color.Black);
                duoi3 = new Line(this.x - 2 * size, this.y + size / 2, this.x - 2 * size, this.y - size / 2, Color.Black);
                mat   = new Point(this.x + size / 2, this.y - size / 4);
            }
        }
Example #6
0
 public void KhotaoElip(int x, int y, int a, int b)
 {
     this.hinhelip = new Elip(x, y, a, b);
 }