Ejemplo n.º 1
0
 public virtual void Draw(GraphicsBase g)
 {
     foreach (var item in _dic.Values)
     {
         item.Draw(g);
     }
 }
Ejemplo n.º 2
0
        public override void Draw(GraphicsBase g)
        {
            if (this.Image != null)
            {
                g.DrawImage(this.Image, this.Location);
            }

            //画图片
            base.Draw(g);
        }
Ejemplo n.º 3
0
 public override void Draw(GraphicsBase g)
 {
     lock (_lockObj)
     {
         if (this.Background != null)
         {
             g.DrawImage(Background, this.Location);
         }
         //画图片
         base.Draw(g);
     }
 }
Ejemplo n.º 4
0
        public override void Draw(GraphicsBase g)
        {
            if (LastDrawTime == DateTime.MinValue)
            {
                LastDrawTime = DateTime.Now;
            }
            Point newPoint = RePoint(g);

            g.DrawString(this.Content, this.Font, this.Brush, newPoint);

            LastPoint    = newPoint;
            LastDrawTime = DateTime.Now;
        }
Ejemplo n.º 5
0
        public Point RePoint(GraphicsBase g)
        {
            if (this.FontSizeF == SizeF.Empty)
            {
                this.FontSizeF = g.MeasureString(this.Content, this.Font);
            }
            int offset = (int)((DateTime.Now - LastDrawTime).TotalMilliseconds / this.ScrollDelay) + 1;
            int x      = (int)(LastPoint.X - ((Direction == Direction.Left) ? offset : 0));
            int y      = (int)(LastPoint.Y - ((Direction == Direction.Down) ? offset : 0));

            if (x + this.FontSizeF.Width < this.Location.X)
            {
                x = this.Location.X + this.Size.Width;
            }
            if (y + this.FontSizeF.Height < this.Location.X)
            {
                y = this.Location.Y + this.Size.Height;
            }
            return(new Point(x, y));
        }
Ejemplo n.º 6
0
 public override void Draw(GraphicsBase g)
 {
     g.DrawString(this.Content, this.Font, this.Brush, new PointF(Location.X, Location.Y));
 }
Ejemplo n.º 7
0
 public override void Draw(GraphicsBase g)
 {
     this.Content = DateTime.Now.ToString(this.Formate);
     base.Draw(g);
 }