1,105,633 Community Members

Creating a Transparent Bitmap?

Member Avatar
DelphiGuy
Light Poster
41 posts since Mar 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hello, basically I want to have two TImage components, one I will use and using the Bitmap tools in Delphi I will create a background. In the second TImage I will create objects which move around the custom background but I still want the first TImage to be visible.

The problem I have is when I create the second TImage ontop of the first one the Canvas creates a huge white square over the background image making it impossible to see, how can I make the second TImage transparent so that the background is always visible and does not change regardless of the movements in the second one.

Member Avatar
pritaeas
mod_pritaeas
11,315 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 155 [?]
Moderator
Featured
Sponsor
 
0
 
Member Avatar
DelphiGuy
Light Poster
41 posts since Mar 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks! I've seen AlphaBlend before and never managed to get it to work. This procedure sure looks like it will though, you are great at finding these :D.

Just a question though, I have no idea how to call it, I.e. how can I use this procedure to turn a TImage into (for example Image1) Bitmap and then make it transparent and then draw over it using canvas tools such as MoveTo and LineTo

Member Avatar
pritaeas
mod_pritaeas
11,315 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 155 [?]
Moderator
Featured
Sponsor
 
1
 

Graphics is not my strong suit, I usually have someone doing that for me ;)

What I would probably do is put the background Image on a form, put a graphic control over it to draw on (if that is what you mean).

Question Answered as of 2 Years Ago by pritaeas
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article