First off, i'm writing a launcher program. It's going to have a context menu with all the apps that the user added (and their respective icons).
Considering that someone might put in 40 apps, that might take a while to cache EVERY icon EVERY time the program starts.
My solution was to add all the icons to an Arraylist and SERIALIZE the arraylist into a .dat file (just plaintext).
Problem: The icon that i add to the arraylist is 256/true-color with alpha transparency. The icon that comes out when i deserialize it is invariably 16 colors with no transparency/regular transparency.
i did some tests, this has nothing to do with the limitations of the icon class. (i displayed the before/after icon for myself). Also, i tested and it has nothing to do with how i'm storing the ArrayList of icons in a .dat file.
does anyone know what is going on or another way i could cache the icons without putting them into separate files?
note: it also seems to have something to do with the way i'm extracting the icon from the exes (SHFileInfo method imported from shell32.dll). If i extract an icon (16x16 16.8 mill color) from an exe and save it on disk, put it in an array, serialize it, unserialize it, check it. it seems to preserve the colors and the transparency, but not the alpha.
Considering that someone might put in 40 apps, that might take a while to cache EVERY icon EVERY time the program starts.
My solution was to add all the icons to an Arraylist and SERIALIZE the arraylist into a .dat file (just plaintext).
Problem: The icon that i add to the arraylist is 256/true-color with alpha transparency. The icon that comes out when i deserialize it is invariably 16 colors with no transparency/regular transparency.
i did some tests, this has nothing to do with the limitations of the icon class. (i displayed the before/after icon for myself). Also, i tested and it has nothing to do with how i'm storing the ArrayList of icons in a .dat file.
does anyone know what is going on or another way i could cache the icons without putting them into separate files?
note: it also seems to have something to do with the way i'm extracting the icon from the exes (SHFileInfo method imported from shell32.dll). If i extract an icon (16x16 16.8 mill color) from an exe and save it on disk, put it in an array, serialize it, unserialize it, check it. it seems to preserve the colors and the transparency, but not the alpha.