Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 这个EMF图像的A4大小是多少?_Image_Reverse Engineering_Gdi_File Format_.emf - Fatal编程技术网

Image 这个EMF图像的A4大小是多少?

Image 这个EMF图像的A4大小是多少?,image,reverse-engineering,gdi,file-format,.emf,Image,Reverse Engineering,Gdi,File Format,.emf,Adobe Illustrator制作的EMF文件(我不知道是哪个版本,但它有一个早期样式的EMR头)应该是A4大小的,我不明白它是怎么回事。该文件包含以下EMR记录: U_EMRHEADER record: 0 type: 1 offset: 0 size: 116 rclBounds: {255,-925,1377,-132} rclFrame: {7969,-28906,43031,-412

Adobe Illustrator制作的EMF文件(我不知道是哪个版本,但它有一个早期样式的EMR头)应该是A4大小的,我不明白它是怎么回事。该文件包含以下EMR记录:

U_EMRHEADER                   record:    0 type:  1 offset:       0 size:     116
   rclBounds:      {255,-925,1377,-132} 
   rclFrame:       {7969,-28906,43031,-4125}  **350.63 x 247.82 mm**
   dSignature:     0x464D4520
   nVersion:       0x00010000
   nBytes:         1924
   nRecords:       54
   nHandles:       4
   sReserved:      0
   nDescription:   13
   offDescription: 88
      Desc. A:  Adobe Systems
      Desc. B:  
   nPalEntries:    0
   szlDevice:      {1024,768} 
   szlMillimeters: {320,240} 
U_EMRSETMAPMODE               record:    1 type: 17 offset:     116 size:      12
   iMode:          0x00000008       **MM_ANISOTROPIC**
U_EMRSETWINDOWORGEX           record:    3 type: 10 offset:     140 size:      16
   ptlOrigin:      {0,0}
U_EMRSETVIEWPORTORGEX         record:    4 type: 12 offset:     156 size:      16
   ptlOrigin:      {0,0}
U_EMRSETWINDOWEXTEX           record:    5 type:  9 offset:     172 size:      16
   szlExtent:      {10104,7143}
U_EMRSETVIEWPORTEXTEX         record:    6 type: 11 offset:     188 size:      16
   szlExtent:      {3368,2381}
rclFrame字段通常设置页面大小,但A4为297 x 210 mm,而不是350.63 x 247.82 mm。但是,350.63 x 247.82是A4的正确比率。我从这些数字中骗取A4大小的唯一方法是将rclFrame值视为MM_HIENGLISH,然后使用EMRSETWINDOWEXTEX/EMRSETVIEWPORTEXTEX中的1/3比例因子:

 35.063" * 1/3 = 11.69"
 24.782" * 1/3 = 8.26"
但这意味着程序在看到后两条记录之前无法确定页面的大小。我也找不到任何文件说明这种事情会发生


有人能解释一下吗?

我认为您的EMF可能包含比诊断转储指示的更多的信息。 提供的EMR_标头记录的转换设置为0x00010000,因此该记录通常包含从szlMillimeters开始的以下字段:

    public uint     cbPixelFormat;
    public uint     offPixelFormat;
    public uint     bOpenGL;
    public SIZE     szlMicrometers;
提供的诊断转储中缺少这些字段的值。下面是我在机器上的XP emf文件头的十六进制转储:

 0: 01 00 00 00 6c 00 00 00 58 07 00 00 03 02 00 00  | ....l...X....... |
10: aa 0b 00 00 1f 04 00 00 95 1f 00 00 07 09 00 00  | ................ |
20: 07 31 00 00 15 11 00 00 20 45 4d 46 00 00 01 00  | .1...... EMF.... |
30: 44 07 00 00 2e 00 00 00 03 00 00 00 00 00 00 00  | D............... |
40: 00 00 00 00 00 00 00 00 61 13 00 00 68 1b 00 00  | ........a...h... |
50: d2 00 00 00 29 01 00 00 00 00 00 00 00 00 00 00  | ....)........... |
60: 00 00 00 00 50 34 03 00 28 88 04 00              | ....P4..(...     |
在此代码段中,szlMicrometers字段是最后一对DWORD。它们的值为0x00033450、0x00048828,以十进制单位表示,单位为千分之一毫米。这些值为210000297000