|
au3怎么访问这样格式的文件,如附件的文件,它是很多图标集成的文件,格式说明如下:
怎么读出它后,用函数GUICtrlSetImage()生成它?
附件文件(Tool.br2)格式:
---------------------------------------------------------------------------------------------------------------------------------------------------
The format is as follows:
- 4 byte checksum (to check whether it's still in sync with .bar file)
- 4 byte size of next block - if 0, it's an empty icon. Each icon starts with this size field
- 1 byte: if 0, there follows a monochrome+color bitmap, otherwise just one monochrome for black+white icons (double hight)
- sizeof(BITMAPINFOHEADER): BITMAPINFOHEADER structure for the black+white mask, +2 bytes palette
- the actual image data of the mask
- the mask data. bwimagesize:=((headermask.bmWidth+31) and not 31) div 8*headermask.bmheight;
- if not monochrome:
- sizeof(BITMAPINFOHEADER): BITMAPINFOHEADER structure for color image
- the palette (if required according to the header) and bitmap bits follow.
If biBitCount=32, TC uses CreateDIBSection followed by a byte copy to the buffer returned by CreateDIBSection to create the bitmap.
If biBitCount=1, TC uses CreateBitmap followed by SetDIBits.
Otherwise, TC uses CreateCompatibleBitmap followed again by SetDIBits to create the bitmap.
Finally, use CreateIconIndirect to create the icon, and DeleteObject to delete color and mask bitmaps.
Here is the calculation of the palette size and image data size:
ClrBits:=pbih.biPlanes * pbih.biBitCount;
if ClrBits=1 then ClrBits:=1
else if ClrBits<=4 then ClrBits:=4
else if ClrBits<=8 then ClrBits:=8
else if ClrBits<=16 then ClrBits:=16
else if ClrBits<=24 then ClrBits:=24
else ClrBits:=32;
if ClrBits<=8 then palettesize:=1 shl ClrBits
else palettesize:=0;
trueimagesize:=((pbih.biWidth * ClrBits +31) and not 31) div 8*pbih.biHeight;
-------------------------------------------------------------------------------------------------------- |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|