MCPcopy Create free account
hub / github.com/ColorCop/ColorCop / CopyBitmap

Method CopyBitmap

ColorCop/ColorCopDlg.cpp:1692–1713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1690}
1691
1692HBITMAP CColorCopDlg::CopyBitmap(HBITMAP hBitmapSrc) {
1693 BITMAP bitmap;
1694 HBITMAP hBitmapDst;
1695 HDC hdcSrc, hdcDst;
1696
1697 ::GetObject(hBitmapSrc, sizeof(BITMAP), &bitmap);
1698 hBitmapDst = ::CreateBitmapIndirect(&bitmap);
1699
1700 hdcSrc = ::CreateCompatibleDC(NULL);
1701 hdcDst = ::CreateCompatibleDC(NULL);
1702
1703 ::SelectObject(hdcSrc, hBitmapSrc);
1704 ::SelectObject(hdcDst, hBitmapDst);
1705
1706 ::BitBlt(hdcDst, 0, 0, bitmap.bmWidth, bitmap.bmHeight,
1707 hdcSrc, 0, 0, SRCCOPY);
1708
1709 ::DeleteDC(hdcSrc);
1710 ::DeleteDC(hdcDst);
1711
1712 return hBitmapDst;
1713}
1714
1715void CColorCopDlg::OnLButtonUp(UINT nFlags, CPoint point) {
1716 // Stop eyedropper or magnifier mode

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected