Sub LoadString(ByRef Path As String, ByRef Context As String, ByRef Brush As XXXXXXXXXXXXXXXXXush, ByVal Size As Integer, Optional ByVal Width As Integer = 1920, Optional ByVal Height As Integer = 1080)
’///////////////////////////////字符绘制////////////////////////////
Dim Image As XXXXXXXXXXXXXXXXXtmap = New Bitmap(Width, Height)
Dim GDI As XXXXXXXXXXXXXXXXXaphics = XXXXXXXXXXXomImage(Image)
Dim FontFamily As XXXXXXXXXXXXXXXXXntFamily = New FontFamily("微软雅黑")
Dim Font As XXXXXXXXXXXXXXXXXnt = New Font(FontFamily, Size, XXXXXXXXXXXXgular, GraphicsUnit.Pixel)
XXXXXXoothingMode = XXXXXXXXXXXXXXXXXXXXXXXXXXtiAlias
XXXXXXterpolationMode = XXXXXXXXXXXXterpolationMode.High
GDI.DrawString(Context, Font, Brush, 0, 0)
GDI.Dispose() : Font.Dispose() : FontFamily.Dispose()
‘///////////////////转灰度,其实算法改下就可以转黑白//////////////////////////
Dim Rect As Rectangle = New Rectangle(0, 0, Image.Width, Image.Height)
Dim Color As XXXXXXXXXXXXXXXXXlor : Dim ColorTmp As XXXXXXXXXXXXXXXXXlor
For i = 0 To Rect.Width - 1 Step 1
For j = 0 To Rect.Height - 1 Step 1
Color = XXXXXXXXtPixel(i, j)
Dim TmpInt As Integer = (CInt(Color.R) + CInt(Color.G) + CInt(Color.B)) \ 3
ColorTmp = XXXXXXXXXXXXXXXXXXXXXXXomArgb(TmpInt, TmpInt, TmpInt)
XXXXXXXXtPixel(i, j, ColorTmp)
Next j
Next i
‘/////////////////接下来就是读这个Bitmap的每个像素,按照显示屏的类型生成点阵数据了
’/////////////////String类还是很强大的/////////////////
End Sub
200字以内,仅用于支线交流,主线讨论请采用回复功能。