Bonjour,
C'est étrange, le code suivant :
Private
Sub Form1_Paint(ByVal sender AsObject, ByVal e As System.Windows.Forms.PaintEventArgs) HandlesMe.Paint
Dim g As Graphics = e.Graphics
Dim pth As GraphicsPath = New GraphicsPath()
dim f as font=New Font("Arial", 10)
pth.AddString("Hello the World", f.Font.FontFamily, f.Font.Style, f.Font.Size * 20 / (1440 / g.DpiX), New Rectangle(0,0, me.Width, me.Height), StringFormat.GenericDefault)
g.FillPath(Brushes.White, pthOutline)
EndSubet celui-ci :
PrivateSub Form1_Paint(ByVal sender AsObject, ByVal e As System.Windows.Forms.PaintEventArgs) HandlesMe.Paint
Dim g As Graphics = e.Graphics
dim f as font=New Font("Arial", 10)
g.DrawString("Hello the Wordl", f.Font, New SolidBrush(Color.White), New Rectangle(0,0,Me.Width, Me.Height))
EndSub
Donnent 2 textes avec un léger décalage entre les caractères. DrawString donne une texte équivalent à tout composant MS (label, ..) mais pas le couple pth.AddString & pth.fillPath où le texte est sur une zone plus large
C'est ennyant car Drawstring possède un caractère super bien nette mais moins GraphicPath puis qu'il s'agit de remplissage, donc plus flou.
Comment peut-on faire en sorte que graphicpath contienne le string avec les même espacements entre les lettres que drawstring ?
TIGER