Example #1
0
        public override void Draw(Graphics g)
        {
            var rect  = GetTextRenderRect();
            var rectF = RectangleFUtil.ToRectangleF(rect);

            if (FillBrush != null)
            {
                g.FillRectangle(FillBrush, rectF);
            }

            if (Pen != null)
            {
                g.DrawString(Text, Font, Pen.Brush, rectF, GetStringFormat());
            }
            else
            {
                Log.Warn("Can not draw text since Pen is Null!");
            }
        }
Example #2
0
        public override void Draw(Graphics g)
        {
            try
            {
                var bounds = RectangleFUtil.ToRectangleF(_circle.BoundingBox);

                if (this.FillBrush != null)
                {
                    g.FillEllipse(this.FillBrush, bounds);
                }
                if (this.Pen != null)
                {
                    g.DrawArc(this.Pen, bounds, 0, 360);
                }
            }
            catch (Exception)
            {
                //ignore
            }
        }