关于EMF图片实际像素大小问题
获取到一张Emf图片,如何根据ENHMETAHEADER 记录中的信息计算出在当前设备上的实际大小呢??比如说是96DPI显示器上
[解决办法]
typedef struct tagENHMETAHEADER { DWORD iType; DWORD nSize; RECTL rclBounds; //Specifies the dimensions, in device units, of the smallest rectangle that can be drawn around the picture stored in the metafile. This rectangle is supplied by graphics device interface (GDI). Its dimensions include the right and bottom edges. RECTL rclFrame; DWORD dSignature; DWORD nVersion; DWORD nBytes; DWORD nRecords; WORD nHandles; WORD sReserved; DWORD nDescription; DWORD offDescription; DWORD nPalEntries; SIZEL szlDevice; //Specifies the resolution of the reference device, in pixels. SIZEL szlMillimeters; //Specifies the resolution of the reference device, in millimeters.#if (WINVER >= 0x0400) DWORD cbPixelFormat; DWORD offPixelFormat; DWORD bOpenGL;#endif /* WINVER >= 0x0400 */#if (WINVER >= 0x0500) SIZEL szlMicrometers;#endif /* WINVER >= 0x0500 */} ENHMETAHEADER, *PENHMETAHEADER;