Ejemplo n.º 1
0
        private RectangleF GetRect(string s, int i)
        {
            SizeF     sf = ObjectFont.Measure(CurrentGraphics, s);
            Rectangle R  = Area.Canvas.Rect;

            return(new RectangleF(pfStart[i].X, R.Top, sf.Width, R.Height));
        }
Ejemplo n.º 2
0
        public virtual RectangleF GetTextRect(int LineNumber, bool Horizon)
        {
            if (CurrentGraphics != null)
            {
                SizeF      sf = ObjectFont.Measure(CurrentGraphics, GetStr());
                RectangleF R  = RectangleF.Empty;
                if (Horizon)
                {
                    R = new RectangleF(
                        pfStart[LineNumber].X, pfStart[LineNumber].Y - sf.Height,
                        pfEnd[LineNumber].X - pfStart[LineNumber].X, sf.Height * 2);
                }
                else
                {
                    R = new RectangleF(
                        pfStart[LineNumber].X - sf.Width, pfStart[LineNumber].Y,
                        sf.Width * 2, pfEnd[LineNumber].Y - pfStart[LineNumber].Y);
                }
                if (R.Width < 0)
                {
                    R.X    += R.Width;
                    R.Width = -R.Width;;
                }
                if (R.Height < 0)
                {
                    R.Y     += R.Height;
                    R.Height = -R.Height;
                }
                R.Width  = Math.Max(R.Width, sf.Width);
                R.Height = Math.Max(R.Height, sf.Height);

                return(R);
            }
            return(RectangleF.Empty);
        }
Ejemplo n.º 3
0
        private RectangleF GetRect(int i)
        {
            SizeF sf = ObjectFont.Measure(CurrentGraphics, GetStr(i));
            float X  = Math.Min(pfStart[i].X, pfEnd[i].X);
            float Y  = pfStart[i].Y;
            float W  = Math.Max(Math.Abs(pfStart[i].X - pfEnd[i].X), sf.Width);
            float H  = sf.Height;

            return(new RectangleF(X, Y, W, H));
        }