示例#1
0
        public override void Draw(Graphics g, VisualGraph drawArea)
        {
            Pen pen = new Pen(Color, PenWidth);

            g.DrawEllipse(pen, DrawRectangle.GetNormalizedRectangle(ShapeRect));
            pen.Dispose();
        }
示例#2
0
文件: DrawText.cs 项目: sjyfok/cpp
        public override void Draw(Graphics g, VisualGraph drawArea)
        {
            SolidBrush drawBrush = new SolidBrush(Color.Black);
            Pen        fontPen   = new Pen(Color, PenWidth);

            if (_stringFormat == null)
            {
                _stringFormat               = new StringFormat();
                _stringFormat.Alignment     = StringAlignment.Center;
                _stringFormat.LineAlignment = StringAlignment.Center;
            }
            Font drawFont = new Font("Arial", 12);

            g.DrawString(CurText, drawFont, drawBrush, ShapeRect, _stringFormat);
            if (_Show)
            {
                g.DrawRectangle(fontPen, DrawRectangle.GetNormalizedRectangle(ShapeRect));
            }
            drawFont.Dispose();
            drawBrush.Dispose();
            fontPen.Dispose();
        }
 public override void Normalize()
 {
     ShapeRect = DrawRectangle.GetNormalizedRectangle(ShapeRect);
 }