I found a previous topic about this problem but no answer…It had been closed more than 120 days ago, so I make a new topic.
I’m testing the Charlie’s script for coloring and tagging an icon for my items (Songs, Jingles…)
I’ve choosen PNG files for my icons. When I use the item’s properties window, and “select” the PNG icon manually, the icon is correctly displayed in the playlist with its transparency. Great!
However, when I load with the Charlie’s script, the PNG files is linked to the item, but with black background instead of transparency…
Where I’m wrong ? Do I have to put the PNG icon one-to-one, using the properties windows (which would be very very boring…) ?
Is it a problem with the script ? with the icon ?
I had some problems with PNG transparency, so I found some (better) ICO files instead I get mine from iconarchive.com - they are all available in various pixel sizes in PNG format, plus a large ICO file. Cad did suggest an image program to set the PNG transparency but I couldn’t get it to work for me, but he appears to be the expert on that sort of thing.
My png files use transparency with grey shadow… it’s, according to photoshop, a PNG24 format. Hence, this format is not correctly supported by mairlist for transparency. The picture displays but all the background is painted.
So, either I export with color background included (what I’ve done to keep the shadow), either I convert it to PNG8 (without shadow to seem natural, or with shadow but a shadow not transparent).
I chose the first one for keeping the shadow transparency… Thanks for your help.
Just a message in order to say it’s not so easy to customize the playlist item…
So many keywords… it’s really hard to obtain the required result.
For example, the FadingRowColor doesn’t work…
The font for the name and the state of the player (in the playlist column) is big, but I don’t find the keyword for them…
I don’t find the keyword for uping the item’s line height…
Quite difficult… And each time I make a modification in the ini file, I must restart mairlist to see the result. Quite long for each modification…
Pretty easy… I will see :-/
It’s hard to find keywords I need…
I found the difference between adding a picture from “properties” windows, and adding a picture with the Charlie’s script. Storage is quite different.
The script line useful for being able to see the good PNG transparency is
First of all, thanks for your extensive investigations. I finally found the bug, which will be fixed in v2.2.1.
Here’s a little background:
mAirList uses a powerful graphics library (GraphicEx) which can handle dozens of file types, e.g. BMP, JPG, GIF, etc. Unfortunately, that library has very poor PNG support. It can only display certain sub-types, and transparency as hardly handled correctly at all. This is why I included an additional library - pngdelphi - only for PNG files. When loading an icon, a flag is set to determine whether the special PNG library or the default library should be used for this image. In the current version, when using LoadFromFile, the flag is not set correctly. This is the bug I just fixed.
Also note the difference between SetFilename and LoadFromFile mentioned by Theo above: When using SetFilename (or clicking “Select Icon” in the Properties dialog), only the name of the icon file is stored in the MMD file/tag/etc. When using LoadFromFile (or holding Shift while clicking “Select”), the file data is stored in the MMD.
I would add that the advantage of using the SetFilename function, instead of using the LoadFromFile is that :
if you tagg all the song items with the same icon (logical process), and you decide finally to change the picture because you found a more beautiful icon, you just have to replace the file, giving it the same filename as the origin file.
All the song item will link directly to the new image, without having to launch a script for re-tagging all the items…It’s a very fast process : one picture for all the song item. Replacing the file with the same filename will impact all the song items.
Great function !
Thanks Torben for your explanation about the flag. It’s clear now. I will try your snapshot tonight after work
Theo,
Well done for this - I’ve just used the 1st line to change some icons and it works much better! The problem I had was that icons on certain files were not being changed
The old line of code wouldn’t remove this part of the code, so I had to click “icon reset” then run the code again
Old Line: CurrentPlaylist.GetItem(i).GetPicture.LoadFromFile(‘C:\mAirList\icons\Icon - Song.ico’);
New Line: CurrentPlaylist.GetItem(i).GetPicture.SetFilename(‘C:\mAirList\icons\Icon - Song.ico’);
Looking at it like this, I can see why I had problems now but I did think it may have started when, as I recall, Torben did change the icon format/routines and perhaps the changes made on that snapshot would not be future-compatible ? Anyway, it’s sorted now.
Perhaps it’s possible to “reset” picture for all items with a mairlist script ?
I don’t know all the available functions… Maybe there is a line code like “GetItem(i).ResetPicture()” possible ?
The other advantage of linking the PNG file path instead of selecting it from the “properties” windows is that only one instance of the picture is stored. And not stored in each MMD song’s item file !!!
Hence, you will have more memory-saving MMD files because they don’t store the picture into them : only a reference. Great for saving memory of your hard disks…isn’t it ?
I was also concerned that the MMD files were getting bloated with data when saving playlist icons/png files. A (local or network) reference to an icon folder is much more efficient and as Theo says, easy to change your icons should you find better ones in the future.
Oh ! I thought that the storage in the XML file was different (not the same tagname indeed)…
But if it’s the same tag, yep, clearing the picture before calling SetFilename is useless.