MCPcopy Create free account
hub / github.com/WinMerge/winmerge / DrawBitmap

Function DrawBitmap

Src/Common/Bitmap.cpp:44–53  ·  view source on GitHub ↗

* @brief Draw a bitmap image * @param pDC [in] The destination device context to draw to * @param x [in] The x-coordinate of the upper-left corner of the bitmap * @param y [in] The y-coordinate of the upper-left corner of the bitmap * @param pBitmap [in] the bitmap to draw */

Source from the content-addressed store, hash-verified

42 * @param pBitmap [in] the bitmap to draw
43 */
44void DrawBitmap(CDC *pDC, int x, int y, CBitmap *pBitmap)
45{
46 CDC dcMem;
47 dcMem.CreateCompatibleDC(pDC);
48 BITMAP bm;
49 pBitmap->GetBitmap(&bm);
50 CBitmap *pOldBitmap = dcMem.SelectObject(pBitmap);
51 pDC->BitBlt(x, y, bm.bmWidth, bm.bmHeight, &dcMem, 0, 0, SRCCOPY);
52 dcMem.SelectObject(pOldBitmap);
53}
54
55/**
56 * @brief Duplicate a bitmap and make it dark

Callers 3

DrawVisibleAreaRectMethod · 0.85
UpdateVisiblePosMethod · 0.85
GetDarkenedBitmapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected