TigerFab
Messages postés115Date d'inscriptionsamedi 15 février 2003StatutMembreDernière intervention18 mai 2008
-
11 janv. 2008 à 15:53
TigerFab
Messages postés115Date d'inscriptionsamedi 15 février 2003StatutMembreDernière intervention18 mai 2008
-
14 janv. 2008 à 17:13
Bonjour,
C'est étrange, le code suivant :
Private
Sub Form1_Paint(
ByVal sender
As
Object,
ByVal e
As System.Windows.Forms.PaintEventArgs)
Handles
Me.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)
End
Sub
et 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))
End
Sub
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 ?