/** * @file XTGraphicUtils.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ /** @cond */ #if !defined(__XTPGRAPHICUTILS_H__) # define __XTPGRAPHICUTILS_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 class _XTP_EXT_CLASS CXTPGraphicUtils { public: static BOOL AFX_CDECL SaveBitmapToFile(HBITMAP hBitmap, LPCTSTR lpszFileName); static Gdiplus::Status AFX_CDECL GdipCreateBitmapFromHICON_Fixed(HICON hicon, Gdiplus::Bitmap** bitmap); ////////////////////////////////////////////////////////////////////////// // The following function (GdipCreateBitmapFromHICON_Fixed_Native) // is a fixed version of Microsoft one // The problem of the original code not saving of transparency // of HICON (alpha channel). The bug dates to 2001 (!) when GDI+ // was originally introduced. It is widely mentioned on Microsoft websites // with some workarounds (not working for our case). // The bug is not fixed and doesn't seem to be planned to be fixed. // The code is based on wine (www.winehq.org) code ////////////////////////////////////////////////////////////////////////// static Gdiplus::Status AFX_CDECL GdipCreateBitmapFromHICON_Fixed_Native(HICON hicon, Gdiplus::GpBitmap** bitmap); }; _XTP_EXT_CLASS BOOL AFX_CDECL GetEncoderClsid(const WCHAR* format, CLSID* pClsid); _XTP_EXT_CLASS LPCWSTR AFX_CDECL GetMimeType(LPCTSTR lpszFileName); /** @cond */ #endif // #if !defined(__XTPGRAPHICUTILS_H__) /** @endcond */