예제 #1
0
        protected override void DrawBackground(
            IDrawContext drawContext,
            Rectangle bounds)
        {
            Rectangle textBounds = new Rectangle(bounds.X, bounds.Y, bounds.Width, bounds.Height);

            if (this.IsEnabled)
            {
                base.DrawBackground(drawContext, bounds);

                var foregroundColor = this.ForegroundColor;
                if (foregroundColor.HasValue)
                {
                    drawContext.DrawText(this.Text, textBounds, foregroundColor.Value, this._textFormat);
                }
            }
            else
            {
                drawContext.Clear(Colors.Transparent);

                var foregroundColor = this.DisabledColor;
                if (foregroundColor.HasValue)
                {
                    drawContext.DrawText(this.Text, textBounds, foregroundColor.Value, this._textFormat);
                }
            }
        }
예제 #2
0
        public void InvokeDrawBackground(
            IDrawContext drawContext,
            Rectangle bounds)
        {
            drawContext.Clear(Colors.Transparent);

            if (null != this._bitmap)
            {
                ((DrawContext)drawContext).DrawImage(
                    this._bitmap,
                    new Rectangle(0, 0, (float)this._xamlImage.ActualWidth, (float)this._xamlImage.ActualHeight),
                    this._tintColor);
            }
        }
예제 #3
0
        /// <summary>
        /// 描画
        /// </summary>
        /// <param name="context"></param>
        public void Draw(IDrawContext context)
        {
            context.Clear();
            context.PlotArea = plotArea;

            //context.DrawRect(plotArea, 1, System.Drawing.Color.Gray, System.Drawing.Color.Gray);

            axisX?.Draw(context);
            axisY1?.Draw(context);
            axisY2?.Draw(context);
            foreach (var s in seriesList)
            {
                s.Item2.Draw(context, AxisX, s.Item1 == AxisType.YLeft ? AxisY1 : AxisY2);
            }

            if (drawObjs != null)
            {
                foreach (var obj in drawObjs)
                {
                    obj.Draw(context);
                }
            }
        }
예제 #4
0
 protected virtual void DrawBackground(
     IDrawContext drawContext,
     Rectangle bounds)
 {
     drawContext.Clear(this.BackgroundColor);
 }