Description
The MatchSource
field is a member of the MaskMode
enumeration within the Sandbox.UI
namespace. It specifies how the mask values should be derived from the mask layer image based on the type of the mask-image property. If the mask-image property is of type 'mask-source', the luminance values of the mask layer image are used as the mask values. Conversely, if the mask-image property is of type 'image', the alpha values of the mask layer image are used as the mask values.
Usage
Use the MatchSource
field when you want the mask values to adapt based on the type of the mask-image property. This is particularly useful when you have a dynamic UI where the mask source type can change, and you want the mask application to automatically adjust to use either luminance or alpha values accordingly.
Example
// Example of using MaskMode.MatchSource in a UI component
var myComponent = new UIComponent();
myComponent.MaskMode = MaskMode.MatchSource;
// This will ensure that the mask values are derived from the luminance or alpha
// values of the mask layer image, depending on the mask-image property type.