DrawString looks garbled.

  • Thread starter Thread starter avoriv
  • Start date Start date
A

avoriv

Guest
I use Visual Studio 2017 VB.NET for drawing wrapmode text in the Form.
In the some cases, the drawing text looks garbled.
Sample code:

Public Class Form1
Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
Dim sf As StringFormat = New StringFormat
Dim fnt As Font = New Font("Arial", 10, FontStyle.Underline)
Dim br As Brush = SystemBrushes.ControlText
sf.Alignment = StringAlignment.Far
e.Graphics.DrawString("City:", fnt, br, New RectangleF(0, 0, 90, 40), sf)
sf.Alignment = StringAlignment.Near
e.Graphics.DrawString("Zeebrugge, Brugge", fnt, br, New RectangleF(91, 0, 90, 40), sf)
End Sub
End Class

1304574.png

Continue reading...
 
Back
Top