Это стоит каждому прочесть хоть раз

Jul 05, 2005 14:37


Из статьи MSDN про LoadBitmap():

Windows 95: Windows 95 cannot handle executable files that contain resources whose size is 64K or larger. To retain compatibility with 16-bit Windows, it converts the 32-bit size into a 16-bit size and a shift count. When it does this conversion it rounds down instead of up, so some bytes can be lost. The shift required for a large resource can cause a small resource to be severely truncated, or even eliminated completely. To avoid this problem, compute the scaling factor for the largest resource and pad all resources with zeroes so each is a multiple of the scaling factor. For example, a resource of size 0x100065 is converted to 0x8003 * 32, which loses 5 bytes. To save the 5 bytes, you must pad the resource with 27 zeroes so that it becomes size 0x100080 and is then converted to 0x8004 * 32. Note, any smaller resource must also be padded with zeroes so it is a multiple of the scaling factor, which in this case is 32.

Без этой операционки жизнь была бы не так интересна. ;) Впрочем, хорошо, что она умерла.
Previous post Next post
Up