public D2D1SolidColorBrush CreateSolidColorBrush(D2D1ColorF color)
 {
     ID2D1SolidColorBrush solidColorBrush;
     this.GetHandle<ID2D1RenderTarget>().CreateSolidColorBrush(ref color, IntPtr.Zero, out solidColorBrush);
     return new D2D1SolidColorBrush(solidColorBrush);
 }
        public D2D1SolidColorBrush CreateSolidColorBrush(D2D1ColorF color, D2D1BrushProperties brushProperties)
        {
            ID2D1SolidColorBrush solidColorBrush;

            GCHandle brushPropertiesHandle = GCHandle.Alloc(brushProperties);

            try
            {
                this.GetHandle<ID2D1RenderTarget>().CreateSolidColorBrush(ref color, brushPropertiesHandle.AddrOfPinnedObject(), out solidColorBrush);
            }
            finally
            {
                brushPropertiesHandle.Free();
            }

            return new D2D1SolidColorBrush(solidColorBrush);
        }
        public void Clear(D2D1ColorF clearColor)
        {
            GCHandle clearColorHandle = GCHandle.Alloc(clearColor, GCHandleType.Pinned);

            try
            {
                this.GetHandle<ID2D1RenderTarget>().Clear(clearColorHandle.AddrOfPinnedObject());
            }
            finally
            {
                clearColorHandle.Free();
            }
        }