mikeyww wrote: ↑18 Apr 2021, 11:27
I have not tested, but try:
Code: Select all
Gdip_TextToGraphics(G, "Hello!", "x10 y10 CFFFFFF", "Arial")
With CFFFFFF it does not write anything
The doc I got doesn't help much:
Code: Select all
Gdip_TextToGraphics(pGraphics, Text, Options, Font:="Arial", Width:="", Height:="", Measure:=0, userBrush:=0, Unit:=0) { ;gdi
; Font parameter can be a name of an already installed font or it can point to a font file
; to be loaded and used to draw the string.
;
; Set Unit to 3 [Pts] to have the texts rendered at the same size
; with the texts rendered in GUIs with -DPIscale
;
; userBrush - if a pBrush object is passed, this will be used to draw the text
; Remarks: by changing the alignment, the text will be rendered at a different X
; coordinate position; the position of the text is set relative to
; the given X position coordinate and the text width..
; See also Gdip_SetStringFormatAlign().
;
; On success, the function returns a string in the following format:
; "x|y|width|height|chars|lines"
; The first four elements represent the boundaries of the text.
; The string is returned by Gdip_MeasureString()
I could see that it uses some regex to match the options
Code: Select all
Static Styles := "Regular|Bold|Italic|BoldItalic|Underline|Strikeout", Alignments := "Near|Left|Centre|Center|Far|Right" ;gdi
IWidth := Width, IHeight:= Height ;gdi
pattern_opts := (A_AhkVersion < "2") ? "iO)" : "i)" ;gdi
RegExMatch(Options, pattern_opts "X([\-\d\.]+)(p*)", xpos) ;gdi
RegExMatch(Options, pattern_opts "Y([\-\d\.]+)(p*)", ypos) ;gdi
RegExMatch(Options, pattern_opts "W([\-\d\.]+)(p*)", Width) ;gdi
RegExMatch(Options, pattern_opts "H([\-\d\.]+)(p*)", Height) ;gdi
RegExMatch(Options, pattern_opts "C(?!(entre|enter))([a-f\d]+)", Colour) ;gdi
RegExMatch(Options, pattern_opts "Top|Up|Bottom|Down|vCentre|vCenter", vPos) ;gdi
RegExMatch(Options, pattern_opts "NoWrap", NoWrap) ;gdi
RegExMatch(Options, pattern_opts "R(\d)", Rendering) ;gdi
RegExMatch(Options, pattern_opts "S(\d+)(p*)", Size) ;gdi