MCPcopy Create free account
hub / github.com/ALTaleX531/OpenGlass / MyCreateBitmap

Method MyCreateBitmap

OpenGlass/CaptionTextHandler.cpp:374–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372 return result;
373}
374HBITMAP WINAPI CaptionTextHandler::MyCreateBitmap(
375 int nWidth,
376 int nHeight,
377 [[maybe_unused]] UINT nPlanes,
378 [[maybe_unused]] UINT nBitCount,
379 [[maybe_unused]] const void* lpBits
380)
381{
382 if (!g_textVisual)
383 {
384 return g_CreateBitmap_Org(nWidth, nHeight, nPlanes, nBitCount, lpBits);
385 }
386
387 g_textSize = { nWidth, nHeight };
388 nWidth += g_textGlowSize * 2;
389 nHeight += g_textGlowSize * 2;
390
391 PVOID bits{ nullptr };
392 BITMAPINFO bitmapInfo{ {sizeof(bitmapInfo.bmiHeader), nWidth, -nHeight, 1, 32, BI_RGB} };
393 HBITMAP bitmap{ CreateDIBSection(nullptr, &bitmapInfo, DIB_RGB_COLORS, &bits, nullptr, 0) };
394 memset(bits, 0, sizeof(nWidth * nHeight * 4));
395
396 return bitmap;
397}
398HRESULT CaptionTextHandler::MyIWICImagingFactory2_CreateBitmapFromHBITMAP(
399 IWICImagingFactory2* This,
400 HBITMAP hBitmap,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected