Exemple #1
0
        private void FlyIn()
        {
            if (currentIndex > -1)
            {
                currentImgRect = ImageDisplayModeHelper.GetImageRect(
                    this.ClientRectangle,
                    new Rectangle(Point.Empty, imgs[currentIndex].Size),
                    DisplayMode.ScaleLossLessCenter);
                direction   = -1;
                s           = (int)(0.5 * (this.Width + currentImgRect.Width));
                vCurrentHor = s / step + ((s % step == 0) ? 0 : 1);
            }

            //
            newImgRect = ImageDisplayModeHelper.GetImageRect(
                this.ClientRectangle,
                new Rectangle(Point.Empty, imgs[newIndex].Size),
                DisplayMode.ScaleLossLessCenter);

            int offsetSizeHor = 40;
            int offsetSizeVer = (int)(offsetSizeHor * 1f * newImgRect.Height / newImgRect.Width);

            vNewHor    = 1f * offsetSizeHor / step;
            vNewVer    = 1f * offsetSizeVer / step;
            newImgRect = newImgRect.AdjustSizeFromCenter(-offsetSizeHor, -offsetSizeVer);
            flyinAnim.Start();
        }
Exemple #2
0
        private void FlyOut()
        {
            // setup to reduce size of new image
            currentImgRect = ImageDisplayModeHelper.GetImageRect(
                this.ClientRectangle,
                new Rectangle(Point.Empty, imgs[currentIndex].Size),
                DisplayMode.ScaleLossLessCenter);
            int offsetSizeHor = 40;
            int offsetSizeVer = (int)(offsetSizeHor * 1f * currentImgRect.Height / currentImgRect.Width);

            vNewHor = -1f * offsetSizeHor / step;
            vNewVer = -1f * offsetSizeVer / step;

            //
            newImgRect = ImageDisplayModeHelper.GetImageRect(
                this.ClientRectangle,
                new Rectangle(Point.Empty, imgs[newIndex].Size),
                DisplayMode.ScaleLossLessCenter);
            // setup prev image on the left
            newImgRect = newImgRect.AdjustXF(-newImgRect.Right);
            // and move direction is to the right
            direction   = 1;
            s           = (int)(0.5 * (this.Width + newImgRect.Width));
            vCurrentHor = s / step;

            flyoutAnim.Start();
        }
Exemple #3
0
 private void RecalcImageRect()
 {
     currentImgRect = ImageDisplayModeHelper.GetImageRect(
         this.ClientRectangle,
         new Rectangle(Point.Empty, imgs[currentIndex].Size),
         DisplayMode.ScaleLossLessCenter);
     newImgRect = Rectangle.Empty;
 }