새 vs 프로젝트에 두 개의 vb 파일을 추가했는데 아래 코드의 마지막 줄에 문제가있는 것 같습니다. 오류가 발생합니다 : 연산자 '*'가 'Char'및 'String'유형에 대해 정의되지 않았습니다.Operator * 형식 char 및 문자열에 대해 정의되지 않았습니다.
VB에서 너무 많이 알지 못해서 누군가이 마지막 줄에서 무슨 일을하는지 설명하고 오류를 해결할 수 있습니까? = UnicodeFonts.GetCharImage (폰트, CharType.FromString (Strings.Mid (텍스트 -
어레이 (1 전)는 mStream하여 FileStream에게
Public Shared Function GetCharImage(Font As Integer, c As Char) As Bitmap
If UnicodeFonts.mStream Is Nothing Then
UnicodeFonts.Init()
End If
' The following expression was wrapped in a checked-statement
UnicodeFonts.mStream = UnicodeFonts.Stream(Font - 1)
UnicodeFonts.mReader = UnicodeFonts.Reader(Font - 1)
' The following expression was wrapped in a checked-expression
UnicodeFonts.mStream.Seek(CLng(c * ""), 0)
편집 *** 상기 메소드를 호출 라인이입니다 , I))) 이하의 방법에서
:
Public Shared Function GetStringImage(Font As Integer, Text As String) As Bitmap
' The following expression was wrapped in a checked-statement
Dim array As Bitmap() = New Bitmap(Strings.Len(Text) - 1 + 1 - 1) {}
Dim arg_19_0 As Integer = 1
Dim num As Integer = Strings.Len(Text)
Dim num2 As Integer
Dim height As Integer
For i As Integer = arg_19_0 To num
array(i - 1) = UnicodeFonts.GetCharImage(Font, CharType.FromString(Strings.Mid(Text, i)))
num2 += array(i - 1).Width
If array(i - 1).Height > height Then
height = array(i - 1).Height
End If
Next
Dim bitmap As Bitmap = New Bitmap(num2, height, PixelFormat.Format32bppArgb)
Dim graphics As Graphics = Graphics.FromImage(bitmap)
Dim arg_8C_0 As Integer = 1
Dim num3 As Integer = Strings.Len(Text)
For j As Integer = arg_8C_0 To num3
Dim num4 As Integer
graphics.DrawImage(array(j - 1), num4, 0)
num4 += array(j - 1).Width
Next
Dim arg_C4_0 As Integer = 1
Dim num5 As Integer = Strings.Len(Text)
For k As Integer = arg_C4_0 To num5
array(k - 1).Dispose()
Next
graphics.Dispose()
Return bitmap
End Function
코드 폰트 파일을 포함하는 작업을한다.
수행 할 코드는 무엇입니까? 누군가가 Seek 명령을 오해했을 수도 있습니다 (검색 기능이 아닙니다). 실제 오류는 c를 ""로 곱한 결과입니다. 이는 의미가 없습니다. – Alan
코드에서 주석을 기반으로, 나는 이것이 C#에서 번역 된 것인데,이 경우 일부 포인터 작업의 일부일 수 있습니다. – Plutonix
* 지금 * 번역 된 코드의 VB 번역처럼 보입니다. 번역은 여전히 ... 불완전 해 보입니다. 아마도 우리가 뭘 하려는지 알았다면 ... – Plutonix