Bonjour,

voici un bout de code qui affiche du texte :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
 
Gdiplus::Graphics graphics(Canvas->Handle);
 
Gdiplus::Font F("Arial",12);
 
Gdiplus::PointF origin(0,10);
Gdiplus::SolidBrush black(Gdiplus::Color(255, 0, 0, 0));
 
graphics.DrawString(L"voici du texte", -1, &F, origin, &black);
je souhaiterai maintenant pouvoir afficher du texte sur un canvas dans n'importe quelle langue.
Avez-vous une idée de comment procéder?

Pour info j'ai trouvé ceci sur le net, mais je comprenbd pas trop :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
Protected Overrides Sub OnPaint(e As PaintEventArgs)
e.Graphics.TextRenderingHint = TextRenderingHint.AntiAliased
e.Graphics.FillRectangle(new SolidBrush(Color.White), ClientRectangle)
 
Try
    Dim japaneseFont As New Font("MS Mincho", 32)
    Dim japaneseText As New String(new char() {CType(31169, Char), CType(12398, Char), 
        _CType(21517, Char), CType(21069, Char), CType(12399, Char),
        _CType(12463, Char), CType(12522, Char), CType(12473, Char),
        _CType(12391, Char), CType(12377, Char), CType(12290, Char)})
    e.Graphics.DrawString(japaneseText, japaneseFont, new SolidBrush(Color.Blue), 20, 40)
Catch ex As Exception
    MessageBox.Show("You need to install the Japanese language pack to run this sample")
    Application.Exit()
End Try
Merci pour votre aide.