Creating Metafiles to Use with OLE ApplicationsLast reviewed: February 17, 1995Article ID: Q83023 |
The information in this article applies to:
SUMMARYA metafile is one of the presentation formats that can be used by an OLE server application. A server application must prepare data in the presentation format under two circumstances:
MORE INFORMATION
METAFILEPICT StructureWhen an application creates a metafile to use with the OLE libraries or with the clipboard, all interactions occur through the METAFILEPICT data structure, which is defined as follows: typedef struct tagMETAFILEPICT { int mm; // Mapping mode int xExt, yExt; // Horizontal and vertical size HANDLE hMF; // Handle to the metafile} METAFILEPICT; The mapping mode for the metafile must be MM_ANISOTROPIC, which ensures that the object will scale properly when the client application displays it. However, the OLE libraries store a size for the object that is specified in MM_HIMETRIC units [0.01 millimeter (mm)]. The maximum size of an object is 327.67 mm by 327.67 mm. The application obtains the handle to the metafile by calling the CreateMetaFile function with NULL as the lpFilename parameter. Doing so creates a memory-based metafile.
FontsA server application should use a TrueType font whenever possible in a metafile. This is important because the user can scale the object to many different sizes in the client application and TrueType fonts scale well under a variety of conditions. To specify a TrueType font, set bit 2 (04h) of the lfPitchAndFamily member in the LOGFONT data structure.
Creating the MetafileThe following eleven steps present the procedure to create a metafile compatible with the OLE libraries:
|
Additional reference words: 1.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |