现有的实现技术是使用OLE技术把autoCAD图形作为一个OLE对象嵌入到CAPP的工艺卡片中。存在的问题是:
1)附图的线条非常细;
2)彩色线条是虚线;
3)各个卡片中的文本、标注的尺寸大小不一致;(附图的放缩比例不同)
4)底色为黑色,如何变成白色?需要研究OLE是如何使用WMF文件的(OLE是以WMF格式显示嵌入到工艺卡片上的CAD图形的)。请各位大虾帮忙啦!
1)附图的线条非常细;
2)彩色线条是虚线;
3)各个卡片中的文本、标注的尺寸大小不一致;(附图的放缩比例不同)
4)底色为黑色,如何变成白色?需要研究OLE是如何使用WMF文件的(OLE是以WMF格式显示嵌入到工艺卡片上的CAD图形的)。请各位大虾帮忙啦!
WMF是WindowsMetafileFormat的缩写,文件扩展名是.wmf,是MicrosoftWindows中常见的一种图元文件格式。它具有文件短小、图案造型化的特点,整个图形常由各个独立的组成部分拼接而成,但其图形往往较粗糙,并且只能在MicrosoftOffice中调用编辑。http://www.china-askpro.com/msg22/qa61.shtml
a metafile consists of two parts: a header and a list of records. the header and records are described in the remainder of this topic. for a list of function-specific records, see metafile records. metafile headerthe metafile header contains a description of the size of the metafile and the number of drawing objects it uses. the drawing objects can be pens, brushes, bitmaps, or fonts.
the metafile header has the following form: typedef struct tagmetaheader {
word mttype;
word mtheadersize;
word mtversion;
dword mtsize;
word mtnoobjects;
dword mtmaxrecord;
word mtnoparameters;
} metaheader;following are the members in the metafile header: mttype specifies whether the metafile is stored in memory or recorded in a file. this member has one of the following values: value meaning0 metafile is in memory.
1 metafile is in a file. mtheadersize specifies the size, in words, of the metafile header.
mtversion specifies the windows version number. the version number for windows version 3.0 and later is 0x300.
mtsize specifies the size, in words, of the file.
mtnoobjects specifies the maximum number of objects that can exist in the metafile at the same time.
mtmaxrecord specifies the size, in words, of the largest record in the metafile.
mtnoparameters not used. typical metafile recordthe graphics device interface stores most of the gdi functions that an application can use to create metafiles in typical records.
a typical metafile record has the following form: struct {
dword rdsize;
word rdfunction;
word rdparm[];
}following are the members in a typical metafile record: rdsize specifies the size, in words, of the record.
rdfunction specifies the function number. this value may be the number of any function in the table at the end of this section.
rdparm identifies an array of words containing the function parameters (listed in the reverse order in which they are
passed to the function). following are the gdi functions found in typical records, along with their hexadecimal values: gdi function valuearc 0x0817
chord 0x0830
ellipse 0x0418
excludecliprect 0x0415
floodfill 0x0419
intersectcliprect 0x0416
lineto 0x0213
moveto 0x0214
offsetcliprgn 0x0220
offsetviewportorg 0x0211
offsetwindoworg 0x020f
patblt 0x061d
pie 0x081a
realizepalette (3.0 and later) 0x0035 rectangle 0x041b
resizepalette (3.0 and later) 0x0139
restoredc 0x0127
roundrect 0x061c
savedc 0x001e
scaleviewportext 0x0412
scalewindowext 0x0400
setbkcolor 0x0201
setbkmode 0x0102
setmapmode 0x0103
setmapperflags 0x0231
setpixel 0x041f
setpolyfillmode 0x0106
setrop2 0x0104 setstretchbltmode 0x0107
settextalign 0x012e
settextcharacterextra 0x0108
settextcolor 0x0209
settextjustification 0x020a
setviewportext 0x020e
setviewportorg 0x020d
setwindowext 0x020c
setwindoworg 0x020b placeable windows metafilesa placeable windows metafile is a standard windows metafile that has an additional 22-byte header. the header contains information about the aspect ratio and original size of the metafile, permitting applications to display the metafile in its intended form.
the header for a placeable windows metafile has the following form: