[ATL] atlimage.h: Replace throw() with noexcept

throw() is deprecated in C++17. CORE-19008
This commit is contained in:
Katayama Hirofumi MZ 2023-09-05 09:12:01 +09:00
parent b68a3f329c
commit eb6561bbc7

View file

@ -37,7 +37,7 @@ public:
DIBOR_TOPDOWN // top-down DIB DIBOR_TOPDOWN // top-down DIB
}; };
CImage() throw() CImage() noexcept
{ {
m_hBitmap = NULL; m_hBitmap = NULL;
m_hOldBitmap = NULL; m_hOldBitmap = NULL;
@ -52,13 +52,13 @@ public:
s_gdiplus.IncreaseCImageCount(); s_gdiplus.IncreaseCImageCount();
} }
virtual ~CImage() throw() virtual ~CImage() noexcept
{ {
Destroy(); Destroy();
s_gdiplus.DecreaseCImageCount(); s_gdiplus.DecreaseCImageCount();
} }
operator HBITMAP() throw() operator HBITMAP() noexcept
{ {
return m_hBitmap; return m_hBitmap;
} }
@ -68,12 +68,12 @@ public:
s_gdiplus.ReleaseGDIPlus(); s_gdiplus.ReleaseGDIPlus();
} }
void Attach(HBITMAP hBitmap, DIBOrientation eOrientation = DIBOR_DEFAULT) throw() void Attach(HBITMAP hBitmap, DIBOrientation eOrientation = DIBOR_DEFAULT) noexcept
{ {
AttachInternal(hBitmap, eOrientation, -1); AttachInternal(hBitmap, eOrientation, -1);
} }
HBITMAP Detach() throw() HBITMAP Detach() noexcept
{ {
m_eOrientation = DIBOR_DEFAULT; m_eOrientation = DIBOR_DEFAULT;
m_bHasAlphaChannel = false; m_bHasAlphaChannel = false;
@ -85,7 +85,7 @@ public:
return hBitmap; return hBitmap;
} }
HDC GetDC() const throw() HDC GetDC() const noexcept
{ {
ATLASSERT(m_nDCRefCount >= 0); ATLASSERT(m_nDCRefCount >= 0);
if (::InterlockedIncrement(&m_nDCRefCount) == 1) if (::InterlockedIncrement(&m_nDCRefCount) == 1)
@ -103,7 +103,7 @@ public:
return m_hDC; return m_hDC;
} }
void ReleaseDC() const throw() void ReleaseDC() const noexcept
{ {
ATLASSERT(m_nDCRefCount > 0); ATLASSERT(m_nDCRefCount > 0);
@ -170,7 +170,7 @@ public:
BOOL BitBlt(HDC hDestDC, int xDest, int yDest, BOOL BitBlt(HDC hDestDC, int xDest, int yDest,
int nDestWidth, int nDestHeight, int nDestWidth, int nDestHeight,
int xSrc, int ySrc, DWORD dwROP = SRCCOPY) const throw() int xSrc, int ySrc, DWORD dwROP = SRCCOPY) const noexcept
{ {
GetDC(); GetDC();
BOOL ret = ::BitBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight, BOOL ret = ::BitBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
@ -179,18 +179,18 @@ public:
return ret; return ret;
} }
BOOL BitBlt(HDC hDestDC, int xDest, int yDest, BOOL BitBlt(HDC hDestDC, int xDest, int yDest,
DWORD dwROP = SRCCOPY) const throw() DWORD dwROP = SRCCOPY) const noexcept
{ {
return BitBlt(hDestDC, xDest, yDest, return BitBlt(hDestDC, xDest, yDest,
GetWidth(), GetHeight(), 0, 0, dwROP); GetWidth(), GetHeight(), 0, 0, dwROP);
} }
BOOL BitBlt(HDC hDestDC, const POINT& pointDest, BOOL BitBlt(HDC hDestDC, const POINT& pointDest,
DWORD dwROP = SRCCOPY) const throw() DWORD dwROP = SRCCOPY) const noexcept
{ {
return BitBlt(hDestDC, pointDest.x, pointDest.y, dwROP); return BitBlt(hDestDC, pointDest.x, pointDest.y, dwROP);
} }
BOOL BitBlt(HDC hDestDC, const RECT& rectDest, const POINT& pointSrc, BOOL BitBlt(HDC hDestDC, const RECT& rectDest, const POINT& pointSrc,
DWORD dwROP = SRCCOPY) const throw() DWORD dwROP = SRCCOPY) const noexcept
{ {
return BitBlt(hDestDC, rectDest.left, rectDest.top, return BitBlt(hDestDC, rectDest.left, rectDest.top,
rectDest.right - rectDest.left, rectDest.right - rectDest.left,
@ -198,18 +198,18 @@ public:
pointSrc.x, pointSrc.y, dwROP); pointSrc.x, pointSrc.y, dwROP);
} }
BOOL Create(int nWidth, int nHeight, int nBPP, DWORD dwFlags = 0) throw() BOOL Create(int nWidth, int nHeight, int nBPP, DWORD dwFlags = 0) noexcept
{ {
return CreateEx(nWidth, nHeight, nBPP, BI_RGB, NULL, dwFlags); return CreateEx(nWidth, nHeight, nBPP, BI_RGB, NULL, dwFlags);
} }
BOOL CreateEx(int nWidth, int nHeight, int nBPP, DWORD eCompression, BOOL CreateEx(int nWidth, int nHeight, int nBPP, DWORD eCompression,
const DWORD* pdwBitmasks = NULL, DWORD dwFlags = 0) throw() const DWORD* pdwBitmasks = NULL, DWORD dwFlags = 0) noexcept
{ {
return CreateInternal(nWidth, nHeight, nBPP, eCompression, pdwBitmasks, dwFlags); return CreateInternal(nWidth, nHeight, nBPP, eCompression, pdwBitmasks, dwFlags);
} }
void Destroy() throw() void Destroy() noexcept
{ {
if (m_hBitmap) if (m_hBitmap)
{ {
@ -218,7 +218,7 @@ public:
} }
BOOL Draw(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight, BOOL Draw(HDC hDestDC, int xDest, int yDest, int nDestWidth, int nDestHeight,
int xSrc, int ySrc, int nSrcWidth, int nSrcHeight) const throw() int xSrc, int ySrc, int nSrcWidth, int nSrcHeight) const noexcept
{ {
ATLASSERT(IsTransparencySupported()); ATLASSERT(IsTransparencySupported());
if (m_bHasAlphaChannel) if (m_bHasAlphaChannel)
@ -242,7 +242,7 @@ public:
xSrc, ySrc, nSrcWidth, nSrcHeight); xSrc, ySrc, nSrcWidth, nSrcHeight);
} }
} }
BOOL Draw(HDC hDestDC, const RECT& rectDest, const RECT& rectSrc) const throw() BOOL Draw(HDC hDestDC, const RECT& rectDest, const RECT& rectSrc) const noexcept
{ {
return Draw(hDestDC, rectDest.left, rectDest.top, return Draw(hDestDC, rectDest.left, rectDest.top,
rectDest.right - rectDest.left, rectDest.right - rectDest.left,
@ -251,28 +251,28 @@ public:
rectSrc.right - rectSrc.left, rectSrc.right - rectSrc.left,
rectSrc.bottom - rectSrc.top); rectSrc.bottom - rectSrc.top);
} }
BOOL Draw(HDC hDestDC, int xDest, int yDest) const throw() BOOL Draw(HDC hDestDC, int xDest, int yDest) const noexcept
{ {
return Draw(hDestDC, xDest, yDest, GetWidth(), GetHeight()); return Draw(hDestDC, xDest, yDest, GetWidth(), GetHeight());
} }
BOOL Draw(HDC hDestDC, const POINT& pointDest) const throw() BOOL Draw(HDC hDestDC, const POINT& pointDest) const noexcept
{ {
return Draw(hDestDC, pointDest.x, pointDest.y); return Draw(hDestDC, pointDest.x, pointDest.y);
} }
BOOL Draw(HDC hDestDC, int xDest, int yDest, BOOL Draw(HDC hDestDC, int xDest, int yDest,
int nDestWidth, int nDestHeight) const throw() int nDestWidth, int nDestHeight) const noexcept
{ {
return Draw(hDestDC, xDest, yDest, nDestWidth, nDestHeight, return Draw(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
0, 0, GetWidth(), GetHeight()); 0, 0, GetWidth(), GetHeight());
} }
BOOL Draw(HDC hDestDC, const RECT& rectDest) const throw() BOOL Draw(HDC hDestDC, const RECT& rectDest) const noexcept
{ {
return Draw(hDestDC, rectDest.left, rectDest.top, return Draw(hDestDC, rectDest.left, rectDest.top,
rectDest.right - rectDest.left, rectDest.right - rectDest.left,
rectDest.bottom - rectDest.top); rectDest.bottom - rectDest.top);
} }
void *GetBits() throw() void *GetBits() noexcept
{ {
ATLASSERT(IsDIBSection()); ATLASSERT(IsDIBSection());
BYTE *pb = (BYTE *)m_bm.bmBits; BYTE *pb = (BYTE *)m_bm.bmBits;
@ -283,14 +283,14 @@ public:
return pb; return pb;
} }
int GetBPP() const throw() int GetBPP() const noexcept
{ {
ATLASSERT(m_hBitmap); ATLASSERT(m_hBitmap);
return m_bm.bmBitsPixel; return m_bm.bmBitsPixel;
} }
void GetColorTable(UINT iFirstColor, UINT nColors, void GetColorTable(UINT iFirstColor, UINT nColors,
RGBQUAD* prgbColors) const throw() RGBQUAD* prgbColors) const noexcept
{ {
ATLASSERT(IsDIBSection()); ATLASSERT(IsDIBSection());
GetDC(); GetDC();
@ -298,13 +298,13 @@ public:
ReleaseDC(); ReleaseDC();
} }
int GetHeight() const throw() int GetHeight() const noexcept
{ {
ATLASSERT(m_hBitmap); ATLASSERT(m_hBitmap);
return m_bm.bmHeight; return m_bm.bmHeight;
} }
int GetMaxColorTableEntries() const throw() int GetMaxColorTableEntries() const noexcept
{ {
ATLASSERT(IsDIBSection()); ATLASSERT(IsDIBSection());
if (m_ds.dsBmih.biClrUsed && m_ds.dsBmih.biBitCount < 16) if (m_ds.dsBmih.biClrUsed && m_ds.dsBmih.biBitCount < 16)
@ -324,7 +324,7 @@ public:
} }
} }
int GetPitch() const throw() int GetPitch() const noexcept
{ {
ATLASSERT(IsDIBSection()); ATLASSERT(IsDIBSection());
if (m_eOrientation == DIBOR_BOTTOMUP) if (m_eOrientation == DIBOR_BOTTOMUP)
@ -333,7 +333,7 @@ public:
return m_bm.bmWidthBytes; return m_bm.bmWidthBytes;
} }
COLORREF GetPixel(int x, int y) const throw() COLORREF GetPixel(int x, int y) const noexcept
{ {
GetDC(); GetDC();
COLORREF ret = ::GetPixel(m_hDC, x, y); COLORREF ret = ::GetPixel(m_hDC, x, y);
@ -341,7 +341,7 @@ public:
return ret; return ret;
} }
void* GetPixelAddress(int x, int y) throw() void* GetPixelAddress(int x, int y) noexcept
{ {
ATLASSERT(IsDIBSection()); ATLASSERT(IsDIBSection());
BYTE *pb = (BYTE *)GetBits(); BYTE *pb = (BYTE *)GetBits();
@ -350,35 +350,35 @@ public:
return pb; return pb;
} }
COLORREF GetTransparentColor() const throw() COLORREF GetTransparentColor() const noexcept
{ {
return m_clrTransparentColor; return m_clrTransparentColor;
} }
int GetWidth() const throw() int GetWidth() const noexcept
{ {
ATLASSERT(m_hBitmap); ATLASSERT(m_hBitmap);
return m_bm.bmWidth; return m_bm.bmWidth;
} }
bool IsDIBSection() const throw() bool IsDIBSection() const noexcept
{ {
ATLASSERT(m_hBitmap); ATLASSERT(m_hBitmap);
return m_bIsDIBSection; return m_bIsDIBSection;
} }
bool IsIndexed() const throw() bool IsIndexed() const noexcept
{ {
ATLASSERT(IsDIBSection()); ATLASSERT(IsDIBSection());
return GetBPP() <= 8; return GetBPP() <= 8;
} }
bool IsNull() const throw() bool IsNull() const noexcept
{ {
return m_hBitmap == NULL; return m_hBitmap == NULL;
} }
HRESULT Load(LPCTSTR pszFileName) throw() HRESULT Load(LPCTSTR pszFileName) noexcept
{ {
if (!InitGDIPlus()) if (!InitGDIPlus())
return E_FAIL; return E_FAIL;
@ -407,7 +407,7 @@ public:
Attach(hbm); Attach(hbm);
return (status == Ok ? S_OK : E_FAIL); return (status == Ok ? S_OK : E_FAIL);
} }
HRESULT Load(IStream* pStream) throw() HRESULT Load(IStream* pStream) noexcept
{ {
if (!InitGDIPlus()) if (!InitGDIPlus())
return E_FAIL; return E_FAIL;
@ -435,13 +435,13 @@ public:
} }
// NOTE: LoadFromResource loads BITMAP resource only // NOTE: LoadFromResource loads BITMAP resource only
void LoadFromResource(HINSTANCE hInstance, LPCTSTR pszResourceName) throw() void LoadFromResource(HINSTANCE hInstance, LPCTSTR pszResourceName) noexcept
{ {
HANDLE hHandle = ::LoadImage(hInstance, pszResourceName, HANDLE hHandle = ::LoadImage(hInstance, pszResourceName,
IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION); IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
Attach(reinterpret_cast<HBITMAP>(hHandle)); Attach(reinterpret_cast<HBITMAP>(hHandle));
} }
void LoadFromResource(HINSTANCE hInstance, UINT nIDResource) throw() void LoadFromResource(HINSTANCE hInstance, UINT nIDResource) noexcept
{ {
LoadFromResource(hInstance, MAKEINTRESOURCE(nIDResource)); LoadFromResource(hInstance, MAKEINTRESOURCE(nIDResource));
} }
@ -449,7 +449,7 @@ public:
BOOL MaskBlt(HDC hDestDC, int xDest, int yDest, BOOL MaskBlt(HDC hDestDC, int xDest, int yDest,
int nDestWidth, int nDestHeight, int xSrc, int ySrc, int nDestWidth, int nDestHeight, int xSrc, int ySrc,
HBITMAP hbmMask, int xMask, int yMask, HBITMAP hbmMask, int xMask, int yMask,
DWORD dwROP = SRCCOPY) const throw() DWORD dwROP = SRCCOPY) const noexcept
{ {
ATLASSERT(IsTransparencySupported()); ATLASSERT(IsTransparencySupported());
GetDC(); GetDC();
@ -461,20 +461,20 @@ public:
} }
BOOL MaskBlt(HDC hDestDC, const RECT& rectDest, const POINT& pointSrc, BOOL MaskBlt(HDC hDestDC, const RECT& rectDest, const POINT& pointSrc,
HBITMAP hbmMask, const POINT& pointMask, HBITMAP hbmMask, const POINT& pointMask,
DWORD dwROP = SRCCOPY) const throw() DWORD dwROP = SRCCOPY) const noexcept
{ {
return MaskBlt(hDestDC, rectDest.left, rectDest.top, return MaskBlt(hDestDC, rectDest.left, rectDest.top,
rectDest.right - rectDest.left, rectDest.bottom - rectDest.top, rectDest.right - rectDest.left, rectDest.bottom - rectDest.top,
pointSrc.x, pointSrc.y, hbmMask, pointMask.x, pointMask.y, dwROP); pointSrc.x, pointSrc.y, hbmMask, pointMask.x, pointMask.y, dwROP);
} }
BOOL MaskBlt(HDC hDestDC, int xDest, int yDest, BOOL MaskBlt(HDC hDestDC, int xDest, int yDest,
HBITMAP hbmMask, DWORD dwROP = SRCCOPY) const throw() HBITMAP hbmMask, DWORD dwROP = SRCCOPY) const noexcept
{ {
return MaskBlt(hDestDC, xDest, yDest, GetWidth(), GetHeight(), return MaskBlt(hDestDC, xDest, yDest, GetWidth(), GetHeight(),
0, 0, hbmMask, 0, 0, dwROP); 0, 0, hbmMask, 0, 0, dwROP);
} }
BOOL MaskBlt(HDC hDestDC, const POINT& pointDest, BOOL MaskBlt(HDC hDestDC, const POINT& pointDest,
HBITMAP hbmMask, DWORD dwROP = SRCCOPY) const throw() HBITMAP hbmMask, DWORD dwROP = SRCCOPY) const noexcept
{ {
return MaskBlt(hDestDC, pointDest.x, pointDest.y, hbmMask, dwROP); return MaskBlt(hDestDC, pointDest.x, pointDest.y, hbmMask, dwROP);
} }
@ -482,7 +482,7 @@ public:
BOOL PlgBlt(HDC hDestDC, const POINT* pPoints, BOOL PlgBlt(HDC hDestDC, const POINT* pPoints,
int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight,
HBITMAP hbmMask = NULL, HBITMAP hbmMask = NULL,
int xMask = 0, int yMask = 0) const throw() int xMask = 0, int yMask = 0) const noexcept
{ {
ATLASSERT(IsTransparencySupported()); ATLASSERT(IsTransparencySupported());
GetDC(); GetDC();
@ -493,26 +493,26 @@ public:
return ret; return ret;
} }
BOOL PlgBlt(HDC hDestDC, const POINT* pPoints, BOOL PlgBlt(HDC hDestDC, const POINT* pPoints,
HBITMAP hbmMask = NULL) const throw() HBITMAP hbmMask = NULL) const noexcept
{ {
return PlgBlt(hDestDC, pPoints, 0, 0, GetWidth(), GetHeight(), return PlgBlt(hDestDC, pPoints, 0, 0, GetWidth(), GetHeight(),
hbmMask); hbmMask);
} }
BOOL PlgBlt(HDC hDestDC, const POINT* pPoints, const RECT& rectSrc, BOOL PlgBlt(HDC hDestDC, const POINT* pPoints, const RECT& rectSrc,
HBITMAP hbmMask, const POINT& pointMask) const throw() HBITMAP hbmMask, const POINT& pointMask) const noexcept
{ {
return PlgBlt(hDestDC, pPoints, rectSrc.left, rectSrc.top, return PlgBlt(hDestDC, pPoints, rectSrc.left, rectSrc.top,
rectSrc.right - rectSrc.left, rectSrc.bottom - rectSrc.top, rectSrc.right - rectSrc.left, rectSrc.bottom - rectSrc.top,
hbmMask, pointMask.x, pointMask.y); hbmMask, pointMask.x, pointMask.y);
} }
BOOL PlgBlt(HDC hDestDC, const POINT* pPoints, const RECT& rectSrc, BOOL PlgBlt(HDC hDestDC, const POINT* pPoints, const RECT& rectSrc,
HBITMAP hbmMask = NULL) const throw() HBITMAP hbmMask = NULL) const noexcept
{ {
POINT pointMask = {0, 0}; POINT pointMask = {0, 0};
return PlgBlt(hDestDC, pPoints, rectSrc, hbmMask, pointMask); return PlgBlt(hDestDC, pPoints, rectSrc, hbmMask, pointMask);
} }
HRESULT Save(IStream* pStream, GUID *guidFileType) const throw() HRESULT Save(IStream* pStream, GUID *guidFileType) const noexcept
{ {
if (!InitGDIPlus()) if (!InitGDIPlus())
return E_FAIL; return E_FAIL;
@ -543,7 +543,7 @@ public:
} }
HRESULT Save(LPCTSTR pszFileName, HRESULT Save(LPCTSTR pszFileName,
REFGUID guidFileType = GUID_NULL) const throw() REFGUID guidFileType = GUID_NULL) const noexcept
{ {
if (!InitGDIPlus()) if (!InitGDIPlus())
return E_FAIL; return E_FAIL;
@ -585,7 +585,7 @@ public:
} }
void SetColorTable(UINT iFirstColor, UINT nColors, void SetColorTable(UINT iFirstColor, UINT nColors,
const RGBQUAD* prgbColors) throw() const RGBQUAD* prgbColors) noexcept
{ {
ATLASSERT(IsDIBSection()); ATLASSERT(IsDIBSection());
GetDC(); GetDC();
@ -593,14 +593,14 @@ public:
ReleaseDC(); ReleaseDC();
} }
void SetPixel(int x, int y, COLORREF color) throw() void SetPixel(int x, int y, COLORREF color) noexcept
{ {
GetDC(); GetDC();
::SetPixelV(m_hDC, x, y, color); ::SetPixelV(m_hDC, x, y, color);
ReleaseDC(); ReleaseDC();
} }
void SetPixelIndexed(int x, int y, int iIndex) throw() void SetPixelIndexed(int x, int y, int iIndex) noexcept
{ {
ATLASSERT(IsIndexed()); ATLASSERT(IsIndexed());
GetDC(); GetDC();
@ -608,12 +608,12 @@ public:
ReleaseDC(); ReleaseDC();
} }
void SetPixelRGB(int x, int y, BYTE r, BYTE g, BYTE b) throw() void SetPixelRGB(int x, int y, BYTE r, BYTE g, BYTE b) noexcept
{ {
SetPixel(x, y, RGB(r, g, b)); SetPixel(x, y, RGB(r, g, b));
} }
COLORREF SetTransparentColor(COLORREF rgbTransparent) throw() COLORREF SetTransparentColor(COLORREF rgbTransparent) noexcept
{ {
ATLASSERT(m_hBitmap); ATLASSERT(m_hBitmap);
COLORREF rgbOldColor = m_clrTransparentColor; COLORREF rgbOldColor = m_clrTransparentColor;
@ -624,7 +624,7 @@ public:
BOOL StretchBlt(HDC hDestDC, int xDest, int yDest, BOOL StretchBlt(HDC hDestDC, int xDest, int yDest,
int nDestWidth, int nDestHeight, int nDestWidth, int nDestHeight,
int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight,
DWORD dwROP = SRCCOPY) const throw() DWORD dwROP = SRCCOPY) const noexcept
{ {
GetDC(); GetDC();
BOOL ret = ::StretchBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight, BOOL ret = ::StretchBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
@ -634,20 +634,20 @@ public:
} }
BOOL StretchBlt(HDC hDestDC, int xDest, int yDest, BOOL StretchBlt(HDC hDestDC, int xDest, int yDest,
int nDestWidth, int nDestHeight, int nDestWidth, int nDestHeight,
DWORD dwROP = SRCCOPY) const throw() DWORD dwROP = SRCCOPY) const noexcept
{ {
return StretchBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight, return StretchBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
0, 0, GetWidth(), GetHeight(), dwROP); 0, 0, GetWidth(), GetHeight(), dwROP);
} }
BOOL StretchBlt(HDC hDestDC, const RECT& rectDest, BOOL StretchBlt(HDC hDestDC, const RECT& rectDest,
DWORD dwROP = SRCCOPY) const throw() DWORD dwROP = SRCCOPY) const noexcept
{ {
return StretchBlt(hDestDC, rectDest.left, rectDest.top, return StretchBlt(hDestDC, rectDest.left, rectDest.top,
rectDest.right - rectDest.left, rectDest.right - rectDest.left,
rectDest.bottom - rectDest.top, dwROP); rectDest.bottom - rectDest.top, dwROP);
} }
BOOL StretchBlt(HDC hDestDC, const RECT& rectDest, BOOL StretchBlt(HDC hDestDC, const RECT& rectDest,
const RECT& rectSrc, DWORD dwROP = SRCCOPY) const throw() const RECT& rectSrc, DWORD dwROP = SRCCOPY) const noexcept
{ {
return StretchBlt(hDestDC, rectDest.left, rectDest.top, return StretchBlt(hDestDC, rectDest.left, rectDest.top,
rectDest.right - rectDest.left, rectDest.right - rectDest.left,
@ -660,7 +660,7 @@ public:
BOOL TransparentBlt(HDC hDestDC, int xDest, int yDest, BOOL TransparentBlt(HDC hDestDC, int xDest, int yDest,
int nDestWidth, int nDestHeight, int nDestWidth, int nDestHeight,
int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight,
UINT crTransparent = CLR_INVALID) const throw() UINT crTransparent = CLR_INVALID) const noexcept
{ {
ATLASSERT(IsTransparencySupported()); ATLASSERT(IsTransparencySupported());
GetDC(); GetDC();
@ -673,13 +673,13 @@ public:
} }
BOOL TransparentBlt(HDC hDestDC, int xDest, int yDest, BOOL TransparentBlt(HDC hDestDC, int xDest, int yDest,
int nDestWidth, int nDestHeight, int nDestWidth, int nDestHeight,
UINT crTransparent = CLR_INVALID) const throw() UINT crTransparent = CLR_INVALID) const noexcept
{ {
return TransparentBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight, return TransparentBlt(hDestDC, xDest, yDest, nDestWidth, nDestHeight,
0, 0, GetWidth(), GetHeight(), crTransparent); 0, 0, GetWidth(), GetHeight(), crTransparent);
} }
BOOL TransparentBlt(HDC hDestDC, const RECT& rectDest, BOOL TransparentBlt(HDC hDestDC, const RECT& rectDest,
UINT crTransparent = CLR_INVALID) const throw() UINT crTransparent = CLR_INVALID) const noexcept
{ {
return TransparentBlt(hDestDC, rectDest.left, rectDest.top, return TransparentBlt(hDestDC, rectDest.left, rectDest.top,
rectDest.right - rectDest.left, rectDest.right - rectDest.left,
@ -687,7 +687,7 @@ public:
} }
BOOL TransparentBlt( BOOL TransparentBlt(
HDC hDestDC, const RECT& rectDest, HDC hDestDC, const RECT& rectDest,
const RECT& rectSrc, UINT crTransparent = CLR_INVALID) const throw() const RECT& rectSrc, UINT crTransparent = CLR_INVALID) const noexcept
{ {
return TransparentBlt(hDestDC, rectDest.left, rectDest.top, return TransparentBlt(hDestDC, rectDest.left, rectDest.top,
rectDest.right - rectDest.left, rectDest.bottom - rectDest.left, rectDest.right - rectDest.left, rectDest.bottom - rectDest.left,
@ -695,7 +695,7 @@ public:
rectSrc.bottom - rectSrc.top, crTransparent); rectSrc.bottom - rectSrc.top, crTransparent);
} }
static BOOL IsTransparencySupported() throw() static BOOL IsTransparencySupported() noexcept
{ {
return TRUE; return TRUE;
} }
@ -881,7 +881,7 @@ private:
LONG m_nCImageObjects; LONG m_nCImageObjects;
DWORD m_dwLastError; DWORD m_dwLastError;
void _clear_funs() throw() void _clear_funs() noexcept
{ {
Startup = NULL; Startup = NULL;
Shutdown = NULL; Shutdown = NULL;
@ -899,7 +899,7 @@ private:
} }
template <typename T_FUN> template <typename T_FUN>
T_FUN _get_fun(T_FUN& fun, LPCSTR name) throw() T_FUN _get_fun(T_FUN& fun, LPCSTR name) noexcept
{ {
if (!fun) if (!fun)
fun = reinterpret_cast<T_FUN>(::GetProcAddress(m_hInst, name)); fun = reinterpret_cast<T_FUN>(::GetProcAddress(m_hInst, name));
@ -922,7 +922,7 @@ private:
FUN_SaveImageToFile SaveImageToFile; FUN_SaveImageToFile SaveImageToFile;
FUN_SaveImageToStream SaveImageToStream; FUN_SaveImageToStream SaveImageToStream;
CInitGDIPlus() throw() CInitGDIPlus() noexcept
: m_hInst(NULL) : m_hInst(NULL)
, m_dwToken(0) , m_dwToken(0)
, m_nCImageObjects(0) , m_nCImageObjects(0)
@ -932,13 +932,13 @@ private:
::InitializeCriticalSection(&m_sect); ::InitializeCriticalSection(&m_sect);
} }
~CInitGDIPlus() throw() ~CInitGDIPlus() noexcept
{ {
ReleaseGDIPlus(); ReleaseGDIPlus();
::DeleteCriticalSection(&m_sect); ::DeleteCriticalSection(&m_sect);
} }
bool Init() throw() bool Init() noexcept
{ {
::EnterCriticalSection(&m_sect); ::EnterCriticalSection(&m_sect);
@ -975,7 +975,7 @@ private:
return ret; return ret;
} }
void ReleaseGDIPlus() throw() void ReleaseGDIPlus() noexcept
{ {
::EnterCriticalSection(&m_sect); ::EnterCriticalSection(&m_sect);
if (m_dwToken) if (m_dwToken)
@ -994,14 +994,14 @@ private:
::LeaveCriticalSection(&m_sect); ::LeaveCriticalSection(&m_sect);
} }
void IncreaseCImageCount() throw() void IncreaseCImageCount() noexcept
{ {
::EnterCriticalSection(&m_sect); ::EnterCriticalSection(&m_sect);
++m_nCImageObjects; ++m_nCImageObjects;
::LeaveCriticalSection(&m_sect); ::LeaveCriticalSection(&m_sect);
} }
void DecreaseCImageCount() throw() void DecreaseCImageCount() noexcept
{ {
::EnterCriticalSection(&m_sect); ::EnterCriticalSection(&m_sect);
if (--m_nCImageObjects == 0) if (--m_nCImageObjects == 0)
@ -1014,7 +1014,7 @@ private:
static CInitGDIPlus s_gdiplus; static CInitGDIPlus s_gdiplus;
static bool InitGDIPlus() throw() static bool InitGDIPlus() noexcept
{ {
return s_gdiplus.Init(); return s_gdiplus.Init();
} }
@ -1134,7 +1134,7 @@ private:
} }
void AttachInternal(HBITMAP hBitmap, DIBOrientation eOrientation, void AttachInternal(HBITMAP hBitmap, DIBOrientation eOrientation,
LONG iTransColor) throw() LONG iTransColor) noexcept
{ {
Destroy(); Destroy();
@ -1154,7 +1154,7 @@ private:
BOOL CreateInternal(int nWidth, int nHeight, int nBPP, BOOL CreateInternal(int nWidth, int nHeight, int nBPP,
DWORD eCompression, const DWORD* pdwBitmasks = NULL, DWORD eCompression, const DWORD* pdwBitmasks = NULL,
DWORD dwFlags = 0) throw() DWORD dwFlags = 0) noexcept
{ {
ATLASSERT(nWidth != 0); ATLASSERT(nWidth != 0);
ATLASSERT(nHeight != 0); ATLASSERT(nHeight != 0);
@ -1234,12 +1234,12 @@ public:
{ {
} }
virtual ~CImageDC() throw() virtual ~CImageDC() noexcept
{ {
m_image.ReleaseDC(); m_image.ReleaseDC();
} }
operator HDC() const throw() operator HDC() const noexcept
{ {
return m_hDC; return m_hDC;
} }