mirror of
https://github.com/reactos/reactos.git
synced 2026-06-02 01:11:03 +08:00
[MSPAINT] Implement skew (#4362)
- Add SkewDIB helper function in dib.cpp. - Implement Stretch and Skew feature by SelectionModel::StretchSkew and ImageModel::StretchSkew. - Move ColorKeyedMaskBlt function. CORE-16634
This commit is contained in:
committed by
GitHub
parent
2d90919047
commit
dfd06ee8fc
@@ -21,39 +21,6 @@ const LPCTSTR CSelectionWindow::m_lpszCursorLUT[9] = { /* action to mouse cursor
|
||||
IDC_SIZENESW, IDC_SIZENS, IDC_SIZENWSE
|
||||
};
|
||||
|
||||
BOOL
|
||||
ColorKeyedMaskBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight,
|
||||
HDC hdcSrc, int nXSrc, int nYSrc, HBITMAP hbmMask, int xMask, int yMask,
|
||||
DWORD dwRop, COLORREF keyColor)
|
||||
{
|
||||
HDC hTempDC;
|
||||
HDC hTempDC2;
|
||||
HBITMAP hTempBm;
|
||||
HBRUSH hTempBrush;
|
||||
HBITMAP hTempMask;
|
||||
|
||||
hTempDC = CreateCompatibleDC(hdcSrc);
|
||||
hTempDC2 = CreateCompatibleDC(hdcSrc);
|
||||
hTempBm = CreateCompatibleBitmap(hTempDC, nWidth, nHeight);
|
||||
SelectObject(hTempDC, hTempBm);
|
||||
hTempBrush = CreateSolidBrush(keyColor);
|
||||
SelectObject(hTempDC, hTempBrush);
|
||||
BitBlt(hTempDC, 0, 0, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, SRCCOPY);
|
||||
PatBlt(hTempDC, 0, 0, nWidth, nHeight, PATINVERT);
|
||||
hTempMask = CreateBitmap(nWidth, nHeight, 1, 1, NULL);
|
||||
SelectObject(hTempDC2, hTempMask);
|
||||
BitBlt(hTempDC2, 0, 0, nWidth, nHeight, hTempDC, 0, 0, SRCCOPY);
|
||||
SelectObject(hTempDC, hbmMask);
|
||||
BitBlt(hTempDC2, 0, 0, nWidth, nHeight, hTempDC, xMask, yMask, SRCAND);
|
||||
MaskBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, hTempMask, xMask, yMask, dwRop);
|
||||
DeleteDC(hTempDC);
|
||||
DeleteDC(hTempDC2);
|
||||
DeleteObject(hTempBm);
|
||||
DeleteObject(hTempBrush);
|
||||
DeleteObject(hTempMask);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CSelectionWindow::ForceRefreshSelectionContents()
|
||||
{
|
||||
if (::IsWindowVisible(selectionWindow))
|
||||
|
||||
Reference in New Issue
Block a user