Drive icons rendering
Moderators: Hacker, petermad, Stefan2, white
Drive icons rendering
Drive icons are rendered differently in 32 and 64 mode.
If bitmap is down-top order, 64bit treats first pixel as transparent and do not paint other pixel of that color, ignoring alpha channel, see https://yadi.sk/i/IOD2k0t73Ps2Bt
If bitmap is top-down order, 32bit fails to load it.
Afterall, why use DLL with bitmaps instead normal ICL?
Tested on *NET* and FTP icons
https://yadi.sk/d/JjMLx3iY3Ps3NF
If bitmap is down-top order, 64bit treats first pixel as transparent and do not paint other pixel of that color, ignoring alpha channel, see https://yadi.sk/i/IOD2k0t73Ps2Bt
If bitmap is top-down order, 32bit fails to load it.
Afterall, why use DLL with bitmaps instead normal ICL?
Tested on *NET* and FTP icons
https://yadi.sk/d/JjMLx3iY3Ps3NF
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
This only seems to affect the drive button bar, not the drive dropdown combobox. Unfortunately I couldn't find the reason and/or a workaround so far. The bitmap handling in Lazarus is very complex, >15 function levels deep. I will therefore have to postpone this to a later TC version, sorry. Just make the pixel at (0,0) transparent.
32bit uses Delphi 2, and it doesn't seem to support top-down bitmaps.
32bit uses Delphi 2, and it doesn't seem to support top-down bitmaps.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Actually I found a solution now! I have sent you a test version to your forum e-mail, please try it.
ICL doesn't work because the "speed buttons" used by Delphi expect bitmaps which they add to an image list.
ICL doesn't work because the "speed buttons" used by Delphi expect bitmaps which they add to an image list.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
1. If no secret, what is the solution? Which BMP format should be used?
2. As there are TSpeedButton, so you get HICON from Explorer, than convert them to HBITMAP (or TBitmap) to use as Glyph?
3. Side question. Early versions of drivelibs have HOTLIST1 and HYSTORYLIST1 resources, but they were never loaded. Current version of TC has three versions of each bitmap foк drives and other places. What are their purpose? Which of them can be loaded from ext DLL?
2. As there are TSpeedButton, so you get HICON from Explorer, than convert them to HBITMAP (or TBitmap) to use as Glyph?
3. Side question. Early versions of drivelibs have HOTLIST1 and HYSTORYLIST1 resources, but they were never loaded. Current version of TC has three versions of each bitmap foк drives and other places. What are their purpose? Which of them can be loaded from ext DLL?
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
1. Either use 32bit bitmap (bottom up is the standard) with alpha channel, or use 24bit or lower where the first pixel is the background color.
2. I modified the speed button to work also with system image list, where the Explorer icons are located. It's not possible to add icons from dll to system image list. I would have to modify the speed button again to support multiple custom image lists because it's not guaranteed that the icons are all the same size.
3. Edit: I have checked that now: Only the ones you have in the dll are used by TC. The history/hotlist icons cannot be replaced. However, you can append an 'a' to each name for larger 32x32 icons used by TC on high DPI screens, e.g. diskhdd -> diskhdda.
2. I modified the speed button to work also with system image list, where the Explorer icons are located. It's not possible to add icons from dll to system image list. I would have to modify the speed button again to support multiple custom image lists because it's not guaranteed that the icons are all the same size.
3. Edit: I have checked that now: Only the ones you have in the dll are used by TC. The history/hotlist icons cannot be replaced. However, you can append an 'a' to each name for larger 32x32 icons used by TC on high DPI screens, e.g. diskhdd -> diskhdda.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com