在WMF SDK 11中,WM/Picture 标签属性同样属于 WMT_TYPE_BINARY
typedef struct _WMPicture LPWSTR pwszMIMEType; BYTE bPictureType; LPWSTR pwszDescription; DWORD dwDataLen; BYTE* pbData; } WM_PICTURE; 其中: pwszMIMEType(图片 MIME 类型): 宽字符, null 结尾。返回的和写入图片类型有关,例如Jpeg 返回时 image/jpeg bPictureType(封面图片代表的类型): 0..20 之间的整数,具体 ID 代表是
Value | Description |
0 | Picture of a type not specifically listed in this table |
1 | 32 pixel by 32 pixel file icon. Use only with portable network graphics (PNG) format |
2 | File icon not conforming to type 1 above |
3 | Front album cover |
4 | Back album cover |
5 | Leaflet page |
6 | Media. Typically this type of image is of the label side of a CD |
7 | Picture of the lead artist, lead performer, or soloist |
8 | Picture of one of the artists or performers |
9 | Picture of the conductor |
10 | Picture of the band or orchestra |
11 | Picture of the composer |
12 | Picture of the lyricist or writer |
13 | Picture of the recording studio or location |
14 | Picture taken during a recording session |
15 | Picture taken during a performance |
16 | Screen capture from a movie or video |
17 | A bright colored fish |
18 | Illustration |
19 | Logo of the band or artist |
20 | Logo of the publisher or studio |
![http://hi.csdn.net/attachment/201001/22/1188217_1264128115jYOI.jpg](http://hi.csdn.net/attachment/201001/22/1188217_1264128115jYOI.jpg)
Len_pwszDescription := Len_pwszDescription - Len_pwszMIMEType; 现在得到 pwszDescription 的长度,就可以读取 pwszDescription 的内容了。 那么,image/jpeg 或者 iamge/bmp 或者 image/png 这样的长度呢? Len_pwszMIMEType := Len_pwszMIMEType - Len_Base; 这样就得到 pwszMIMEType 是 20 字节还是 22 字节还是别的多少字节了。 最后就是读取图片数据了: dwDataLen 代表图片数据的长度,直接按照长度copy出来就是了。
至此,打完收工。研究结果就是这个:
![]()