【WMA 文件的研究结果二】WM/Picture 标签属性(专辑封面)

在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 代表是

 
 
ValueDescription
0Picture of a type not specifically listed in this table
132 pixel by 32 pixel file icon. Use only with portable network graphics (PNG) format
2File icon not conforming to type 1 above
3Front album cover
4Back album cover
5Leaflet page
6Media. Typically this type of image is of the label side of a CD
7Picture of the lead artist, lead performer, or soloist
8Picture of one of the artists or performers
9Picture of the conductor
10Picture of the band or orchestra
11Picture of the composer
12Picture of the lyricist or writer
13Picture of the recording studio or location
14Picture taken during a recording session
15Picture taken during a performance
16Screen capture from a movie or video
17A bright colored fish
18Illustration
19Logo of the band or artist
20Logo of the publisher or studio
pwszDescription(说明): 宽字符,null 结尾。 dwDataLen(图片数据的长度)。 pbData(图片数据): 指针,指向 Byte 数组( Pointer to a BYTE array containing the picture data 上图片说明: http://hi.csdn.net/attachment/201001/22/1188217_1264128115jYOI.jpg 首先应该读取:Len_Base 然后再读取:Len_pwszMIMEType 其次读取:Len_pwszDescription 计算(转为十进制计算):
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出来就是了。
至此,打完收工。

研究结果就是这个:
http://hi.csdn.net/attachment/201001/22/1188217_1264128117pmfj.jpg











  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值