Beispiel #1
0
 public virtual void Draw(IGraphicContext graphicContext)
 {
     lock (this)
     {
         graphicContext.FillColor(this.displayModel.BackgroundColor);
         if (this.bitmap1 != null)
         {
             graphicContext.DrawBitmap(this.bitmap1, this.matrix);
         }
     }
 }
Beispiel #2
0
        /// <summary>
        /// Called from <seealso cref="MapView"/>
        /// </summary>
        /// <param name="graphicContext">
        ///            The graphicContext to use to draw the MapScaleBar </param>
        public virtual void Draw(IGraphicContext graphicContext)
        {
            if (!this.visible)
            {
                return;
            }

            if (this.mapViewDimension.Dimension == null)
            {
                return;
            }

            if (this.RedrawNecessary)
            {
                Redraw(this.mapScaleCanvas);
                this.redrawNeeded = false;
            }

            int positionLeft = CalculatePositionLeft(0, this.mapViewDimension.Dimension.Width, this.mapScaleBitmap.Width);
            int positionTop  = CalculatePositionTop(0, this.mapViewDimension.Dimension.Height, this.mapScaleBitmap.Height);

            graphicContext.DrawBitmap(this.mapScaleBitmap, positionLeft, positionTop);
        }
Beispiel #3
0
        public virtual void Draw(IGraphicContext graphicContext)
        {
            if (!this.visible)
            {
                return;
            }

            long currentTime = System.DateTime.Now.Ticks;
            long elapsedTime = currentTime - this.lastTime;

            if (elapsedTime > ONE_SECOND)
            {
                this.fps          = Math.Round((float)(this.frameCounter * ONE_SECOND) / elapsedTime).ToString();
                this.lastTime     = currentTime;
                this.frameCounter = 0;
            }

            int x = (int)(20 * displayModel.ScaleFactor);
            int y = (int)(40 * displayModel.ScaleFactor);

            graphicContext.DrawText(this.fps, x, y, this.paintBack);
            graphicContext.DrawText(this.fps, x, y, this.paintFront);
            ++this.frameCounter;
        }