Ejemplo n.º 1
0
        //Добавить эллипс
        public void AddEllipse(Point up, Point down)
        {
            sCircle circle = new sCircle(GetDeleateContainer(), up, down);

            shapelist.Add(circle);

            circle.Draw();
            SynchronizeImage();
        }
Ejemplo n.º 2
0
        //Рисует временный эллипс средствами gdi32
        public void TempEllipse(Point a, Point b)
        {
            IntPtr    hdc = NativeMethods.GetDC(cnv.Handle);
            sCircle   Circle;
            Rectangle rect;

            NativeMethods.SetROP2(hdc, NativeMethods.R2_NOT);
            NativeMethods.SelectObject(hdc, NativeMethods.GetStockObject(NativeMethods.HOLLOW_BRUSH));
            if ((oldb.X != int.MinValue) & (oldb.Y != int.MinValue))
            {
                Circle = new sCircle(GetDeleateContainer(), a, oldb);
                rect   = Circle.GetRect();

                NativeMethods.Ellipse(hdc, rect.X, rect.Y, rect.Width, rect.Height);
            }

            Circle = new sCircle(GetDeleateContainer(), a, b);
            rect   = Circle.GetRect();
            NativeMethods.Ellipse(hdc, rect.X, rect.Y, rect.Width, rect.Height);

            oldb = b;
            NativeMethods.ReleaseDC(cnv.Handle, hdc);
        }