public static D2D1Factory Create(D2D1FactoryType factoryType)
        {
            ID2D1Factory factory;

            NativeMethods.D2D1CreateFactory(factoryType, typeof(ID2D1Factory).GUID, IntPtr.Zero, out factory);
            return(new D2D1Factory(factory));
        }
        public static D2D1Factory Create(D2D1FactoryType factoryType, D2D1DebugLevel debugLevel)
        {
            D2D1FactoryOptions factoryOptions = new D2D1FactoryOptions();

            factoryOptions.DebugLevel = debugLevel;
            return(D2D1Factory.Create(factoryType, factoryOptions));
        }
        public static D2D1Factory Create(D2D1FactoryType factoryType, D2D1FactoryOptions factoryOptions)
        {
            ID2D1Factory factory;

            GCHandle handle = GCHandle.Alloc(factoryOptions, GCHandleType.Pinned);

            try
            {
                NativeMethods.D2D1CreateFactory(factoryType, typeof(ID2D1Factory).GUID, handle.AddrOfPinnedObject(), out factory);
            }
            finally
            {
                handle.Free();
            }

            return new D2D1Factory(factory);
        }
        public static D2D1Factory Create(D2D1FactoryType factoryType, D2D1FactoryOptions factoryOptions)
        {
            ID2D1Factory factory;

            GCHandle handle = GCHandle.Alloc(factoryOptions, GCHandleType.Pinned);

            try
            {
                NativeMethods.D2D1CreateFactory(factoryType, typeof(ID2D1Factory).GUID, handle.AddrOfPinnedObject(), out factory);
            }
            finally
            {
                handle.Free();
            }

            return(new D2D1Factory(factory));
        }
 public static extern void D2D1CreateFactory(
     [In] D2D1FactoryType factoryType,
     [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid,
     [In] IntPtr factoryOptions,
     [Out] out ID2D1Factory factory);
 public static D2D1Factory Create(D2D1FactoryType factoryType)
 {
     ID2D1Factory factory;
     NativeMethods.D2D1CreateFactory(factoryType, typeof(ID2D1Factory).GUID, IntPtr.Zero, out factory);
     return new D2D1Factory(factory);
 }
 public static D2D1Factory Create(D2D1FactoryType factoryType, D2D1DebugLevel debugLevel)
 {
     D2D1FactoryOptions factoryOptions = new D2D1FactoryOptions();
     factoryOptions.DebugLevel = debugLevel;
     return D2D1Factory.Create(factoryType, factoryOptions);
 }