.
In Depth Banner
Skip Navigation Links

Select your preferred language

The Barn-Door case.

        case TransitionTypes.BarnDoor:

          //has the effect of a barn door closing over the image

          //First, the left-side is drawn

          //then the right side

          e.Graphics.DrawImage(

            _imageB,

            new Rectangle(

            0,

            0,

            (int)(this.Width*_currentPercentage/200),

            this.Height),

            0,0,_imageB.Width/2,_imageB.Height,

            GraphicsUnit.Pixel);

          //then the right side

          e.Graphics.DrawImage(

            _imageB,

            new Rectangle(

            (int)(this.Width-(this.Width*_currentPercentage/200)),

            0,

            (int)(this.ClientRectangle.Width*_currentPercentage/200),

            this.ClientRectangle.Height),

            _imageB.Width/2,0,_imageB.Width/2,_imageB.Height,

            GraphicsUnit.Pixel);

          break;

 

Return to the article

Copyright © Bob Powell 2000-.  All rights reserved.