public void FillOpacityMask(D2D1Bitmap opacityMask, D2D1Brush brush, D2D1OpacityMaskContent content, D2D1RectF destinationRectangle, D2D1RectF sourceRectangle) { if (opacityMask == null) { throw new ArgumentNullException("opacityMask"); } if (brush == null) { throw new ArgumentNullException("brush"); } GCHandle destinationRectangleHandle = GCHandle.Alloc(destinationRectangle, GCHandleType.Pinned); GCHandle sourceRectangleHandle = GCHandle.Alloc(sourceRectangle, GCHandleType.Pinned); try { this.GetHandle<ID2D1RenderTarget>().FillOpacityMask(opacityMask.GetHandle<ID2D1Bitmap>(), brush.GetHandle<ID2D1Brush>(), content, destinationRectangleHandle.AddrOfPinnedObject(), sourceRectangleHandle.AddrOfPinnedObject()); } finally { destinationRectangleHandle.Free(); sourceRectangleHandle.Free(); } }
public void FillOpacityMask(D2D1Bitmap opacityMask, D2D1Brush brush, D2D1OpacityMaskContent content) { if (opacityMask == null) { throw new ArgumentNullException("opacityMask"); } if (brush == null) { throw new ArgumentNullException("brush"); } this.GetHandle<ID2D1RenderTarget>().FillOpacityMask(opacityMask.GetHandle<ID2D1Bitmap>(), brush.GetHandle<ID2D1Brush>(), content, IntPtr.Zero, IntPtr.Zero); }