Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Serach text within a metafile.

25 views
Skip to first unread message

MF

unread,
Jan 27, 2003, 10:43:31 AM1/27/03
to
Do someone knows how to search for text in a WMF/EMF canvas ?
(EnumEnhMetaFile & EnhMetaFileProc ?)

I would like to know the text but the position and font too.
Can anyone point me in the right direction ?

Best regards,


Daniel Rüdisser

unread,
Jan 29, 2003, 4:15:44 AM1/29/03
to
Dear MF,
I'm not sure if I have understood your problem, but:
EMF, and WMF consist of (32-bit (EMF) or
16-bit (WMF) records of the following type:

ReferenceNo,Size,[Data]

Size contains the length of the whole record (counted
in 32-bit (EMF) or 16-bit integers). (So data
has the length size-2 !)
So it is easy to scramble through the file and
read the records.
When you find a record with a reference number
used by a TextOut command (eg. 83,84) then you
can go through the data of this record.
The format of the records (structures) is given
in the MSDN library:
http://msdn.microsoft.com/library/en-us/gdi/metafile_5hkj.asp?frame=true
So it shouldn't be a problem to find your text and
the font type.
Kind Regards,
Don Dan
Here a list of the possible structures and their reference number:
1 EMR_HEADER
2 EMR_POLYBEZIER
3 EMR_POLYGON
4 EMR_POLYLINE
5 EMR_POLYBEZIERTO
6 EMR_POLYLINETO
7 EMR_POLYPOLYLINE
8 EMR_POLYPOLYGON
9 EMR_SETWINDOWEXTEX
10 EMR_SETWINDOWORGEX
11 EMR_SETVIEWPORTEXTEX
12 EMR_SETVIEWPORTORGEX
13 EMR_SETBRUSHORGEX
14 EMR_EOF
15 EMR_SETPIXELV
16 EMR_SETMAPPERFLAGS
17 EMR_SETMAPMODE
18 EMR_SETBKMODE
19 EMR_SETPOLYFILLMODE
20 EMR_SETROP2
21 EMR_SETSTRETCHBLTMODE
22 EMR_SETTEXTALIGN
23 EMR_SETCOLORADJUSTMENT
24 EMR_SETTEXTCOLOR
25 EMR_SETBKCOLOR
26 EMR_OFFSETCLIPRGN
27 EMR_MOVETOEX
28 EMR_SETMETARGN
29 EMR_EXCLUDECLIPRECT
30 EMR_INTERSECTCLIPRECT
31 EMR_SCALEVIEWPORTEXTEX
32 EMR_SCALEWINDOWEXTEX
33 EMR_SAVEDC
34 EMR_RESTOREDC
35 EMR_SETWORLDTRANSFORM
36 EMR_MODIFYWORLDTRANSFORM
37 EMR_SELECTOBJECT
38 EMR_CREATEPEN
39 EMR_CREATEBRUSHINDIRECT
40 EMR_DELETEOBJECT
41 EMR_ANGLEARC
42 EMR_ELLIPSE
43 EMR_RECTANGLE
44 EMR_ROUNDRECT
45 EMR_ARC
46 EMR_CHORD
47 EMR_PIE
48 EMR_SELECTPALETTE
49 EMR_CREATEPALETTE
50 EMR_SETPALETTEENTRIES
51 EMR_RESIZEPALETTE
52 EMR_REALIZEPALETTE
53 EMR_EXTFLOODFILL
54 EMR_LINETO
55 EMR_ARCTO
56 EMR_POLYDRAW
57 EMR_SETARCDIRECTION
58 EMR_SETMITERLIMIT
59 EMR_BEGINPATH
60 EMR_ENDPATH
61 EMR_CLOSEFIGURE
62 EMR_FILLPATH
63 EMR_STROKEANDFILLPATH
64 EMR_STROKEPATH
65 EMR_FLATTENPATH
66 EMR_WIDENPATH
67 EMR_SELECTCLIPPATH
68 EMR_ABORTPATH
70 EMR_GDICOMMENT
71 EMR_FILLRGN
72 EMR_FRAMERGN
73 EMR_INVERTRGN
74 EMR_PAINTRGN
75 EMR_EXTSELECTCLIPRGN
76 EMR_BITBLT
77 EMR_STRETCHBLT
78 EMR_MASKBLT
79 EMR_PLGBLT
80 EMR_SETDIBITSTODEVICE
81 EMR_STRETCHDIBITS
82 EMR_EXTCREATEFONTINDIRECTW
83 EMR_EXTTEXTOUTA
84 EMR_EXTTEXTOUTW
85 EMR_POLYBEZIER16
86 EMR_POLYGON16
87 EMR_POLYLINE16
88 EMR_POLYBEZIERTO16
89 EMR_POLYLINETO16
90 EMR_POLYPOLYLINE16
91 EMR_POLYPOLYGON16
92 EMR_POLYDRAW16
93 EMR_CREATEMONOBRUSH
94 EMR_CREATEDIBPATTERNBRUSHPT
95 EMR_EXTCREATEPEN
96 EMR_POLYTEXTOUTA
97 EMR_POLYTEXTOUTW

"MF" <m.fon...@4gl.fr> schrieb im Newsbeitrag
news:3e355385$0$11278$7a62...@news.club-internet.fr...

Johan

unread,
Feb 19, 2003, 8:45:39 AM2/19/03
to
See EnumEnhMetaFile & EnhMetaFileProc in the online help. Takes a
callback which gets passed each record in the metafile. /johan
0 new messages