Esempio n. 1
0
        public int GetShapeCenter(ISVGElement shape)
        {
            double centerX = 99999.0;
            double centerY = 99999.0;

            foreach (var contour in shape.GetContours())
            {
                foreach (PointF point in contour)
                {
                    if (point.X < centerX)
                    {
                        centerX = point.X;
                    }
                    if (point.Y < centerY)
                    {
                        centerY = point.Y;
                    }
                }
            }

            centerX = centerX * 10;
            centerY = centerY * 10;
            int x = (int)centerX / 1;
            int y = (int)centerY / 1;

            return(y * 10000 + x);
        }
Esempio n. 2
0
        public int GetShapeCenter(ISVGElement shape)
        {
            double centerX = 99999.0;
            double centerY = 99999.0;

            foreach (var contour in shape.GetContours())
            {
                foreach (PointF point in contour)
                {
                    if (point.X < centerX)
                    {
                        centerX = point.X;
                    }
                    if (point.Y < centerY)
                    {
                        centerY = point.Y;
                    }
                }
            }

            centerX = centerX * 10;
            centerY = centerY * 10;
            int x = (int)centerX / 1;
            int y = (int)centerY / 1;

            return y * 10000 + x;
        }