473,385 Members | 1,356 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,385 software developers and data experts.

Make a transparent picturebox

I have a UserControl that contains two pictureboxes.
One on top of the other.
The top one is smaller then the bottom one.
The top one is to be transparent.
I want to draw on it and then sometimes clear it and sometimes copy the
drawing to the bottom picturebox image or BackgroundImage.

Just to see if it would work I set the Background color of the top one to
transparent but, rather then seeing the bottom box in the transparent one I
see the UserControl backcolor. Is this to be expected?

As I read in the Help I can create a Bitmap that is transparent. I guess I
could set the Image of the top box to nothing and the background image to
the bitmap.

Not sure if that will work but it seems a shame to create another (big)
bitmap.

Is that the way to go or is there a cleaner way?
Cal

Nov 20 '05 #1
1 2289
I found the answer on the internet. I wished I recorded the site so I could
give it credit here but it was a FAQ site that listed three ways to use
transparent pictureboxes.

The third way was to make the box that is to show through, the parent of the
transparent one.

Works great

Cal
" active" <ac****@REMOVEa-znet.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
I have a UserControl that contains two pictureboxes.
One on top of the other.
The top one is smaller then the bottom one.
The top one is to be transparent.
I want to draw on it and then sometimes clear it and sometimes copy the
drawing to the bottom picturebox image or BackgroundImage.

Just to see if it would work I set the Background color of the top one to
transparent but, rather then seeing the bottom box in the transparent one I see the UserControl backcolor. Is this to be expected?

As I read in the Help I can create a Bitmap that is transparent. I guess I
could set the Image of the top box to nothing and the background image to
the bitmap.

Not sure if that will work but it seems a shame to create another (big)
bitmap.

Is that the way to go or is there a cleaner way?
Cal

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ignacio Domínguez | last post by:
Hi there. I know I can make a form transparent by setting the transparent color, opacity, etc. Is there a way of making the background of a label and the background of a picturebox transparent...
2
by: Jaikumar | last post by:
Hi, 1) I have created one windows application, In the main form ( form1) i have added one usercontrol (usercontrol1), In that user control i am drawing one image. 2) In the UserControl1 i am...
1
by: Chris Auer | last post by:
I have been banging my head for a couple of hours now. No matter what I do the color that I make transparent is black. Here is the code I am using from MSDN. I have tried bitmaps, jpegs, gifs and...
7
by: Peter Oliphant | last post by:
Using MakeTransparent one can supposedly turn a color used in a Bitmap to transparent. But, it looks to me like all it does it set these pixels to the color BackColor of the Control it's attached...
9
by: SStory | last post by:
I have a picturebox in my About form. would like to have a link to my company website. Wanted the links background to be transparent. It seems that no one knows how to do this. Have asked...
1
by: Ricardo Furtado | last post by:
in my app i must have several pictureboxes over the others. Some pictureboxes just have a couple of lines or rectangles, and absolutly nothing more but the image is an .BMP. So, my problem is that...
2
by: Martin | last post by:
I've been complaing about the VB2005 Help-Information (or rather the lack of it) before, but when I was looking how to set the backstyle of a label control to "Transparent" I found that the VB2005...
2
by: thi | last post by:
Hi Experts, I am new to C# moving from VB 6.0. Basic i want to know how do i make the label transparent with the control color it currently on. For example I have a picturebox control...
8
by: Brian Ward | last post by:
I am looking for a simple way to set the image transparency in a PictureBox. I have a moving PictureBox containing a graphic image .. moving by incrementing its Left property. The background...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.