Page 1 of 1

gdiPlus stringFormat object behavior

Posted: 22 Apr 2024 20:26
by Harrison Pratt
A gdiPlus stringFormat object seems to behave like a persistent object between clauses.

If I create stringFormat object in the onPaint/3 clause of a dialog, and in a sububordinate clause called by onPaint/3 create a new stringFormat object with different formatFlags (e.g., stringFormatFlagsDirectionVertical) then the next pass through onPaint/3 clause creates a stringFormatter object with the stringFormatFlagsDirectionVertical flag set.

It is not a problem to restore the original formatFlags in the subordinate clause, but it is unexpected behavior.

Sample code from a test dialog is attached.

Re: gdiPlus stringFormat object behavior

Posted: 23 Apr 2024 14:03
by Thomas Linder Puls
That is a bug. We will correct it (in build 1111).

Re: gdiPlus stringFormat object behavior

Posted: 23 Apr 2024 16:50
by Harrison Pratt
There seems to be a lot of discussion about stringFormat object persistence:

https://groups.google.com/g/microsoft.p ... qwsn6MvfpM