public static void SetBackgroundColor(this IDXGISwapChain1 swapChain, _D3DCOLORVALUE value) { if (swapChain == null) { throw new ArgumentNullException(nameof(swapChain)); } swapChain.SetBackgroundColor(ref value).ThrowOnError(); }
public static extern _D3DCOLORVALUE D2D1ConvertColorSpace(D2D1_COLOR_SPACE sourceColorSpace, D2D1_COLOR_SPACE destinationColorSpace, ref _D3DCOLORVALUE color);
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));
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)); }
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);
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));
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)); } }
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);
public static void ClearRenderTargetView(this IComObject <ID3D11DeviceContext> context, IComObject <ID3D11RenderTargetView> renderTargetView, _D3DCOLORVALUE color) => ClearRenderTargetView(context?.Object, renderTargetView?.Object, color.ToArray());
public static IComObject <ID2D1Brush> CreateSolidColorBrush(this IComObject <ID2D1DeviceContext> context, _D3DCOLORVALUE color, D2D1_BRUSH_PROPERTIES?properties = null) => CreateSolidColorBrush <ID2D1Brush>(context?.Object, color, properties);
public static IComObject <ID2D1SolidColorBrush> CreateSolidColorBrush(this IComObject <ID2D1RenderTarget> device, _D3DCOLORVALUE color, D2D1_BRUSH_PROPERTIES?properties = null) => CreateSolidColorBrush <ID2D1SolidColorBrush>(device?.Object, color, properties);
public static void SetBackgroundColor(this IComObject <IDXGISwapChain1> swapChain, _D3DCOLORVALUE value) => SetBackgroundColor(swapChain?.Object, value);