From 714a757ee435b83156ddee6b16edc99408357170 Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 14 Nov 2018 21:07:59 +0800 Subject: Add fore/bakcground brush. --- src/graph/graph.cpp | 7 +++++++ src/graph/graph.hpp | 2 ++ 2 files changed, 9 insertions(+) (limited to 'src/graph') diff --git a/src/graph/graph.cpp b/src/graph/graph.cpp index 70bec35b..eef95c8c 100644 --- a/src/graph/graph.cpp +++ b/src/graph/graph.cpp @@ -216,4 +216,11 @@ namespace cru::graph d2d1_factory_->ReloadSystemMetrics() ); } + + Microsoft::WRL::ComPtr CreateSolidColorBrush(const D2D1_COLOR_F& color) + { + Microsoft::WRL::ComPtr brush; + ThrowIfFailed(GraphManager::GetInstance()->GetD2D1DeviceContext()->CreateSolidColorBrush(color, &brush)); + return brush; + } } diff --git a/src/graph/graph.hpp b/src/graph/graph.hpp index b859e82f..7771b48f 100644 --- a/src/graph/graph.hpp +++ b/src/graph/graph.hpp @@ -172,4 +172,6 @@ namespace cru::graph action(device_context); device_context->SetTransform(old_transform); } + + Microsoft::WRL::ComPtr CreateSolidColorBrush(const D2D1_COLOR_F& color); } -- cgit v1.2.3