Hello,
I created custom images for my teeTree which I put in a imageList. In the imageList, I've set a transparent color (clRed in my case). Unfortunately, the pixels which should be transparent are white.
My teeTree has a gradient background, and I think this can be the reason why it doesn't work.
I resume :
1. creation of images with clRed pixels for the transparent parts
2. adding the images in a imageList
3. Linking the imageList to the treeview
4. Set the imageList transparentColor to clRed (works fine in the list)
5. Set a gradient background to the TeeTree
6. In the program, the transparent pixels are white instead of being transparent.
Maybe you can confirm me it is a problem with TeeTree. And if it is the case, is there a way to solve this problem ?
[Solved] Transparent background for custom images
[Solved] Transparent background for custom images
Last edited by bertrod on Mon Aug 07, 2006 11:08 am, edited 1 time in total.
Hey tom,
I made some screenshots to explain my problem.
1. My images :
You see the clGreen color used to make the transparency
2. My images in the TImageList. I've set clGreen as transparentColor and you see the green doesn't appear, so I guess it should work :
3. The result in the TeeTree :
So the transparent color didn't work. There is a white square around the images.
What do you think about this problem ?
I made some screenshots to explain my problem.
1. My images :
You see the clGreen color used to make the transparency
2. My images in the TImageList. I've set clGreen as transparentColor and you see the green doesn't appear, so I guess it should work :
3. The result in the TeeTree :
So the transparent color didn't work. There is a white square around the images.
What do you think about this problem ?
Hi bertrod,
This is a bug in TImageList with 32bit images on XP.
You can try the following:
1) Try to set the TimageList BkColor property to something else than clNone. In a color which you probably won't have in the bitmap images.
2) Use non TImageList based component.
3) use the fix provided on the internet for a similar issue (not tested by us):
http://www.planet-source-code.com/vb/sc ... 0&lngWId=7
http://www.codeproject.com/cs/miscctrl/ ... gelist.asp
Regards,
Tom
This is a bug in TImageList with 32bit images on XP.
You can try the following:
1) Try to set the TimageList BkColor property to something else than clNone. In a color which you probably won't have in the bitmap images.
2) Use non TImageList based component.
3) use the fix provided on the internet for a similar issue (not tested by us):
http://www.planet-source-code.com/vb/sc ... 0&lngWId=7
http://www.codeproject.com/cs/miscctrl/ ... gelist.asp
Regards,
Tom
Hello Tom,
Thank you, I could make it work with the 1st solution. I put : and it works. But of course I guess it will not work if i set a gradient background. Fortunately I'm using a plain color for the moment.
Thank you, I could make it work with the 1st solution. I put :
Code: Select all
ImageList1.bkColor := treeview.color