Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make .gif backgound transparent???

Status
Not open for further replies.

tom1597530

Programmer
Oct 13, 2009
11
SK
Hello. I have posted one thread yet, but I am making a game and I needed it for Save/Load function.
I have 2 pictures, one has black background with green ball and the other has white background with blue ball. Again, I need a code from you. SO, when the form starts, it will automaticaly make everything, that is black in PictureBox1 transparent and evetything, that is white in PictureBox2 to make it transparent. I will be very glad and thankful :)
 
It don't have to be .gif. It can be all image files, that are supported by VB6 PRO.
 
If I get you right, you want to make these pictures transparent *on the fly* and then only *temporarily*?
i.e. You want a transparency you can turn on/off?

Wrong way to attack this methinks. Why not simply have two pictures for each picture box and exchange these by toggling the visibility of each pic...
;-)

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Excellent. Since .gif isn't a directly supported format ...

Next challenge - pictureboxes are not transparent, and sticking a transparent image into one will not make it transparent ...

So, before making any recommendations are providing code, what exactly are you trying to achieve?
 
I want to cover one picture with another but I don't want the white bckgrnd. e.g. I have a picture of a woman and a picture of a café bar. I want that woman to stand right next to the table, but the picture has a white background and i want to remove it.
 
Maybe I explained it bad:
I have an Image1 - café bar and Image2 a woman and there's a white background around her. I want to position that woman next to the bar without the white background. It can be all kinds of formats that VB6 supports. This is what I want. Please, can you write me the code? Thx.
 


Please, can you write me the code?

If you need someone to write you code, then go find a programmer and pay them.

This is Tek-Tips and you WILL get lots of help, but NO ONE is going to write you the code on command!

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 


You may have already shot yourself in the foot!

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Yes, but then I went to hospital and I am okay now, so can you please tell me, how can I do that? pLEASE
 
Well, we can do this with almost no code at all ...

And given that you've identified that you want 'transparency' and 'image' controls, a quick keyword search of this very forum should find 8 hits, one of which is my example in thread222-1271591 ... It's the ImageList example you want. Note that this illustrates a potential solution, but does not provide the exact code that you want. You'll need to try and think for yourself how to best apply the technique for your situation
 
Some controls have invisible sections, some dont and some stay over the top of others and some dont!

There were a number of posts relating to that some time ago.
Easiest way it to make the top image fill a separate small form and make unwanted parts of that form invisible (many posts on this)
than make the form go over the top of the other form (many posts on this)
You can superimpose over anything including movies that way
 
>Easiest way it to make the top image

I'm not sure that's the easiest solution in this case, Ted. Whilst I, along with others, have illustated the form technique on more than one occassion I don't think it is warranted here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top