mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 22:12:05 +00:00
[MSPAINT] Add get/putSubImage in dib.cpp and use them
CORE-19094
This commit is contained in:
parent
a65ebc8a71
commit
764e5505a7
5 changed files with 49 additions and 29 deletions
|
@ -157,14 +157,10 @@ HBITMAP SelectionModel::GetSelectionContents()
|
|||
if (m_hbmColor)
|
||||
return CopyDIBImage(m_hbmColor, m_rc.Width(), m_rc.Height());
|
||||
|
||||
HDC hMemDC = ::CreateCompatibleDC(NULL);
|
||||
HBITMAP hBitmap = CreateColorDIB(m_rc.Width(), m_rc.Height(), RGB(255, 255, 255));
|
||||
HGDIOBJ hbmOld = ::SelectObject(hMemDC, hBitmap);
|
||||
::BitBlt(hMemDC, 0, 0, m_rc.Width(), m_rc.Height(), imageModel.GetDC(), m_rc.left, m_rc.top, SRCCOPY);
|
||||
::SelectObject(hMemDC, hbmOld);
|
||||
::DeleteDC(hMemDC);
|
||||
|
||||
return hBitmap;
|
||||
HBITMAP hbmWhole = imageModel.LockBitmap();
|
||||
HBITMAP hbmPart = getSubImage(hbmWhole, m_rc);
|
||||
imageModel.UnlockBitmap(hbmWhole);
|
||||
return hbmPart;
|
||||
}
|
||||
|
||||
BOOL SelectionModel::IsLanded() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue