Esempio n. 1
0
 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
     {
     }
 }
Esempio n. 2
0
 protected virtual void OnTransformNeeded(object sender, TransfromNeededEventArg e)
 {
     if (this.TransfromNeeded != null)
     {
         this.TransfromNeeded(this, e);
     }
     else
     {
         e.UseDefaultMatrix = true;
     }
 }
Esempio n. 3
0
        public static void DoRotate(TransfromNeededEventArg e, Animation animation)
        {
            Rectangle clientRectangle = e.ClientRectangle;
            PointF    tf = new PointF((float)(clientRectangle.Width / 2), (float)(clientRectangle.Height / 2));

            e.Matrix.Translate(tf.X, tf.Y);
            if (e.CurrentTime > animation.RotateLimit)
            {
                e.Matrix.Rotate((360f * (e.CurrentTime - animation.RotateLimit)) * animation.RotateCoeff);
            }
            e.Matrix.Translate(-tf.X, -tf.Y);
        }
Esempio n. 4
0
        public static void DoScale(TransfromNeededEventArg e, Animation animation)
        {
            Rectangle clientRectangle = e.ClientRectangle;
            PointF    tf = new PointF((float)(clientRectangle.Width / 2), (float)(clientRectangle.Height / 2));

            e.Matrix.Translate(tf.X, tf.Y);
            float num  = 1f - (animation.ScaleCoeff.X * e.CurrentTime);
            float num2 = 1f - (animation.ScaleCoeff.X * e.CurrentTime);

            if (Math.Abs(num) <= 0.001f)
            {
                num = 0.001f;
            }
            if (Math.Abs(num2) <= 0.001f)
            {
                num2 = 0.001f;
            }
            e.Matrix.Scale(num, num2);
            e.Matrix.Translate(-tf.X, -tf.Y);
        }
 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);
 }
Esempio n. 6
0
 public static void DoSlide(TransfromNeededEventArg e, Animation animation)
 {
     float currentTime = e.CurrentTime;
     e.Matrix.Translate((-e.ClientRectangle.Width * currentTime) * animation.SlideCoeff.X, (-e.ClientRectangle.Height * currentTime) * animation.SlideCoeff.Y);
 }
Esempio n. 7
0
 public static void DoScale(TransfromNeededEventArg e, Animation animation)
 {
     Rectangle clientRectangle = e.ClientRectangle;
     PointF tf = new PointF((float)(clientRectangle.Width / 2), (float)(clientRectangle.Height / 2));
     e.Matrix.Translate(tf.X, tf.Y);
     float num = 1f - (animation.ScaleCoeff.X * e.CurrentTime);
     float num2 = 1f - (animation.ScaleCoeff.X * e.CurrentTime);
     if (Math.Abs(num) <= 0.001f)
     {
         num = 0.001f;
     }
     if (Math.Abs(num2) <= 0.001f)
     {
         num2 = 0.001f;
     }
     e.Matrix.Scale(num, num2);
     e.Matrix.Translate(-tf.X, -tf.Y);
 }
Esempio n. 8
0
 public static void DoRotate(TransfromNeededEventArg e, Animation animation)
 {
     Rectangle clientRectangle = e.ClientRectangle;
     PointF tf = new PointF((float)(clientRectangle.Width / 2), (float)(clientRectangle.Height / 2));
     e.Matrix.Translate(tf.X, tf.Y);
     if (e.CurrentTime > animation.RotateLimit)
     {
         e.Matrix.Rotate((360f * (e.CurrentTime - animation.RotateLimit)) * animation.RotateCoeff);
     }
     e.Matrix.Translate(-tf.X, -tf.Y);
 }
 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
     {
     }
 }
Esempio n. 11
0
        public static void DoSlide(TransfromNeededEventArg e, Animation animation)
        {
            float currentTime = e.CurrentTime;

            e.Matrix.Translate((-e.ClientRectangle.Width * currentTime) * animation.SlideCoeff.X, (-e.ClientRectangle.Height * currentTime) * animation.SlideCoeff.Y);
        }
Esempio n. 12
0
 protected virtual void OnTransformNeeded(object sender, TransfromNeededEventArg e)
 {
     if (this.TransfromNeeded != null)
     {
         this.TransfromNeeded(this, e);
     }
     else
     {
         e.UseDefaultMatrix = true;
     }
 }