473,396 Members | 1,836 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to transparent a picturebox control in C# and show everything behind of it

mahboobeh
hi
i have tow picturebox and i want to show the first with a low transparency on top of the another one. its mean i want to transparent above picturebox and show every thing that behind of it like the other picturebox .how can i do this?
Oct 25 '10 #1
5 6089
GaryTexmo
1,501 Expert 1GB
I did some digging around and my suspicions are confirmed, you can't really do this with a PictureBox.

That said, it's pretty easy to just use a panel, set the background to transparent, then use GDI+ to draw your image yourself by overriding the OnPaint method.

Look into this and let me know it works out, or if you need some help.
Oct 25 '10 #2
hi graytexmo
tnx for you reply.
ill put a sample here,i tried alphablend(an api) and a glassy control in this sample.
it work with glassy control but it have very low speed in compile for big pictures,
i tried yor suggestion but its great if you can give me a sample.
i hope you got what i want.
Regards.
Oct 26 '10 #3
GaryTexmo
1,501 Expert 1GB
I think I might be unclear on what you're looking for.

Do you want:

A) Transparency, the portion of of the control that is not taken up by the picture is completely see-through, such that you can see anything behind it.

B) Opacity, the entire control, image included, is rendered such that you can see through the image to what is behind, but the image on top is still viewable.

Your page title threw me off, I thought you meant transparency but on rereading everything in light of your latest post I'm thinking you actually meant opacity. Two different things, sorry for misunderstanding you.

I know you can control the opacity of the form itself, but I'm not sure about individual control. An alpha blend for a large picture can indeed be a fairly expensive operation if you do it every render cycle, but you might be able to do the blend on the image, render the result, and only update on a change.

Also, are you needing the control itself to be semi-opaque, or are you just wanting to lay two pictures over top of each other?
Oct 26 '10 #4
GaryTexmo
1,501 Expert 1GB
Have you tried this?
http://www.codeproject.com/KB/cpp/Al...ientPanel.aspx
Oct 26 '10 #5
tnx GaryTexmo
i used wpf usercontorl.and it worked for me.
i wnat something like image in wpf.it has an opacity in its propertis.
Oct 30 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Jose Michael Meo R. Barrido | last post by:
Hi! Can u please tech me a way to know if the image in the picturebox has changed? what event should i catch the chage?
1
by: Richard Saville | last post by:
I am trying to make a transparent pictureBox. MSDN says to use this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); for the form and this.pictureBox1.BackColor = Color.Transparent; for...
5
by: Sharon | last post by:
I’m writing a Windows application. In the form I have a Panel and inside the panel I have a PictureBox control. I’m loading the PictureBox control with BMP image that has the following...
1
by: Imran Aziz | last post by:
Hello All, I have a navigation system for the site , in which the links are highlighted based on which section the site is in. Now the issue is that I do that using a class="thissection"...
2
by: David Ricker | last post by:
I have created a PictureBox control which can have it's Image property directly bound to an image field in a database. This works perfectly for showing the images that are in the database. When I...
3
by: Tyson Ackland | last post by:
Can someone tell me how you go about handling events where your window might be obscured and then when you bring it to the foreground, you want your picturebox control to be repainted instead of...
5
by: BrianW | last post by:
I am working on a program that has multiple picturebox controls that a user is allowed to move around which are contained within a panel control for visual placement. In my mousedown event, I set...
3
by: ktcute | last post by:
I'm trying to write a simple drawing tool that saves images out as jpgs. I've been using the paint event on the Panel control to draw the objects, however I couldn't get the same drawing...
3
by: prynhart | last post by:
I have a PictureBox Control which is 96*96 pixels. I want to display nine 32*32 pixel bitmaps in this control arranged in a 3X3 square. How can I do this ? All the examples I've seen load only one...
2
by: \(O\)enone | last post by:
I'm trying to create a usercontrol that is transparent, both visibly and to mouse clicks. I can make the usercontrol visibly transparent by setting the SupportsTransparentBackColor style and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.