Exemplo n.º 1
0
 public DisplayItemText(String str, GePoint Position, Font font)
 {
     m_String = str;
     m_Position = Position;
     m_Font = font;
     m_Range = new GeRectangle();
 }
Exemplo n.º 2
0
 public GeRectangle(GeRectangle src)
 {
     if(src != null)
     {
         m_MinPoint = new GePoint(src.MinPoint);
         m_MaxPoint = new GePoint(src.m_MaxPoint);
     }
 }
Exemplo n.º 3
0
        public override void DrawArc(GeRectangle rect
            , float startAngle, float endAngle)
        {
            RectangleF rc = new RectangleF((float)rect.MinPoint.X,
                (float)rect.MinPoint.Y, (float)rect.Width,
                (float)rect.Height);

            Pen pen = GetPen();

            m_Graphics.DrawArc(pen, rc, startAngle, endAngle);
        }
Exemplo n.º 4
0
        public static void GenDisplayItemLines(DisplayItemList DLList, GeRectangle rec)
        {
            Debug.Assert(DLList != null && rec != null);
            if (null == DLList || null == rec) return;

            GePoint MinPoint = rec.MinPoint;
            GePoint MaxPoint = rec.MaxPoint;
            GePoint Corner1 = new GePoint(MinPoint.X, MaxPoint.Y);
            GePoint Corner2 = new GePoint(MaxPoint.X, MinPoint.Y);

            // Add the bounding of the rectangular.
            GenDisplayItemLine(DLList, Corner1, MinPoint);
            GenDisplayItemLine(DLList, MinPoint, Corner2);
            GenDisplayItemLine(DLList, Corner2, MaxPoint);
            GenDisplayItemLine(DLList, MaxPoint, Corner1);
            DLList.AddItem(new DisplayItemPoint(MinPoint));
            DLList.AddItem(new DisplayItemPoint(MaxPoint));
            DLList.AddItem(new DisplayItemPoint(Corner1));
            DLList.AddItem(new DisplayItemPoint(Corner2));
        }
Exemplo n.º 5
0
        public override GeRectangle GetRange(String str, Font font)
        {
            // Measure string.
            SizeF stringSize = m_Graphics.MeasureString(
                   str, font);

            GeRectangle rec = new GeRectangle(new GePoint(0, 0)
                , new GePoint(stringSize.Width, stringSize.Height));
            return rec;
        }
Exemplo n.º 6
0
 public override void FillEllipse(
     GeRectangle rect)
 {
     RectangleF rc = new RectangleF((float)rect.MinPoint.X,
         (float)rect.MinPoint.Y, (float)rect.Width,
         (float)rect.Height);
     FillEllipse(rc);
 }
Exemplo n.º 7
0
        public GeRectangle GetRichStringRange(RichString str)
        {
            Graphics gp = GetGDIGraphics();

            // Measure string.
            SizeF stringSize = new SizeF();

            FontManager manager = PtApp.ActiveDocument.GetFontManager();

            Font StrFont = null;
            if (str.FontID != -1)
                StrFont = manager.GetFont(str.FontID);
            else
                StrFont = manager.GetApplicationDefaultFont();

            // Device coordinates
            stringSize = gp.MeasureString(
                   str.GetString(), StrFont);

            // Defect - We should convert to World coordinates here.
            GeRectangle rec = new GeRectangle(new GePoint(0, 0)
                , new GePoint(stringSize.Width, stringSize.Height));
            return rec;
        }
Exemplo n.º 8
0
 public override void FillEllipse(
     GeRectangle rect)
 {
     Debug.Assert(false, "NO IMP");
 }
Exemplo n.º 9
0
 public override void DrawArc(GeRectangle rect
     , float startAngle, float endAngle)
 {
     Debug.Assert(false, "NO IMP");
 }
Exemplo n.º 10
0
        // This routine should be update by using OpenGL
        public override GeRectangle GetRange(String str, Font font)
        {
            Debug.Assert(false, "NO IMP");
            // Measure string.
            SizeF stringSize = new SizeF();

            GeRectangle rec = new GeRectangle(new GePoint(0, 0)
                , new GePoint(stringSize.Width, stringSize.Height));
            return rec;
        }
Exemplo n.º 11
0
        public static DisplayItemText GenDisplayItemText(DisplayItemList list, RichString str, GePoint position, GeRectangle rec)
        {
            //GeRectangle rec = PtApp.ActiveView.GetRichStringRange(str);

            DisplayItemText DLText = new DisplayItemText(str.GetString(), position,
                str.GetFont());
            DLText.Range = rec;

            if (list != null)
                list.AddItem(DLText);

            return DLText;
        }
Exemplo n.º 12
0
 public abstract void FillEllipse(
     GeRectangle rect);
Exemplo n.º 13
0
 public abstract void DrawArc(GeRectangle rect
     , float startAngle, float endAngle);