Exemplo n.º 1
0
        public static IComObject <ID2D1RadialGradientBrush> CreateRadialGradientBrush(this ID2D1RenderTarget context, D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES gradientBrushProperties, ID2D1GradientStopCollection stops, D2D1_BRUSH_PROPERTIES?brushProperties = null)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (stops == null)
            {
                throw new ArgumentNullException(nameof(stops));
            }

            using (var props = brushProperties.StructureToMemory())
            {
                context.CreateRadialGradientBrush(gradientBrushProperties, props.Pointer, stops, out var brush).ThrowOnError();
                return(new ComObject <ID2D1RadialGradientBrush>(brush));
            }
        }
Exemplo n.º 2
0
 public static IComObject <ID2D1RadialGradientBrush> CreateRadialGradientBrush(this IComObject <ID2D1RenderTarget> context, D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES gradientBrushProperties, IComObject <ID2D1GradientStopCollection> stops, D2D1_BRUSH_PROPERTIES?brushProperties = null) => CreateRadialGradientBrush(context?.Object, gradientBrushProperties, stops?.Object, brushProperties);