MCPcopy Create free account
hub / github.com/TranslucentTB/TranslucentTB / PaintBackground

Method PaintBackground

TranslucentTB/uwp/basexamlpagehost.cpp:197–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197bool BaseXamlPageHost::PaintBackground(HDC dc, const RECT &target, winrt::Windows::UI::Color col)
198{
199 if (!m_BackgroundBrush || m_BackgroundColor != col) [[unlikely]]
200 {
201 m_BackgroundBrush.reset(CreateSolidBrush(RGB(col.R, col.G, col.B)));
202 if (m_BackgroundBrush)
203 {
204 m_BackgroundColor = col;
205 }
206 else
207 {
208 MessagePrint(spdlog::level::info, L"Failed to create background brush");
209 return false;
210 }
211 }
212
213 if (FillRect(dc, &target, m_BackgroundBrush.get()))
214 {
215 return true;
216 }
217 else
218 {
219 LastErrorHandle(spdlog::level::info, L"Failed to fill rectangle.");
220 return false;
221 }
222}
223
224BaseXamlPageHost::BaseXamlPageHost(WindowClass &classRef, WindowClass &dragRegionClass) :
225 MessageWindow(classRef, { }),

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected