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

            //画图片
            base.Draw(g);
        }
Beispiel #3
0
 public override void Draw(GraphicsBase g)
 {
     lock (_lockObj)
     {
         if (this.Background != null)
         {
             g.DrawImage(Background, this.Location);
         }
         //画图片
         base.Draw(g);
     }
 }
        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;
        }
        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));
        }
Beispiel #6
0
 public override void Draw(GraphicsBase g)
 {
     this.Content = DateTime.Now.ToString(this.Formate);
     base.Draw(g);
 }
Beispiel #7
0
 public override void Draw(GraphicsBase g)
 {
     g.DrawString(this.Content, this.Font, this.Brush, new PointF(Location.X, Location.Y));
 }