Может, ещё кому понадобится.
Перед использованием нужно заменить 866 на нужное число.
- Код: Выделить всё
Option Explicit
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Declare Function TextOutW Lib "gdi32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, lpString As Integer, ByVal nCount As Long) As Long
Private Declare Function MultiByteToWideChar Lib "kernel32" (ByVal CodePage As Long, ByVal dwFlags As Long, lpMultiByteStr As Byte, ByVal cchMultiByte As Long, lpWideCharStr As Integer, ByVal cchWideChar As Long) As Long
Private Declare Function GetGlyphIndicesW Lib "gdi32" (ByVal hDC As Long, lpstr As Integer, ByVal c As Long, pgi As Integer, ByVal fl As Long) As Long
Sub Form_Load()
AutoRedraw = True
FontName = "Tahoma"
FontSize = 28
Dim x As Long, y As Long, c As Byte, w As Integer, i As Integer, u As String
For x = 2 To 15
For y = 0 To 15
c = x * 16 + y
MultiByteToWideChar 866, 0, c, 1, w, 1
GetGlyphIndicesW hDC, w, 1, i, 1
If i <> -1 Then
TextOutW hDC, x * 40, y * 40, w, 1
Else
u = Right("0000" & Hex(w), 4)
FontSize = FontSize / 3
TextOut hDC, x * 40 + 5, y * 40 + 10, Left(u, 2), 2
TextOut hDC, x * 40 + 5, y * 40 + 20, Right(u, 2), 2
FontSize = FontSize * 3
End If
Next
Next
ForeColor = vbRed
FontSize = FontSize / 2
For y = 0 To 15
TextOut hDC, 0, y * 40 + 10, 0 & Hex(y), 2
Next
For x = 2 To 15
TextOut hDC, x * 40, 16 * 40, Hex(x * 16), 2
Next
End Sub