/** * @file XTPChartGdiDeviceContext.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(__XTPCHARTGDIDEVICECONTEXT_H__) # define __XTPCHARTGDIDEVICECONTEXT_H__ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" namespace Gdiplus { class GpGraphics; class GpFont; class Graphics; } // namespace Gdiplus class CXTPChartContainer; class CXTPChartDeviceCommand; class _XTP_EXT_CLASS CXTPChartGdiDeviceContext : public CXTPChartDeviceContext { DECLARE_DYNAMIC(CXTPChartGdiDeviceContext); public: /** * @brief * Constructs a CXTPChartGdiDeviceContext object. * * @param pContainer Pointer to a CXTPChartContainer object. * @param hDC Handle to the windows device context. * @param p3dDC Pointer to a CXTPChartDeviceContext object. */ CXTPChartGdiDeviceContext(CXTPChartContainer* pContainer, HDC hDC, CXTPChartDeviceContext* p3dDC = NULL); /** * @brief * Constructs a CXTPChartGdiDeviceContext object. * * @param pContainer Pointer to a CXTPChartContainer object. * @param hDC Handle to the windows device context. * @param Graphics Pointer to a GDI+ graphics object. */ CXTPChartGdiDeviceContext(CXTPChartContainer* pContainer, Gdiplus::Graphics*, HDC hDC); /** * @brief * Destroys a CXTPChartGdiDeviceContext object, handles cleanup. */ ~CXTPChartGdiDeviceContext(); /** * @brief * Obsolete. */ static void AFX_CDECL Register(BOOL bReserved); /** * @brief * Call this function to trigger the drawing. * * @param pCommand A pointer to a chart device command object. */ virtual void Execute(CXTPChartDeviceCommand* pCommand); /** * @brief * Call this function to get the GDI+ graphics class. * * @return A pointer to a GpGraphics object. */ Gdiplus::GpGraphics* GetGraphics() const; virtual BOOL GetNativeDrawing() const; virtual void SetNativeDrawing(BOOL bNativeDrawing); /** * @brief * Call this function to get the measurements of texts rendered in a * device context using a specific font. * * @param pText The string to be measured. * @param pFont Pointer to a chart font object. */ virtual CXTPChartSizeF MeasureString(const CXTPChartString* pText, CXTPChartFont* pFont); static void AFX_CDECL SaveToFile(HBITMAP hBitmap, LPCTSTR lpszFileName); virtual CXTPChartSizeF MeasureMarkupElement(CXTPMarkupUIElement* pMarkupUIElement, CXTPChartFont* pFont); protected: ULONG_PTR m_nGdiplusToken; /**< The GDI+ token.*/ Gdiplus::GpGraphics* m_pGpGraphics; /**< Pointer to GDI+ graphics object.*/ CXTPChartDeviceContext* m_p3dDC; /**< Optional 3D DC where all nested 3D commands has to be executed*/ }; AFX_INLINE Gdiplus::GpGraphics* CXTPChartGdiDeviceContext::GetGraphics() const { return m_pGpGraphics; } AFX_INLINE BOOL CXTPChartGdiDeviceContext::GetNativeDrawing() const { return TRUE; } AFX_INLINE void CXTPChartGdiDeviceContext::SetNativeDrawing(BOOL /*bNativeDrawing*/) { } # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTGDIDEVICECONTEXT_H__) /** @endcond */