473,626 Members | 3,343 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2296
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****@REMOV Ea-znet.com> wrote in message
news:%2******** *******@tk2msft ngp13.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
36036
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 also, so that I can place some text on top of an image (seing the image behind the text instead of the gray box of the label) and showing to the user only the image without the background of the picturebox or form, and the text over it? Any Ideas?...
2
8300
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 showing one transparent form (form3) when ever user preseed left mouse button. 3) The form3 has one transparent user control (usercontrol2) that paints circles. That measn the circles will show on top the usercontrol1 image. 4) The form3 border style...
1
13114
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 new bitmaps created in code, but I cant get any image to go transparent. Thanks if you can help. // Create a Bitmap object from an image file. Bitmap myBitmap = new Bitmap(System.Web.HttpContext.Current.Server.MapPath("resources/img/")
7
3573
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 to. Thus, when I set White to the transparent color of a Bitmap stored in the Image of a PictureBox and placed the PictureBox on a Form which has a BackColor of black, it turned the white pixels of the bitmap image to black, but these black pixels...
9
14808
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 many times. VB help says that transparent is possible with a background image but not above a control. So how can I provide a link (URL) that is clickable, but transparent, over the picturebox in my about box?
1
8752
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 i need to see whats beind those pictureboxes and at the same time showing, the lines and rectangles that exist on the pictureboxes that are at the top. Because i just can't copy the image to the other picturebox (because i'll have to be able to...
2
10973
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 documentation has reached an all-time low (please note the part about the z-order): MSDN: In Visual Basic 6.0, the BackStyle property of the Label control determines whether the label had a transparent background. Setting the BackStyle...
2
20672
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 in my form, I set the picture property to
8
10160
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 however shows white as the PictureBox moves but I want it to be transparent. The PictureBox BackColor is set to Transparent .. but no affect. I have used PhotoShop to make the image background transparent .. again no affect. If I make the image a...
0
8644
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8370
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8514
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6126
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4094
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4208
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2632
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1516
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.