diff --git a/BitmapView.cpp b/BitmapView.cpp index bea2325..0e848d5 100644 --- a/BitmapView.cpp +++ b/BitmapView.cpp @@ -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) @@ -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) diff --git a/BitmapView.h b/BitmapView.h index 7d75965..b215cd4 100644 --- a/BitmapView.h +++ b/BitmapView.h @@ -19,7 +19,7 @@ class CBitmapView : public CZoomScrollWindowImpl 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); diff --git a/Image.cpp b/Image.cpp index 0d09a84..28f23df 100644 --- a/Image.cpp +++ b/Image.cpp @@ -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);