Skip to content

Commit

Permalink
Small tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
RadAd committed Aug 28, 2022
1 parent 888dc16 commit cb43b76
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions BitmapView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ BOOL CBitmapView::PreTranslateMessage(MSG* /*pMsg*/)
return FALSE;
}

void CBitmapView::ClearBitmap(bool bResetOffset)
void CBitmapView::ClearBitmap()
{
m_image.Clear();
UpdateScrollSize(bResetOffset);
UpdateScrollSize(true);
}

void CBitmapView::SetBitmap(Image image, bool bResetOffset)
Expand All @@ -43,7 +43,7 @@ void CBitmapView::SetFrame(UINT nFrame)
m_image.SetFrame(nFrame);
const Image::Size framesize = m_image.GetFrameSize();
SetZoomScale((float) m_sizeAll.cx / framesize.nWidth);
UpdateScrollSize(FALSE);
UpdateScrollSize(false);
}

void CBitmapView::SetFlipRotate(WICBitmapTransformOptions FlipRotate)
Expand Down
2 changes: 1 addition & 1 deletion BitmapView.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CBitmapView : public CZoomScrollWindowImpl<CBitmapView>
CBitmapView();

BOOL PreTranslateMessage(MSG* pMsg);
void ClearBitmap(bool bResetOffset = true);
void ClearBitmap();
void SetBitmap(Image image, bool bResetOffset = true);
const Image& GetImage() const { return m_image; }
void SetBackground(HBRUSH hBackground);
Expand Down
6 changes: 3 additions & 3 deletions Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,12 @@ void Image::RenderFrame(HDC hDC, int x, int y, int cx, int cy, HBRUSH hBackgroun
const Size sz = GetFrameSize();
CBitmapDC hMemDC(hDC, sz.nWidth, sz.nHeight); // Necessary as FillRect brush doesn't respect mapping mode
hMemDC.SetBrushOrg(sz.nWidth / 2, sz.nHeight / 2);
hMemDC.FillRect(&RECT({ 0, 0, (LONG) sz.nWidth, (LONG) sz.nHeight }), hBackground);
const RECT r = { 0, 0, (LONG) sz.nWidth, (LONG) sz.nHeight };
hMemDC.FillRect(&r, hBackground);
StretchBlt(hDC, 0, 0, cx, cy, hMemDC, 0, 0, sz.nWidth, sz.nHeight, SRCCOPY);
}

BLENDFUNCTION bf{ AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
::AlphaBlend(hDC, x, y, cx, cy, hDIBBitmap, bf);
::AlphaBlend(hDC, x, y, cx, cy, hDIBBitmap, { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA });
}
else
::SetDIBitsToDevice(hDC, x, y, cx, cy, 0, 0, 0, cy, pvImageBits, &bminfo, DIB_RGB_COLORS);
Expand Down

0 comments on commit cb43b76

Please sign in to comment.