SetPoint1() public method

public SetPoint1 ( int X, int Y ) : void
X int
Y int
return void
Ejemplo n.º 1
0
 public override void Layout()
 {
     if (StringOrientation == StringOrientations.Vertical)
     {
         int    width          = _bottomRight.X - _topLeft.X;
         int    height         = _bottomRight.Y - _topLeft.Y;
         double stringXSpacing = (double)width / (double)(StringCount - 1);
         int    x = _topLeft.X;
         int    y = _topLeft.Y;
         for (int stringNum = 0; stringNum < StringCount; stringNum++)
         {
             PreviewLine line = _strings[stringNum] as PreviewLine;
             line.SetPoint0(x, y + height);
             line.SetPoint1(x, y);
             line.Layout();
             x += (int)stringXSpacing;
         }
     }
     else
     {
         int    width          = _bottomRight.X - _bottomLeft.X;
         int    height         = _bottomLeft.Y - _topLeft.Y;
         double stringYSpacing = (double)height / (double)(StringCount - 1);
         int    x = _bottomLeft.X;
         int    y = _bottomLeft.Y;
         for (int stringNum = 0; stringNum < StringCount; stringNum++)
         {
             PreviewLine line = _strings[stringNum] as PreviewLine;
             line.SetPoint0(x, y);
             line.SetPoint1(x + width, y);
             line.Layout();
             y -= (int)stringYSpacing;
         }
     }
 }
Ejemplo n.º 2
0
        public override void Layout()
        {
            if (_bottomRight != null && _topLeft != null)
            {
                int width  = _bottomRight.X - _topLeft.X;
                int height = _bottomRight.Y - _topLeft.Y;

                List <Point> _topEllipsePoints;
                List <Point> _baseEllipsePoints;

                double _topLeftOffset  = _topLeft.X + (width / 2) - (_topWidth / 2);
                double bottomTopOffset = _bottomRight.Y - _baseHeight;

                double totalStringsInEllipse = Math.Ceiling((360d / Convert.ToDouble(_degrees)) * Convert.ToDouble(StringCount));

                _topEllipsePoints = PreviewTools.GetEllipsePoints(_topLeftOffset,
                                                                  _topLeft.Y,
                                                                  _topWidth,
                                                                  _topHeight,
                                                                  totalStringsInEllipse,
                                                                  _degrees,
                                                                  0);
                _baseEllipsePoints = PreviewTools.GetEllipsePoints(_topLeft.X,
                                                                   bottomTopOffset,
                                                                   width,
                                                                   _baseHeight,
                                                                   totalStringsInEllipse,
                                                                   _degrees,
                                                                   0);

                for (int stringNum = 0; stringNum < (int)_stringCount; stringNum++)
                {
                    if (stringNum < StringCount && stringNum < _topEllipsePoints.Count())
                    {
                        Point topPixel  = _topEllipsePoints[_stringCount - 1 - stringNum];
                        Point basePixel = _baseEllipsePoints[_stringCount - 1 - stringNum];

                        PreviewLine line = _strings[stringNum] as PreviewLine;
                        line.SetPoint0(basePixel.X, basePixel.Y);
                        line.SetPoint1(topPixel.X, topPixel.Y);
                        line.Layout();
                    }
                }

                SetPixelZoom();
            }
        }
Ejemplo n.º 3
0
        public override void Layout()
        {
            int width  = _bottomRight.X - _topLeft.X;
            int height = _bottomRight.Y - _topLeft.Y;

            List <Point> _topEllipsePoints;
            List <Point> _baseEllipsePoints;

            // First we'll get the top and bottom ellipses
            //double _topLeftOffset = _topLeft.X + (width / 2) - (_topWidth / 2);
            //_topEllipsePoints = PreviewTools.GetEllipsePoints(_topLeftOffset, _topLeft.Y, _topWidth, _topHeight, _stringCount, _degrees);
            //double bottomTopOffset = _bottomRight.Y - _baseHeight;
            //_baseEllipsePoints = PreviewTools.GetEllipsePoints(_topLeft.X, bottomTopOffset, width, _baseHeight, _stringCount, _degrees);
            double _topLeftOffset  = _topLeft.X + (width / 2) - (_topWidth / 2);
            double bottomTopOffset = _bottomRight.Y - _baseHeight;

            //if (_degrees < 360)
            //{
            //    _topEllipsePoints = PreviewTools.GetEllipsePoints(_topLeftOffset, _topLeft.Y, _topWidth, _topHeight, _stringCount+1, 360, 0);
            //    _baseEllipsePoints = PreviewTools.GetEllipsePoints(_topLeft.X, bottomTopOffset, width, _baseHeight, _stringCount+1, 360, 0);
            //}
            //else
            //{
            _topEllipsePoints  = PreviewTools.GetEllipsePoints(_topLeftOffset, _topLeft.Y, _topWidth, _topHeight, _stringCount, _degrees, 0);
            _baseEllipsePoints = PreviewTools.GetEllipsePoints(_topLeft.X, bottomTopOffset, width, _baseHeight, _stringCount, _degrees, 0);
            //}

            _stringsInDegrees = (double)_stringCount * ((double)_degrees / 360);

            for (int stringNum = 0; stringNum < (int)_stringCount; stringNum++)
            {
                if (stringNum < (int)_stringsInDegrees)
                {
                    Point topPixel  = _topEllipsePoints[stringNum];
                    Point basePixel = _baseEllipsePoints[stringNum];

                    PreviewLine line = _strings[stringNum] as PreviewLine;
                    line.SetPoint0(basePixel.X, basePixel.Y);
                    line.SetPoint1(topPixel.X, topPixel.Y);
                    line.Layout();
                }
            }
        }
