Solved

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

Posted on 2010-11-26
12
643 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)
ID: 34220673
The PictureBox control can handle transparent images. Are you having problems with something inparticular?

Wayne
0
 
LVL 75

Expert Comment

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

Author Comment

by:altariamx2003
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
0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

Author Comment

by:altariamx2003
ID: 34220700
0
 
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?
0
 

Author Comment

by:altariamx2003
ID: 34220717
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
 
LVL 47

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.
0
 

Author Comment

by:altariamx2003
ID: 34220792
aaahhh

ok let me try that
0
 

Author Comment

by:altariamx2003
ID: 34220803
0
 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 34220809
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
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())
		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
ID: 34222906
See if Idle_Mind's answer to this question helps you

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

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 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