Create an opacity mask
An opacity mask is a brush whose color is ignored and whose opacity is transferred to the masked object. Wherever the opacity mask is opaque, the masked object will be opaque; wherever the opacity mask is transparent, the masked object will be transparent. Any object can have an opacity mask defined for it through the Appearance section of the Properties panel.
To create an opacity mask on an object using a gradient brush
In the Tools panel, click Selection , and then select a path on the artboard.
Under Brush in the Properties panel, select OpacityMask from the list, and then click Gradient Brush, and then at the bottom of the color editor, select Linear gradient or Radial gradient.
To make sure that the mask allows at least a small portion of the object or objects behind to show through, define at least one gradient stop with an alpha value of less than 100 percent.
To create an opacity mask on an object using a brush resource
Create a Grid or other layout panel object on the artboard.
Double-click the panel object in order to activate it so that you can add child objects.
Add various child objects that will make up your opacity mask.
For all your objects, including the layout panel, adjust the Opacity property under Appearance in the Properties panel.
When you have completed your opacity mask design, select the layout panel in the Objects and Timeline panel, and then on the Tools menu, point to Make Brush Resource, and select one of the following available brush types:
Make Drawing Brush Resource A drawing brush paints an area with a drawing, which can include shapes, text, video, images, or other drawings.
Make Visual Brush Resource A visual brush paints an area with a visual that can be updated during runtime if the brush is created from a panel that contains animations or interactive controls. The Create Brush Resource dialog box appears.
[!REMARQUE]
A brush resource can be made from any object on the artboard, including art assets that are imported from Microsoft Expression Design. Remember that the colors of your brush will be ignored when applied as opacity mask, because only the opacity values create the masking effect.
The Create Brush Resource dialog box appears.
Under Resource name (Key), enter a key name. This is the name by which other objects can reference the resource, thus applying the resource to themselves.
Under Define in, select the option where you want the resource to be defined:
To make the resource available to any document in your application, select Application.
To make the resource available only to the current document, select This document (Window: Window).
To make the resource available only to the object from which you created the resource or its child objects, select This document (object).
To define the resource in a resource dictionary file that can be reused in other projects, select Resource dictionary. You can then select an existing resource dictionary file or create a New one.
Click OK to exit the dialog box and create the resource.
To apply the brush resource as an opacity mask on your object, you can do one of the following:
In the Resources panel, locate your brush resource, and then drag it onto the object on the artboard that you want to mask.
Select the object that you want to mask, and then under Brush in the Properties panel, click Brush resources and select your brush resource.