CGpPen Class - out of sync

Started by hajubu, November 07, 2025, 04:34:10 AM

Previous topic - Next topic

hajubu

Hi
---
It seems that CGpen.inc and CGpPen Class.md need update to reflect added third parameter Gpunit in CGdiPlus.inc
---
::AfxNova::CGpen.inc:: out of sync
->(35): PRIVATE CONSTRUCTOR CGpPen (BYVAL colour AS ARGB, BYVAL nWidth AS SINGLE = 1.0, /' / added / '/  BYVAL unit AS GpUnit = UnitWorld)
->(44): PRIVATE CONSTRUCTOR CGpPen (BYVAL pBrush AS CGpBrush PTR, BYVAL nWidth AS SINGLE = 1.0, /' / added / '/  BYVAL unit AS GpUnit = UnitWorld)
---
::Docs::(at least):: CGpPen Class.md  out of sync ::
->(63): CONSTRUCTOR CGpPen (BYVAL pBrush AS CGpBrush PTR, BYVAL nWidth AS SINGLE = 1.0, BYVAL unit AS GpUnit = UnitWorld)
->(64): CONSTRUCTOR CGpPen (BYVAL colour AS ARGB, BYVAL nWidth AS

should follow CGdiPlus.inc of 2025-11-06 - commit::4744520 and 37eb14a

b.r.

José Roca

Yes. Yesterday I added

' =====================================================================================
' * Creates a Pen object that uses a specified color and width.
' =====================================================================================
PRIVATE CONSTRUCTOR CGpPen (BYVAL colour AS ARGB, BYVAL nWidth AS SINGLE = 1.0, BYVAL unit AS GpUnit = UnitWorld)
   m_Status = GdipCreatePen1(colour, nWidth, unit, @m_pPen)
END CONSTRUCTOR
' =====================================================================================

' =====================================================================================
' Creates a Pen object that uses the attributes of a brush and a real number to set the
' width of this Pen object.
' =====================================================================================
PRIVATE CONSTRUCTOR CGpPen (BYVAL pBrush AS CGpBrush PTR, BYVAL nWidth AS SINGLE = 1.0, BYVAL unit AS GpUnit = UnitWorld)
   m_Status = GdipCreatePen2(pBrush->m_pBrush, nWidth, unit, @m_pPen)
END CONSTRUCTOR
' =====================================================================================

The reason is that using UnitWorld, as the C++ classes do, the left and right edges of the rectangles appear wider that they should when using a DPI higger that 96. Works better if you use UnitPixel.

File reuploaded.

I have added many new examples.