找回密码
 加入
搜索
查看: 2150|回复: 4

[AU3基础] 怎么访问这样格式的二进制的图标文件?

[复制链接]
发表于 2011-4-9 08:27:07 | 显示全部楼层 |阅读模式
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;
--------------------------------------------------------------------------------------------------------

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2011-4-9 08:29:57 | 显示全部楼层
或者au3怎么生成这样的二进制图标文件集?一个个读不同程序(文件)的图标太慢了,先生成一个二进制的,速度会大大提高!
发表于 2011-4-9 09:06:00 | 显示全部楼层
去看看_winapi_createiconfromH什么玩意
发表于 2011-4-9 12:54:11 | 显示全部楼层
不会 帮顶  共同学习
发表于 2011-4-9 14:28:48 | 显示全部楼层
不太明白,顶一下,试验一下
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-21 11:00 , Processed in 0.084983 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表