

You can apply this same function to windowed controls, obtaining a fade-in effect instead of the usual direct appearance. The AnimateWindow API can also be used to control how the form is brought into view, starting from the center (with the AW_CENTER flag) or from one of its sides ( AW_HOR_POSITIVE, AW_HOR_NEGATIVE, AW_VER_POSITIVE, or AW_VER_NEGATIVE), as is common for slide shows.

You can also obtain a similar animation effect by changing the AlphaBlendValue property in a loop. Notice you have to call the Show method at the end for the form to behave properly. For example, instead of calling the Show method of a form, you can writeĪnimateWindow (Form3.Handle, 2000, AW_BLEND) Again, you can see an example of this effect in Figure 7.7.įinally, you can use a native Windows technique, animated display, which is not directly supported by Delphi (beyond the display of hints).

The actual transparent color is indicated by the TransparentColorValue property. Figure 7.7: The output of the ColorKeyHole, showing the effect of the new TransparentColor and AlphaBlend properties and the Animate-Window APIĪnother unusual Delphi feature is the TransparentColor boolean property, which allows you to indicate a transparent color that will be replaced by the background, creating a sort of hole in a form.
