/** * @file XTPMarkupGdiImage.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(__XTPMARKUPGDIIMAGE_H__) # define __XTPMARKUPGDIIMAGE_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPImageManager; class CXTPImageManagerIcon; /** * @brief * Implements an abstract GDI device dependent image. */ class _XTP_EXT_CLASS CXTPMarkupGdiImage : public CXTPMarkupDeviceDependentImage { /** @cond */ DECLARE_DYNAMIC(CXTPMarkupGdiImage); /** @endcond */ public: /** * @brief * Constructs a device dependent image object. * @param pSite Valid pointer to an image site interface. */ explicit CXTPMarkupGdiImage(IXTPMarkupDeviceDependentImageSite* pSite); /** * @brief * Handles device dependent image object deallocation. */ virtual ~CXTPMarkupGdiImage(); public: /** * @brief * Loads an image from a specified resource. * @param lpszSource Pointer to a string that indicates the image source. Can * be a relative or full file path, file:// path, res:// * path, or an integer in decimal representation that indicates * the icon index. * @param nWidth Width of the image to be loaded. Used only for icons. Can * be 0 if not relevant. * @param nHeight Width of the image to be loaded. Used only for XAML and SVG icons. * @return * TRUE if the image is loaded successfully. */ virtual BOOL Load(LPCWSTR lpszSource, int nWidth, int nHeight = 0); /** * @brief * Obtains the wrapped image pointer. * @return * The wrapped image pointer. */ CXTPImageManagerIcon* GetNativeImage(); private: CXTPImageManager* m_pImageManager; CXTPImageManagerIcon* m_pImage; CXTPMarkupContext* m_pMarkupContext; }; AFX_INLINE CXTPImageManagerIcon* CXTPMarkupGdiImage::GetNativeImage() { return m_pImage; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif /*__XTPMARKUPGDIIMAGE_H__*/ /** @endcond */