All pastes #72396 Raw Edit

johnm1019

public text v1 · immutable
#72396 ·published 2006-06-26 20:28 UTC
rendered paste body
    Private Sub PrintParagraph(ByVal strParagraph As String, ByRef g As Graphics)
        Dim f As New Font("Verdana", 9)
        Dim i As Integer
        Dim x As Integer
        Dim y As Integer
        Dim z As Integer
        Dim pos As New Point(0, 0)
        Dim WordSize As New SizeF
        Dim s() As String = Split(strParagraph, "<br />")
        For x = 0 To (s.Length - 1)
            If s(x).Length > 40 Then
                y = Math.Floor((s(x).Length / 40))
                For z = 1 To y
                    s(x) = s(x).Insert((y * 40), "<br />")
                Next
            End If
        Next
        pos.Y = 0
        pos.X = 0
        For i = 0 To UBound(s)
            pos.Y = pos.Y + 20
            g.DrawString(s(i), f, New SolidBrush(Color.Black), pos.X, pos.Y)
        Next
    End Sub