private void OnTransfromNeeded(TransfromNeededEventArg ea) { if (this.TransfromNeeded != null) { this.TransfromNeeded(this, ea); } }
protected virtual void OnTransfromNeeded(object sender, TransfromNeededEventArg e) { try { e.ClipRectangle = this.clipRect; e.CurrentTime = this.CurrentTime; if (this.TransfromNeeded != null) { this.TransfromNeeded(this, e); } else { e.UseDefaultMatrix = true; } if (e.UseDefaultMatrix) { TransfromHelper.DoScale(e, this.animation); TransfromHelper.DoRotate(e, this.animation); TransfromHelper.DoSlide(e, this.animation); } } catch { } }
protected override void OnPaint(PaintEventArgs e) { Graphics graphics = e.Graphics; this.OnFramePainting(e); try { graphics.DrawImage((Image)this.bgBmp, 0, 0); if (this.frame != null) { TransfromNeededEventArg ea = new TransfromNeededEventArg { ClientRectangle = new Rectangle(0, 0, base.Width, base.Height) }; this.OnTransfromNeeded(ea); graphics.SetClip(ea.ClipRectangle); graphics.Transform = ea.Matrix; graphics.DrawImage((Image)this.frame, 0, 0); } } catch { } this.OnFramePainted(e); }
protected virtual void OnTransformNeeded(object sender, TransfromNeededEventArg e) { if (this.TransfromNeeded != null) { this.TransfromNeeded(this, e); } else { e.UseDefaultMatrix = true; } }
/// <summary> /// Handles TransfromNeeded event /// </summary> private void animator_TransfromNeeded(object sender, TransfromNeededEventArg e) { if (rbCustom.Checked) { var cy = e.ClientRectangle.Height / 2; var sy = 1 - 2 * e.CurrentTime; if (sy < 0.01f && sy > -0.01f) { sy = 0.01f; } e.Matrix.Translate(0, cy); e.Matrix.Scale(1, sy); e.Matrix.Translate(0, -cy); } else { e.UseDefaultMatrix = true; } }