コード例 #1
0
        public static void SetBackgroundColor(this IDXGISwapChain1 swapChain, _D3DCOLORVALUE value)
        {
            if (swapChain == null)
            {
                throw new ArgumentNullException(nameof(swapChain));
            }

            swapChain.SetBackgroundColor(ref value).ThrowOnError();
        }
コード例 #2
0
 public static extern _D3DCOLORVALUE D2D1ConvertColorSpace(D2D1_COLOR_SPACE sourceColorSpace, D2D1_COLOR_SPACE destinationColorSpace, ref _D3DCOLORVALUE color);
コード例 #3
0
ファイル: Hsv.cs プロジェクト: smourier/WicNet
 public static Hsv From(_D3DCOLORVALUE color) => new Hsv(GetHue(color.r, color.g, color.b), GetSaturation(color.r, color.g, color.b), GetValue(color.r, color.g, color.b));
コード例 #4
0
        public static IComObject <T> CreateSolidColorBrush <T>(this ID2D1RenderTarget renderTarget, _D3DCOLORVALUE color, D2D1_BRUSH_PROPERTIES?properties = null) where T : ID2D1SolidColorBrush
        {
            if (renderTarget == null)
            {
                throw new ArgumentNullException(nameof(renderTarget));
            }

            if (properties.HasValue)
            {
                using (var props = properties.Value.StructureToMemory())
                {
                    renderTarget.CreateSolidColorBrush(ref color, props.Pointer, out var brush).ThrowOnError();
                    return(new ComObject <T>((T)brush));
                }
            }

            renderTarget.CreateSolidColorBrush(ref color, IntPtr.Zero, out var brush2).ThrowOnError();
            return(new ComObject <T>((T)brush2));
        }
コード例 #5
0
 public static IComObject <T> CreateSolidColorBrush <T>(this IComObject <ID2D1RenderTarget> renderTarget, _D3DCOLORVALUE color, D2D1_BRUSH_PROPERTIES?properties = null) where T : ID2D1SolidColorBrush => CreateSolidColorBrush <T>(renderTarget?.Object, color, properties);
コード例 #6
0
 public static Hsl From(_D3DCOLORVALUE color) => new Hsl(Hsv.GetHue(color.r, color.g, color.b), GetSaturation(color.r, color.g, color.b), GetBrightness(color.r, color.g, color.b));
コード例 #7
0
        public static ComObject <T> CreateSolidColorBrush <T>(this ID2D1DeviceContext device, _D3DCOLORVALUE color, D2D1_BRUSH_PROPERTIES?properties = null) where T : ID2D1SolidColorBrush
        {
            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            using (var props = properties.StructureToMemory())
            {
                device.CreateSolidColorBrush(ref color, props.Pointer, out var brush).ThrowOnError();
                return(new ComObject <T>((T)brush));
            }
        }
コード例 #8
0
 public static ComObject <T> CreateSolidColorBrush <T>(this ComObject <ID2D1DeviceContext> device, _D3DCOLORVALUE color, D2D1_BRUSH_PROPERTIES?properties = null) where T : ID2D1SolidColorBrush => CreateSolidColorBrush <T>(device?.Object, color, properties);
コード例 #9
0
 public static void ClearRenderTargetView(this IComObject <ID3D11DeviceContext> context, IComObject <ID3D11RenderTargetView> renderTargetView, _D3DCOLORVALUE color) => ClearRenderTargetView(context?.Object, renderTargetView?.Object, color.ToArray());
コード例 #10
0
 public static IComObject <ID2D1Brush> CreateSolidColorBrush(this IComObject <ID2D1DeviceContext> context, _D3DCOLORVALUE color, D2D1_BRUSH_PROPERTIES?properties = null) => CreateSolidColorBrush <ID2D1Brush>(context?.Object, color, properties);
コード例 #11
0
 public static IComObject <ID2D1SolidColorBrush> CreateSolidColorBrush(this IComObject <ID2D1RenderTarget> device, _D3DCOLORVALUE color, D2D1_BRUSH_PROPERTIES?properties = null) => CreateSolidColorBrush <ID2D1SolidColorBrush>(device?.Object, color, properties);
コード例 #12
0
 public static void SetBackgroundColor(this IComObject <IDXGISwapChain1> swapChain, _D3DCOLORVALUE value) => SetBackgroundColor(swapChain?.Object, value);