Is there anyway for me to cut out an object instead of having it in a box? I have a picture of a person with his had raised and then a second picture of a sword. When i press a button I can get the sword to appear in his hand, but the white background of the swords picture box, cuts off the hand of the person. Is there anyway to cut out the sword or let the background show through the swords background?
Thanks
Sorry, I deleted my post, I thought this thread was in the VB6 forum
So, here things are even easier, no need for bitblt, just use 2 bitmaps and set white as the transparent color for one of them (the object bitmap in this case, not the one with the person).
VB Code:
Private Sub GenerateImage()
Dim g As Graphics
Dim b1 As Bitmap
Dim b2 As Bitmap
b1 = New Bitmap("C:\bmpPerson.bmp")
b2 = New Bitmap("C:\bmpObject.bmp") 'White background
Correct me if I'm wrong, but with this method, wouldn't any white color be set to transparent, even if it's not in the background???
Yes, that's why masks are not usually created with common colors, magenta is one of the most used.
I attached an example of the code in my previous post.
Im using VB.NET 2003. The line b2.MakeTransparent(Color.White) comes up as an error. I see the pictures that you sent with you attachment, the tiger and the cross, but i can't get them to work.
lol yeah thanks a lot anyway.
Im just starting with vb.net (obvoiusly) and so I'm probably just taking your attachment and doing it wrong.
anyway thanks
I have finally been able to make the white in hte pictures disappear, but then it becomes the beigy color of the form itself. So really its the same problem over again. Before the white from the picture in front blocked some of the picture in back, but now I have the white gone, but now the beige from the picture in front, blocks some of the picture in back. It's really the same problem, yes I got ride of the white, but it didn't solve anything.