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(); }
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(); }