Set Opacity Mask

[ ]

Set Opacity Mask Object

It is possible to set opacity mask on an XPS document. Aspose.Page for C++ can be used to create/read an XPS document and set Opacity mask on such documents. The API uses image as an opacity mask where the Alpha component of each pixel is used to apply over underlying fill. The resultant XPS document will show slanting gradient stripes as present over source image file. To set the opacity mask on an XPS document, the following steps can be used.

  1. Create a new object of XpsDocument class
  2. Add a canvas to the document object using the XpsCanvas class
  3. Create an object XpsPath class with required parameters
  4. Set the opacity mask on the path
  5. Create an XpsImageBrush class object
  6. Save the document to disc using Save method