public virtual int CreateCompatibleRenderTarget(
            ref D2D_SIZE_F desiredSize,
            ref D2D_SIZE_U desiredPixelSize,
            ref D2D1_PIXEL_FORMAT desiredFormat,
            D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options,
            out ID2D1BitmapRenderTarget bitmapRenderTarget
            )
        {
            var fp = GetFunctionPointer(12);

            if (m_CreateCompatibleRenderTargetFunc == null)
            {
                m_CreateCompatibleRenderTargetFunc = (CreateCompatibleRenderTargetFunc)Marshal.GetDelegateForFunctionPointer(fp, typeof(CreateCompatibleRenderTargetFunc));
            }
            bitmapRenderTarget = new ID2D1BitmapRenderTarget();
            return(m_CreateCompatibleRenderTargetFunc(m_ptr, ref desiredSize, ref desiredPixelSize, ref desiredFormat, options, out bitmapRenderTarget.PtrForNew));
        }
 public int CreateCompatibleRenderTarget([NativeTypeName("D2D1_SIZE_F")] D2D_SIZE_F desiredSize, [NativeTypeName("D2D1_SIZE_U")] D2D_SIZE_U desiredPixelSize, D2D1_PIXEL_FORMAT desiredFormat, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options, [NativeTypeName("ID2D1BitmapRenderTarget **")] ID2D1BitmapRenderTarget **bitmapRenderTarget)
 {
     return(CreateCompatibleRenderTarget(&desiredSize, &desiredPixelSize, &desiredFormat, options, bitmapRenderTarget));
 }
 public int CreateCompatibleRenderTarget([NativeTypeName("const D2D1_SIZE_F *")] D2D_SIZE_F *desiredSize, [NativeTypeName("const D2D1_SIZE_U *")] D2D_SIZE_U *desiredPixelSize, [NativeTypeName("const D2D1_PIXEL_FORMAT *")] D2D1_PIXEL_FORMAT *desiredFormat, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options, [NativeTypeName("ID2D1BitmapRenderTarget **")] ID2D1BitmapRenderTarget **bitmapRenderTarget)
 {
     return(((delegate * stdcall <ID2D1BitmapRenderTarget *, D2D_SIZE_F *, D2D_SIZE_U *, D2D1_PIXEL_FORMAT *, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS, ID2D1BitmapRenderTarget **, int>)(lpVtbl[12]))((ID2D1BitmapRenderTarget *)Unsafe.AsPointer(ref this), desiredSize, desiredPixelSize, desiredFormat, options, bitmapRenderTarget));
 }
Exemple #4
0
        public static IComObject <ID2D1BitmapRenderTarget> CreateCompatibleRenderTarget(this ID2D1RenderTarget context, D2D_SIZE_F?desiredSize = null, D2D_SIZE_U?desiredPixelSize = null, D2D1_PIXEL_FORMAT?desiredFormat = null, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options = D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS.D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            using (var desiredSizeMem = new ComMemory(desiredSize))
            {
                using (var desiredPixelSizeMem = new ComMemory(desiredPixelSize))
                {
                    using (var desiredFormatMem = new ComMemory(desiredFormat))
                    {
                        context.CreateCompatibleRenderTarget(desiredSizeMem.Pointer, desiredPixelSizeMem.Pointer, desiredFormatMem.Pointer, options, out var target).ThrowOnError();
                        return(new ComObject <ID2D1BitmapRenderTarget>(target));
                    }
                }
            }
        }
Exemple #5
0
 public static IComObject <ID2D1BitmapRenderTarget> CreateCompatibleRenderTarget(this IComObject <ID2D1RenderTarget> context, D2D_SIZE_F?desiredSize = null, D2D_SIZE_U?desiredPixelSize = null, D2D1_PIXEL_FORMAT?desiredFormat = null, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options = D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS.D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE) => CreateCompatibleRenderTarget(context?.Object, desiredSize, desiredPixelSize, desiredFormat, options);