comment peut on ajouter un text a Graphicspath() ???
j'ai esssayé avec mypah.addString mais j'ai pas bien compris les parametres de cette methode.
Version imprimable
comment peut on ajouter un text a Graphicspath() ???
j'ai esssayé avec mypah.addString mais j'ai pas bien compris les parametres de cette methode.
Bonjour detetop,
As-tu regardé dans l'aide en faisant F1 dans VB ?
C'est détaillé et en plus tu as un exemple voici le chemin dans l'aide :
ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.fr/cpref8/html/M_System_Drawing_Drawing2D_GraphicsPath_AddString_3_16cdd2a4.htm
Les paramètres sont expliqués.
Voici ce que l'on peut y lire :
Arrives-tu à t'en servir ?Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 Dim instance As GraphicsPath Dim s As String Dim family As FontFamily Dim style As Integer Dim emSize As Single Dim origin As Point Dim format As StringFormat instance.AddString(s, family, style, emSize, origin, format) Explication des paramètres : s String à ajouter. family FontFamily qui correspond au nom de la police utilisée pour dessiner le test. style Énumération FontStyle qui représente les informations sur le style du texte (gras, italique, etc.). Elle doit être castée en un entier (consultez l'exemple de code figurant plus loin dans cette rubrique). emSize Hauteur du carré cadratin englobant le caractère. origin Point représentant le point où le texte commence. format StringFormat qui spécifie des informations sur la mise en forme du texte telles que l'espacement des lignes et l'alignement.
Sinon, tous les paramètres sont expliqués sur MSDN
voir ici
avec l'exemple:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13 ' Create a GraphicsPath object. Dim myPath As New GraphicsPath() ' Set up all the string parameters. Dim stringText As String = "Sample Text" 'le texte a afficher Dim family As New FontFamily("Arial")' la Police de carzatère Dim myfontStyle As Integer = CInt(FontStyle.Italic)'pour mettre le texte en italic Dim emSize As Integer = 26' taille du texte Dim origin As New Point(20, 20)' le point sur la zone de dessin ou commenceras le texte Dim format As StringFormat = StringFormat.GenericDefault ' Add the string to the path. myPath.AddString(stringText, family, myfontStyle, emSize, origin, format)