| http://www.sqlsky.com/ |
|
|
Java提供了将图形转储为jpg格式的功能, 但这种格式不是矢量格式,没办法在word等软件中修改,编辑。
word中的矢量图形格式是wmf(Windows Meta File)。这种格式主要由一个或两个information headers组成,结构如下:
typedef struct _WindowsMetaHeader { WORD FileType; /* Type of metafile (0=memory, 1=disk) */ WORD HeaderSize; /* Size of header in WORDS (always 9) */ WORD Version; /* Version of Microsoft Windows used */ DWORD FileSize; /* Total size of the metafile in WORDs */ WORD NumOfObjects; /* Number of objects in the file */ DWORD MaxRecordSize; /* The size of largest record in WORDs */ WORD NumOfParams; /* Not Used (always 0) */ } WMFHEAD;除了headers之外下面就是文件记录(Standard Metafile Records)。结构如下:
typedef struct _StandardMetaRecord { DWORD Size; /* Total size of the record in WORDs */ WORD Function; /* Function number (defined in WINDOWS.H) */ WORD Parameters[]; /* Parameter values passed to function */ } WMFRECORD; 也就是说每一个record中储存的是Windows GDI绘图函数的代码及每个函数对应的参数.这样的| Record Name | Function Number |
|---|---|
| AbortDoc | 0x0052 |
| Arc | 0x0817 |
| Chord | 0x0830 |
| DeleteObject | 0x01f0 |
| Ellipse | 0x0418 |