RAD Studio 10.4.1 is now available! Learn more. Looking for discounts? Visit our Special Offers page!
Delphi

Setting a transparent background color for TImageList

Author: Embarcadero USA

 Question and Answer Database

FAQ2346D.txt   Setting a transaprent background color for TImageList
Category   :Miscellaneous
Platform    :All
Product    :Delphi 3.x  

Question:
How do I set the transparent color in an TImageList so the 
background color doesn't show?

Answer:
Use the TImageList.AddMasked(Bitmap: TBitmap; MaskColor: TColor)
method. You can either pass the transparent color yourself in 
the second parameter or clDefault to let the imagelist take the 
bottom-left pixel's color.  TSpeedButton and TBitBtn use this 
method.  Check-out buttons.pas (around line 560) to see an 
example.

7/16/98 4:31:28 PM
 

Article originally contributed by


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

Related posts
C++

What's New in the GetIt Package Manager - June 2020

C++

RAD Studio 10.4 Now Available, Learn More

C++NewsRAD Studio

Open for Business with 10.4! - May 2020 GM Update

C++DelphiNews

Embarcadero Open Source Project Sponsorship

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES