transparent bitmap

Posted on 2004-09-24
Medium Priority
Last Modified: 2008-01-09
I have a graphic in an imagelist.  Anyone know how i can transfer it to a TBitmap WITHOUT loosing the transparent background that the imagelist gives me? (ie: i have the transparent color of the imagelist set to clFuchsia)


How can i make the bitmap transparent on the canvas with the transparent color being clFuchsia in the bitmap?
Question by:patera2
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 23

Accepted Solution

Ferruccio Accalai earned 1000 total points
ID: 12149751
You can use transparent and transparentMode properties of TBitmap

Transparent := True means of course that it will be Transparent

TransparentMode is how it will be transparent.
from Help:
When TransparentMode is set to tmAuto (the default), the TransparentColor property returns the color of the bottom-leftmost pixel of the bitmap image.  When TransparentMode is set to tmFixed, the TransparentColor property refers to the color stored in the bitmap object.

Look how is differently drawed your bitmap with this example

procedure TForm1.Button1Click(Sender: TObject);
  Bitmap : TBitMap;
  Bitmap := TBitmap.Create;
    with Bitmap do begin
      Transparent := True;
      TransParentColor := clblack;
      TransParentColor := clfuchsia;
      TransparentMode := tmAuto; //this automatically get as TransparentColor the the color of the bottom-leftmost pixel

F68 ;-)

Author Comment

ID: 12297018
sorry for the delay -  thanks for the help.
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 12297089
Glad to have helped you :)

F68 ;-)

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month13 days, 9 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question