Solved

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

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

0
Comment
Question by:altariamx2003
  • 5
  • 3
  • 2
  • +2
12 Comments
 
LVL 47

Expert Comment

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

Wayne
0
 
LVL 74

Expert Comment

by:käµfm³d 👽
Comment Utility
I agree.
Untitled.png
0
 

Author Comment

by:altariamx2003
Comment Utility
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
 

Author Comment

by:altariamx2003
Comment Utility
0
 
LVL 74

Expert Comment

by:käµfm³d 👽
Comment Utility
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
 

Author Comment

by:altariamx2003
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
Comment Utility
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
 

Author Comment

by:altariamx2003
Comment Utility
aaahhh

ok let me try that
0
 

Author Comment

by:altariamx2003
Comment Utility
0
 
LVL 47

Expert Comment

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

Accepted Solution

by:
Erick37 earned 250 total points
Comment Utility
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
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 250 total points
Comment Utility
See if Idle_Mind's answer to this question helps you

http://www.experts-exchange.com/Programming/Misc/Q_25139417.html
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now