среда, 30 сентября 2009 г.

EmfPlusRecordType.EmfExtTextOutW

http://forums.devx.com/showthread.php?t=155532 
Private Function LabelEnumerateMetafileProc( _
ByVal recordType As EmfPlusRecordType, _
ByVal flags As Integer, _
ByVal dataSize As Integer, _
ByVal data As IntPtr, _
ByVal callbackData As PlayRecordCallback) As Boolean


Dim DataArray As Byte() = Nothing
If Not IntPtr.Zero.Equals(data) Then
DataArray = New Byte(dataSize) {}
Marshal.Copy(data, DataArray, 0, dataSize)
End If

If recordType = EmfPlusRecordType.EmfExtTextOutW Then
Dim nChars As Int32 = Marshal.ReadInt32(data, 36)
Dim TextUTF16 As New System.Text.UnicodeEncoding
Dim TextString As String = TextUTF16.GetString(DataArray, Marshal.ReadInt32(data, 40) - 8, nChars * 2)

If TextString Like "*pattern*" Then
'
' (text replacement code here)
'
Return True
End If
End If

LabelMetafile.PlayRecord(recordType, flags, dataSize, DataArray)

Return True

End Function


Offset Size Type

------------ ---------- ----------------

-8 4 emr.iType (the EmfPlusRecordType)

-4 4 emr.nSize

0 4 rclBounds.left (header is excluded, so record data actually starts here)

4 4 rclBounds.top

8 4 rclBounds.right

12 4 rclBounds.bottom

16 4 iGraphicsMode

20 4 exScale

24 4 eyScale

28 4 ptlReference.x

32 4 ptlReference.y

36 4 nChars

40 4 offString

44 4 fOptions

48 4 rcl.left

52 4 rcl.top

56 4 rcl.right

60 4 rcl.bottom

64 4 offDx

68 nChars*2 (string)

68+nChars*2 nChars*4 (intercharacter spacings)

Комментариев нет:

Отправить комментарий