Drive icons rendering

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
VSB
Member
Member
Posts: 136
Joined: 2006-12-12, 12:02 UTC
Location: Russia

Drive icons rendering

Post by *VSB »

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
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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.
Author of Total Commander
https://www.ghisler.com
VSB
Member
Member
Posts: 136
Joined: 2006-12-12, 12:02 UTC
Location: Russia

Post by *VSB »

May be add support for ICL? Isn't it more simple after you add ability to get drive icons from explorer? And using icons makes ability to load different sizes like in button bar.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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.
Author of Total Commander
https://www.ghisler.com
VSB
Member
Member
Posts: 136
Joined: 2006-12-12, 12:02 UTC
Location: Russia

Post by *VSB »

Yes, all is fine now.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Great, thanks for the quick feedback!
Author of Total Commander
https://www.ghisler.com
VSB
Member
Member
Posts: 136
Joined: 2006-12-12, 12:02 UTC
Location: Russia

Post by *VSB »

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?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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.
Author of Total Commander
https://www.ghisler.com
Post Reply