Text Output Functions (Colorizing for Console)

   Function funWriteTextColorful(sText As String) As Boolean

        Dim aColors = {ConsoleColor.Red, ConsoleColor.Magenta, ConsoleColor.Yellow, ConsoleColor.Green, ConsoleColor.Cyan, ConsoleColor.White}

        Static iColorNum As Integer

        'ReD,orange,yell,gre,blu,ind,vio

        Dim oldColor As ConsoleColor = Console.ForegroundColor

        For x As Integer = 0 To sText.Length - 1

            Dim ch As Char = Strings.Mid(sText, x + 1, 1)

            Console.ForegroundColor = aColors(iColorNum)

            Console.Write(ch)

            If Not Char.IsWhiteSpace(ch) Then iColorNum += 1

            If iColorNum Mod UBound(aColors) = 0 Then iColorNum = 0

        Next

        Console.ForegroundColor = oldColor

    End Function



    Function funWriteWordinColor(sText As String, cfFontColor As ConsoleColor)

        Dim oldColor As ConsoleColor = Console.ForegroundColor

        Console.ForegroundColor = cfFontColor

        Console.Write(sText)

        Console.ForegroundColor = oldColor

    End Function

Text Output  (spacing)

   Function funFormatColumns(sString As String, iCount As Integer, blnFormatAddSpace As Boolean)

        If iCount > Len(sString) Then

            Dim iDiff As Integer = iCount - Len(sString)

            funFormatColumns = sString & Space(iDiff)

        Else

            funFormatColumns = Left(sString, iCount)

        End If

        If blnFormatAddSpace Then funFormatColumns = funFormatColumns & " "

    End Function


Create Text as an Image on the fly and add to control

    Function createTextImage(text As String, oColor As Color) As String

        'Dim text As String = txtText.Text.Trim()

        Dim bitmap As New Bitmap(1, 1)

        Dim font As New Font("Arial", 25, FontStyle.Bold, GraphicsUnit.Pixel)

        Dim graphics As Graphics = Graphics.FromImage(bitmap)

        Dim width As Integer = CInt(graphics.MeasureString(text, font).Width)

        Dim height As Integer = CInt(graphics.MeasureString(text, font).Height)

        bitmap = New Bitmap(bitmap, New Size(width, height))

        graphics = Graphics.FromImage(bitmap)

        graphics.Clear(Color.White)

        graphics.SmoothingMode = SmoothingMode.AntiAlias

        graphics.TextRenderingHint = TextRenderingHint.AntiAlias

        'graphics.DrawString(text, font, New SolidBrush(Color.FromArgb(255, 0, 0)), 0, 0)

        graphics.DrawString(text, font, New SolidBrush(oColor), 0, 0)

        graphics.Flush()

        graphics.Dispose()

        Dim fileName As String = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()) & ".jpg"

        bitmap.Save(Environment.ExpandEnvironmentVariables("%TEMP%") & "\" & fileName, ImageFormat.Jpeg)

        'imgText.ImageUrl = "~/images/" & fileName

        'imgText.Visible = True

        Return Environment.ExpandEnvironmentVariables("%TEMP%") & "\" & fileName

    End Function

https://www.aspsnippets.com/Articles/Create-Text-Image-on-the-fly-with-ASPNet.aspx