Ejemplo n.º 4
0
 public override void Layout()
 {
     if (_bottomRight != null && _topLeft != null)
     {
         if (StringOrientation == StringOrientations.Vertical)
         {
             int    width          = _bottomRight.X - _topLeft.X;
             int    height         = _bottomRight.Y - _topLeft.Y;
             double stringXSpacing = (double)width / (double)(StringCount - 1);
             double x = _topLeft.X;
             int    y = _topLeft.Y;
             for (int stringNum = 0; stringNum < StringCount; stringNum++)
             {
                 PreviewLine line = _strings[stringNum] as PreviewLine;
                 var         x1   = (int)Math.Round(x, MidpointRounding.AwayFromZero);
                 line.SetPoint0(x1, y + height);
                 line.SetPoint1(x1, y);
                 line.Layout();
                 x += stringXSpacing;
             }
         }
         else
         {
             int    width          = _bottomRight.X - _bottomLeft.X;
             int    height         = _bottomLeft.Y - _topLeft.Y;
             double stringYSpacing = height / (double)(StringCount - 1);
             int    x = _bottomLeft.X;
             double y = _bottomLeft.Y;
             for (int stringNum = 0; stringNum < StringCount; stringNum++)
             {
                 PreviewLine line = _strings[stringNum] as PreviewLine;
                 var         y1   = (int)Math.Round(y, MidpointRounding.AwayFromZero);
                 line.SetPoint0(x, y1);
                 line.SetPoint1((x + width), y1);
                 line.Layout();
                 y -= stringYSpacing;
             }
         }
         SetPixelZoom();
     }
 }
Ejemplo n.º 5
0
        public override void Layout()
        {
            //int width = _bottomRight.X - _topLeft.X;
            //int height = _bottomRight.Y - _topLeft.Y;

            //List<Point> _topEllipsePoints;
            //List<Point> _baseEllipsePoints;

            //double _topLeftOffset = _topLeft.X + (width/2) - (_topWidth/2);
            //double bottomTopOffset = _bottomRight.Y - _baseHeight;

            //_topEllipsePoints = PreviewTools.GetEllipsePoints(_topLeftOffset, _topLeft.Y, _topWidth, _topHeight, _stringCount,
            //                                                  _degrees, 0);
            //_baseEllipsePoints = PreviewTools.GetEllipsePoints(_topLeft.X, bottomTopOffset, width, _baseHeight, _stringCount,
            //                                                   _degrees, 0);

            //_stringsInDegrees = (double) _stringCount*((double) _degrees/360);

            //for (int stringNum = 0; stringNum < (int) _stringCount; stringNum++) {
            //    if (stringNum < (int) _stringsInDegrees) {
            //        if (stringNum < _topEllipsePoints.Count()) {
            //            Point topPixel = _topEllipsePoints[stringNum];
            //            Point basePixel = _baseEllipsePoints[stringNum];

            //            PreviewLine line = _strings[stringNum] as PreviewLine;
            //            line.SetPoint0(basePixel.X, basePixel.Y);
            //            line.SetPoint1(topPixel.X, topPixel.Y);
            //            line.Layout();
            //        }
            //    }
            //}

            // DB: Added 8/4/2013
            int width  = _bottomRight.X - _topLeft.X;
            int height = _bottomRight.Y - _topLeft.Y;

            List <Point> _topEllipsePoints;
            List <Point> _baseEllipsePoints;

            double _topLeftOffset  = _topLeft.X + (width / 2) - (_topWidth / 2);
            double bottomTopOffset = _bottomRight.Y - _baseHeight;

            double totalStringsInEllipse = Math.Ceiling((360d / Convert.ToDouble(_degrees)) * Convert.ToDouble(StringCount));

            _topEllipsePoints = PreviewTools.GetEllipsePoints(_topLeftOffset,
                                                              _topLeft.Y,
                                                              _topWidth,
                                                              _topHeight,
                                                              totalStringsInEllipse,
                                                              _degrees,
                                                              0);
            _baseEllipsePoints = PreviewTools.GetEllipsePoints(_topLeft.X,
                                                               bottomTopOffset,
                                                               width,
                                                               _baseHeight,
                                                               totalStringsInEllipse,
                                                               _degrees,
                                                               0);

            for (int stringNum = 0; stringNum < (int)_stringCount; stringNum++)
            {
                if (stringNum < StringCount && stringNum < _topEllipsePoints.Count())
                {
                    Point topPixel  = _topEllipsePoints[_stringCount - 1 - stringNum];
                    Point basePixel = _baseEllipsePoints[_stringCount - 1 - stringNum];
                    //Console.WriteLine("topPixel " + topPixel.ToString() + ", basePixel " + basePixel.ToString());

                    PreviewLine line = _strings[stringNum] as PreviewLine;
                    line.SetPoint0(basePixel.X, basePixel.Y);
                    line.SetPoint1(topPixel.X, topPixel.Y);
                    line.Layout();
                }
            }
        }