Beispiel #1
0
        public virtual int CreateGradientStopCollection(
            ref D2D1_GRADIENT_STOP gradientStops,
            uint gradientStopsCount,
            D2D1_GAMMA colorInterpolationGamma,
            D2D1_EXTEND_MODE extendMode,
            out ID2D1GradientStopCollection gradientStopCollection
            )
        {
            var fp = GetFunctionPointer(9);

            if (m_CreateGradientStopCollectionFunc == null)
            {
                m_CreateGradientStopCollectionFunc = (CreateGradientStopCollectionFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateGradientStopCollectionFunc));
            }
            gradientStopCollection = new ID2D1GradientStopCollection();
            return(m_CreateGradientStopCollectionFunc(m_ptr, ref gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, out gradientStopCollection.PtrForNew));
        }
 public int CreateGradientStopCollection([NativeTypeName("const D2D1_GRADIENT_STOP *")] D2D1_GRADIENT_STOP *gradientStops, [NativeTypeName("UINT32")] uint gradientStopsCount, D2D1_GAMMA colorInterpolationGamma, D2D1_EXTEND_MODE extendMode, [NativeTypeName("ID2D1GradientStopCollection **")] ID2D1GradientStopCollection **gradientStopCollection)
 {
     return(((delegate * stdcall <ID2D1BitmapRenderTarget *, D2D1_GRADIENT_STOP *, uint, D2D1_GAMMA, D2D1_EXTEND_MODE, ID2D1GradientStopCollection **, int>)(lpVtbl[9]))((ID2D1BitmapRenderTarget *)Unsafe.AsPointer(ref this), gradientStops, gradientStopsCount, colorInterpolationGamma, extendMode, gradientStopCollection));
 }
Beispiel #3
0
        public static IComObject <ID2D1GradientStopCollection> CreateGradientStopCollection(this ID2D1RenderTarget context, IEnumerable <D2D1_GRADIENT_STOP> stops, D2D1_GAMMA gamma = D2D1_GAMMA.D2D1_GAMMA_2_2, D2D1_EXTEND_MODE extendMode = D2D1_EXTEND_MODE.D2D1_EXTEND_MODE_CLAMP)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

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

            var finalStops = stops.ToArray();

            if (finalStops.Length == 0)
            {
                throw new ArgumentException(null, nameof(stops));
            }

            context.CreateGradientStopCollection(finalStops, finalStops.Length, gamma, extendMode, out var stps).ThrowOnError();
            return(new ComObject <ID2D1GradientStopCollection>(stps));
        }
Beispiel #4
0
 public static IComObject <ID2D1GradientStopCollection> CreateGradientStopCollection(this IComObject <ID2D1RenderTarget> context, IEnumerable <D2D1_GRADIENT_STOP> stops, D2D1_GAMMA gamma = D2D1_GAMMA.D2D1_GAMMA_2_2, D2D1_EXTEND_MODE extendMode = D2D1_EXTEND_MODE.D2D1_EXTEND_MODE_CLAMP) => CreateGradientStopCollection(context?.Object, stops, gamma, extendMode);