Change $imagePath to be any image. I am using a 720x486 png that is pure transparency. Compare the window to the image. They are in the same relative position, and should be the same size.
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
$ImagePath = @ScriptDir & "\includes\transTemplate.png"
GUICreate("Text", 200, 100)
GUISetState()
$label = GUICtrlCreateLabel("Test 123", 10, 10, 190, 90)
GUICtrlSetFont(-1, 20, 400, 0, "Arial")
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile($ImagePath)
$hGraphics = _GDIPlus_ImageGetGraphicsContext($hImage)
;$hFontFamily = _GDIPlus_FontFamilyCreate("Arial")
;$hFont = _GDIPlus_FontCreate($hFontFamily, 20, 0, 3)
;$hFormat = _GDIPlus_StringFormatCreate ()
;$tLayout = _GDIPlus_RectFCreate (10, 10, 0, 0)
;$aInfo = _GDIPlus_GraphicsMeasureString ($hGraphics, "Test 123", $hFont, $tLayout, $hFormat)
;$hBrush = _GDIPlus_BrushCreateSolid ("0xFF000000")
;_GDIPlus_GraphicsDrawStringEx($hGraphics, "Test 123", $hFont, $aInfo[0], $hFormat, $hBrush)
;_GDIPlus_ImageSaveToFile($hImage, "FontSize.bmp")
$gFontFamily = _GDIPlus_FontFamilyCreate("Arial");$tFont)
$gFont = _GDIPlus_FontCreate($gFontFamily, 20, 0, 3)
$gBrush = _GDIPlus_BrushCreateSolid("0xFF000000")
$gFormat = _GDIPlus_StringFormatCreate()
$gLayout = _GDIPlus_RectFCreate(10, 10)
$gInfo = _GDIPlus_GraphicsMeasureString($hGraphics, "Test 123", $gFont, $gLayout, $gFormat)
_GDIPlus_GraphicsDrawStringEx($hGraphics, "Test 123", $gFont, $gInfo[0], $gFormat, $gBrush)
MsgBox(1, "", _GDIPlus_ImageSaveToFile($hImage, "FontSize.png"))
_GDIPlus_Shutdown()
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd