Is there a control image like picture box to handle transparent images?????

Is there a control image in visual basic.net like picture box to handle transparent images?????

altariamx2003Asked:
Who is Participating?
 
Erick37Connect With a Mentor Commented:
You can draw the images with transparency to a new image, then set the image to the PictureBox.
The PNG from file will retain its transparent color using DrawImage().  The bitmap can use a transparent color if you specify the color using MakeTransparent().
Dim FinalImage As Bitmap
		FinalImage = New Bitmap(PictureBox1.ClientSize.Width, PictureBox1.ClientSize.Height)

		Dim g As Graphics = Graphics.FromImage(FinalImage)

		'Load a PNG from file
		Dim image1 As Image = Image.FromFile("c:\rgb8_t_bk.png")
		'Load a resource BMP
		Dim image2 As Bitmap = System.Drawing.Image.FromHbitmap(My.Resources.ABitmap.GetHbitmap())
		image2.MakeTransparent(Color.Magenta)

		g.DrawImage(image1, 0, 0)
		g.DrawImage(image2, 10, 10)

		PictureBox1.Image = FinalImage

		g.Dispose()

Open in new window

0
 
Wayne Taylor (webtubbs)Commented:
The PictureBox control can handle transparent images. Are you having problems with something inparticular?

Wayne
0
 
käµfm³d 👽Commented:
I agree.
Untitled.png
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
altariamx2003Author Commented:
Im using two pictureboxes

the image on the picture box has a transparent background, but when I move the control over the other picturebox I cannot see the both images at the same time.

I change the property "backcolor" in  both picturebox but I still cannot see both images one over the other
0
 
altariamx2003Author Commented:
0
 
käµfm³d 👽Commented:
Rather than use two ImageBox controls, have you considered setting one image to the Image property and the other to the BackgroundImage property of one PictureBox?
0
 
altariamx2003Author Commented:
http://www.grupossc.com/example2.jpg

the bottom picturebox has the backgorundimage property configured and the top picturebox has just the backcolor property to transparent
0
 
Wayne Taylor (webtubbs)Commented:
That's not what was suggested by kaufmed. What he suggested was to use one picture box, and set both it's Image and BackgroundImage properties to the relevant images.
0
 
altariamx2003Author Commented:
aaahhh

ok let me try that
0
 
altariamx2003Author Commented:
0
 
Wayne Taylor (webtubbs)Commented:
Can you post the actual images you are using so I can check myself?
0
 
CodeCruiserConnect With a Mentor Commented:
See if Idle_Mind's answer to this question helps you

http://www.experts-exchange.com/Programming/Misc/Q_25139417.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.