[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


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

Posted on 2010-11-26
Medium Priority
Last Modified: 2012-06-27
Is there a control image in visual basic.net like picture box to handle transparent images?????

Question by:altariamx2003
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
  • 5
  • 3
  • 2
  • +2
LVL 48

Expert Comment

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

LVL 75

Expert Comment

by:käµfm³d 👽
ID: 34220686
I agree.

Author Comment

ID: 34220691
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 34220700
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 34220704
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?

Author Comment

ID: 34220717

the bottom picturebox has the backgorundimage property configured and the top picturebox has just the backcolor property to transparent
LVL 48

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 34220790
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.

Author Comment

ID: 34220792

ok let me try that
LVL 48

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 34220809
Can you post the actual images you are using so I can check myself?
LVL 32

Accepted Solution

Erick37 earned 1000 total points
ID: 34222051
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())

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

		PictureBox1.Image = FinalImage


Open in new window

LVL 83

Assisted Solution

CodeCruiser earned 1000 total points
ID: 34222906
See if Idle_Mind's answer to this question helps you


Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

649 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