mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 02:03:07 +00: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:
parent
2d90919047
commit
dfd06ee8fc
9 changed files with 165 additions and 39 deletions
|
@ -192,7 +192,21 @@ void ImageModel::StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSk
|
|||
int oldHeight = GetHeight();
|
||||
INT newWidth = oldWidth * nStretchPercentX / 100;
|
||||
INT newHeight = oldHeight * nStretchPercentY / 100;
|
||||
Insert(CopyDIBImage(hBms[currInd], newWidth, newHeight));
|
||||
if (oldWidth != newWidth || oldHeight != newHeight)
|
||||
{
|
||||
HBITMAP hbm0 = CopyDIBImage(hBms[currInd], newWidth, newHeight);
|
||||
Insert(hbm0);
|
||||
}
|
||||
if (nSkewDegX)
|
||||
{
|
||||
HBITMAP hbm1 = SkewDIB(hDrawingDC, hBms[currInd], nSkewDegX, FALSE);
|
||||
Insert(hbm1);
|
||||
}
|
||||
if (nSkewDegY)
|
||||
{
|
||||
HBITMAP hbm2 = SkewDIB(hDrawingDC, hBms[currInd], nSkewDegY, TRUE);
|
||||
Insert(hbm2);
|
||||
}
|
||||
if (GetWidth() != oldWidth || GetHeight() != oldHeight)
|
||||
NotifyDimensionsChanged();
|
||||
NotifyImageChanged();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue