예제 #1
0
 public MovingLogo(BitMap image, Color[] colors)
 {
     this.Image  = image;
     this.Colors = colors;
     this.Rect   = new RectDbl(0, -10, image.Width, image.Height);
     this._watch = Stopwatch.StartNew();
 }
예제 #2
0
        public void Rescale(RectDbl bounds, double scale)
        {
            this._bounds = bounds;
            this._scale  = scale;
            double ratio = Image.Width / Image.Height;

            Rect.Height = (Bounds.Diagonal / _scale / ratio);
            Rect.Width  = (Rect.Height * ratio);
            Rect.X      = Math.Min(Math.Max(Rect.X, 0), Bounds.Width - Rect.Width);
            Rect.Y      = Math.Min(Math.Max(Rect.Y, 0), Bounds.Height - Rect.Height);
            Animate();
        }