This forum uses cookies. Click X button to hide this message. What is stored? 
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Drive icons rendering

 
Post new topic   Reply to topic    Total Commander Forum Index -> TC Fixed bugs Printable version
View previous topic :: View next topic  
Author Message
VSB
Member
Member


Joined: 12 Dec 2006
Posts: 119
Location: Russia

PostPosted: Mon Nov 20, 2017 8:36 am    Post subject: Drive icons rendering Reply with quote

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
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 34910
Location: Switzerland

PostPosted: Tue Nov 21, 2017 10:58 am    Post subject: Reply with quote

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
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
VSB
Member
Member


Joined: 12 Dec 2006
Posts: 119
Location: Russia

PostPosted: Tue Nov 21, 2017 3:09 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 34910
Location: Switzerland

PostPosted: Tue Nov 21, 2017 3:42 pm    Post subject: Reply with quote

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
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
VSB
Member
Member


Joined: 12 Dec 2006
Posts: 119
Location: Russia

PostPosted: Wed Nov 22, 2017 2:08 am    Post subject: Reply with quote

Yes, all is fine now.
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 34910
Location: Switzerland

PostPosted: Wed Nov 22, 2017 2:37 am    Post subject: Reply with quote

Great, thanks for the quick feedback!
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
VSB
Member
Member


Joined: 12 Dec 2006
Posts: 119
Location: Russia

PostPosted: Wed Nov 22, 2017 3:04 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 34910
Location: Switzerland

PostPosted: Wed Nov 22, 2017 3:24 am    Post subject: Reply with quote

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
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC Fixed bugs All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group