Compartir a través de


AmbientAttributes.alphaBlendTo

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The alphaBlendTo method adjusts the alphaBlend property over a period of time.

        elementID.alphaBlendTo(newVal, alphaTime)

Parameters

newVal

Number (long) specifying the new opacity value. Ranges from 0 (no opacity) to 255 (full opacity).

alphaTime

Number (long) specifying the time, in milliseconds, that it takes the element to change opacity.

Return Value

This method does not return a value.

Remarks

This method is useful for making elements gradually appear or disappear.

When you use alphaBlendTo with a TEXT element that does not have the backgroundColor specified, a background color of black will be used. If the foreground color is also black (which is the default value for TEXT.foregroundColor), your text may become unreadable. To prevent this, always specify the backgroundColor attribute, or set foregroundColor to a color other than black.

Note

This attribute is not supported in Windows 98.

Requirements

Requirement Value
Version
Windows Media Player 9 Series or later

See also

Ambient Attributes

AmbientAttributes.alphaBlend

TEXT Element

TEXT.backgroundColor

TEXT.foregroundColor