e.Graphics.DrawString(srt、字体、画笔、点)以直线打印字符串。
如果我有一根很长的,像很长的绳子,我的意思是很长的。它只是把绳子印在纸上。
当字符串到达页边空白时,我该如何使它转到新行。
这是一个WinForms示例,表单上有一个PictureBox。
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
PictureBox1.Image = New Bitmap(400, 400)
Using oFont As Font = New Font("Arial", 16)
Using grp = Graphics.FromImage(PictureBox1.Image)
Dim LongString As String = "THIS IS A REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY REALLY LONG STRING"
grp.DrawString(LongString, oFont, Brushes.Black, New Rectangle(100, 100, 200, 200))
grp.Save()
End Using
End Using
End Sub