Icons 图标学习笔记衿华版

Header

typedef struct
{
    WORD           idReserved;   // Reserved.Must always be 0.
    WORD           idType;       // Specifies image type: 1 for icon(.ico)image, 2 for cursor(.cur) image.Other values are invalid.
    WORD           idCount;      // Specifies number of images in the file.
    ICONDIRENTRY   idEntries[1]; // An entry for each image (idCount of 'em)
} ICONDIR, *LPICONDIR;
Structure of image directory

Image #1Entry for the first image
Image #2Entry for the second image
... 
Image #nEntry for the last image

typedef struct
{
    BYTE        bWidth;          // Specifies image width in pixels.Can be any number between 0 and 255.Value 0 means image width is 256 pixels(vista).
    BYTE        bHeight;         // Specifies image height in pixels.
    BYTE        bColorCount;     // Number of colors in image (0 if >=8bpp)
    BYTE        bReserved;       // Reserved ( must be 0)
    WORD        wPlanes;         // Color Planes.Should be 0 or 1.
    WORD        wBitCount;       // Bits per pixel
    DWORD       dwBytesInRes;    // Specifies the size of the image's data in bytes.
    DWORD       dwImageOffset;   // Specifies the offset of BMP or PNG data from the beginning of the ICO/CUR file.
} ICONDIRENTRY, *LPICONDIRENTRY;
Referenced image data
All image data referenced by entries in the image directory proceed directly after the image directory.It is customary practice to store them in the same order as defined in the image directory./*Store them order by define in ICONDIREENTRY*/

Recall that if an image is stored in BMP format, it must exclude the opening BITMAPFILEHEADER structure,whereas if it is stored in PNG format,it must be stored in its entirety./* BMP file must exclude BITMAPFILEHEADER, PNG file must clude entire*/

[notice]A PNG image can be stored in the image in the same way as done for a standard Windows BMP format image, with the exception that the PNG image must be stored in its entirety, with its file header.








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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

刘华世(Moments)

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值