Exemplo n.º 1
0
 /// <summary>
 /// Disposes the resources used by the mask
 /// </summary>
 public void Dispose()
 {
     _surface.Dispose();
     _geometry.Dispose();
     _generator.DeviceReplaced -= OnDeviceReplaced;
     _surface   = null;
     _generator = null;
     _geometry  = null;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="generator">ICompositionMaskGeneratorInternal object</param>
 /// <param name="size">Size of the mask</param>
 /// <param name="geometry">Geometry of the mask</param>
 public CompositionMask(ICompositionMaskGeneratorInternal generator, Size size, CanvasGeometry geometry)
 {
     _generator = generator;
     // Create Mask Surface
     _surface  = _generator.CreateMaskSurface(size);
     Size      = _surface?.Size ?? Size.Empty;
     _geometry = geometry;
     // Subscribe to DeviceReplaced event
     _generator.DeviceReplaced += OnDeviceReplaced;
 }