Quote
Maybe PaulIA's _API_CreateFontIndirect, but I see no examples of using this to give it a try.
Any idea how to choose MS Sans Serif, 14?
#include <A3LGDIPlus.au3>
Global $hGUI, $hWnd, $hGraphic, $hBrush, $hFormat, $hFamily, $hFont, $tLayout
Global $sString = "Hello world"
; Create GUI
$hGUI = GUICreate("GDI+", 400, 300)
$hWnd = WinGetHandle("GDI+")
GUISetState()
; Draw a string
_GDIP_Startup()
$hGraphic = _GDIP_GraphicsCreateFromHWND($hWnd)
$hBrush = _GDIP_BrushCreateSolid(0xFF00007F)
$hFormat = _GDIP_StringFormatCreate()
$hFont = _API_CreateFontIndirect(????)
$tLayout = _GDIP_RectFCreate(140, 110, 0, 0)
$aInfo = _GDIP_GraphicsMeasureString($hGraphic, $sString, $hFont, $tLayout, $hFormat)
_GDIP_GraphicsDrawStringEx($hGraphic, $sString, $hFont, $aInfo[0], $hFormat, $hBrush)
; Loop until user exits
do
until GUIGetMsg() = $GUI_EVENT_CLOSE
; Clean up resources
_API_DeleteObject ($hFont )
_GDIP_StringFormatDispose($hFormat )
_GDIP_BrushDispose ($hBrush )
_GDIP_GraphicsDispose ($hGraphic)
_GDIP_Shutdown()

Sign In
Register
Help
This topic is locked

MultiQuote