![]() ![]() First you need an object implementing the ICompositionGenerator interface. Using CompositionProToolkit you can now define a mask for the Visual using Win2D's CanvasGeometry. ![]() ![]() In this image, the areas which are to masked in the Visual are transparent whereas the areas to be shown in the Visual are white. Into the CompositionSurfaceBrush, an image, which defines the mask, is loaded. In the CompositionMaskBrush the Mask is defined by a CompositionSurfaceBrush. The mask is defined using a CompositionMaskBrush. Creating custom shaped Visual using CanvasGeometryĪs of now, you can customize the shape of Visuals by applying a mask on the Visual. IImageMaskSurface - This interface is used for creating a mask using the alpha values of the image pixels.Ģ.IImageSurface - This interface is used for rendering images onto ICompositionSurface.IGeometrySurface - This interface is used for rendering custom shaped geometries onto ICompositionSurface.You can apply a Gaussian Blur to the mask. IGaussianMaskSurface - This interface derives from IMaskSurface and is used for rendering custom shaped geometries onto ICompositionSurface so that they can be useds as masks on Composition Visuals.IMaskSurface - This interface is used for rendering custom shaped geometries onto ICompositionSurface so that they can be useds as masks on Composition Visuals.It mainly contains references to an ICompositionGenerator object and an ICompositionSurface object which are the core objects required for rendering any geometry or image onto a ICompositionSurface. IRenderSurface - This interface acts as the base interface for interfaces which render to the ICompositionSurface.Rendering SurfacesĬompositionProToolkit provides five types of rendering surface interfaces which can be used for, rendering custom shapes and images or creating masks from geometric shapes or images. Install-Package CompositionProToolkit.Controls -Version 1.0.1 To install CompositionProToolkit, run the following command in the Package Manager Console It also contains several controls which can be used in UWP applications. Guidelines for Disposing ImageFrame effectivelyĬompositionProToolkit is a collection of helper classes for the Windows.UI.Composition namespace and the Win2d project.Creating multilayer Vector shapes with CanvasElement.From Hexadecimal Color String or High Dynamic Range Color String.Parsing Win2d Mini Language with CanvasObject.Creating the Reflection of a ContainerVisual Using the Alpha values of an Image to create an IImageMaskSurface Loading Images on Visual using IImageSurface Creating a blurred mask using IGaussianMaskSurface Creating a Frosted Glass Effect Brush using IMaskSurface Creating Masked Backdrop Brush using IMaskSurface Creating custom shaped Visual using CanvasGeometry CompositionProToolkit.Controls - contains UI controls made using Composition.CompositionProToolkit - contains the core helper classes for Composition and Win2d.The project is split into two Nuget packages CompositioProToolkit v1.0.1 is built using Windows Insider SDK 18362 and is based on v6.2.1. ![]()
0 Comments
Leave a Reply. |