Stroke i System.Drawing
Hej EksperterJeg har et script som generer et bilelde ud fra noget tekst.
Er der en måde jeg kan få det script til at lave en sort stroke (outline) rundt om teksten?
Her er min kode:
Public Sub TextToImage(ByVal Tekst As String, ByVal Path As String)
Dim Text As String = Tekst
Dim FontColor As Color = Color.White
Dim BackColor As Color = Color.Transparent
Dim FontName As String = "Arial Black"
Dim FontSize As Integer = 17
Dim Height As Integer = 20
Dim Width As Integer = 168
Dim FileName As String = "box1"
Dim objBitmap As New Bitmap(Width, Height)
Dim objGraphics As Graphics = Graphics.FromImage(objBitmap)
'Dim objColor As Color
Dim objFont As New Font(FontName, FontSize, FontStyle.Regular, GraphicsUnit.Pixel)
Dim objPoint As New PointF(-3.0F, -4.0F)
Dim objBrushForeColor As New SolidBrush(FontColor)
Dim objBrushBackColor As New SolidBrush(BackColor)
objGraphics.FillRectangle(objBrushBackColor, 0, 0, Width, Height)
objGraphics.DrawString(Text, objFont, objBrushForeColor, objPoint)
objBitmap.Save(Path & FileName & ".png", ImageFormat.Png)
End Sub
Håber i kan hjælpe.
Stefan