473,606 Members | 2,877 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can I draw overlapped PNG files with transparent background inimageboxcontr ol?

Dear all,

I'm trying to draw many overlapped PNG files with transparent background
in imagebox control.
But the transparent background in this control is rendered as the main
control's background color.
So the image formerly drawn is covered by the latter image with unwanted
background color.
I wonder if I can get really transparent background color.

Appreciate any help.
Thanks in advance.
Jun 10 '07 #1
2 6571
Niu,

You could probably draw all the PNG images to a new image, and the
transparency will be maintained, and then show that in the picturebox.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Niu Kun" <ha*******@hotm ail.comwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Dear all,

I'm trying to draw many overlapped PNG files with transparent background
in imagebox control.
But the transparent background in this control is rendered as the main
control's background color.
So the image formerly drawn is covered by the latter image with unwanted
background color.
I wonder if I can get really transparent background color.

Appreciate any help.
Thanks in advance.
Jun 10 '07 #2
Nicholas Paldino [.NET/C# MVP] 写道:
Niu,

You could probably draw all the PNG images to a new image, and the
transparency will be maintained, and then show that in the picturebox.

Dear Mr. Paldino,

Thank you for your reply.
But this may result in some other problem.
Do you mean that I can create Image object with some other Image object
at various location?
And I'll have draw the image dynamically as the user click on the panel.
I'll have to create the image each time the Image is click on, and this
seems to be difficult.
Will Directx be helpful?

Thanks again for your kind suggestion.
Jun 11 '07 #3

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

Similar topics

5
9487
by: Paul Schnitter | last post by:
Update: My custom control is based on the article "Creating Visual Basic .NET controls from scratch" in "Adventures in .NET" on MSDN. It is designed to be a replacement for the VB6 shape control. My control draws a shape (circle, square, rectangle ...)
21
3062
by: DraguVaso | last post by:
Hi, I have an inherited DataGrid, that does lots of extra stuff. For exemple drawing a backgroundimage in every cell. The problem is that it's taking too much time (using gdi+), so I want to do it using DirectX. I downloaded already the DSK etc, but I can't find how I need to draw an image on a given position. I don't need stuff to write advanced 3D-games, just painting that image. Can anybody help me with this? I'm already looking for...
1
20164
by: Efkas | last post by:
My application have some level : 1. MyButton class with Label inheritance 2. MyComponent as User Control loading and positionning some of MyButtons 3. MyApp loading and positionning MyComponent I prefer don't insert a background in MyComponent, and using the MyApp one as general background with MyComponent positionned, but I am not able to have MyComponent background transparent.
1
2250
by: Robert W. | last post by:
I've successfully implemented code to change a form's background to a nice blue gradient. It looks great! But I'm having problems adding controls with transparent backgrounds to the form. Specifically I'd like to add an image and a label with a transparent background. At design time everything appears okay but when I run the code it no longer works. Might there be some articles on how to do this?
1
3005
by: Carsten Klotz | last post by:
Hi, I've set the TransparencyKey of a form to black. That means, all black pixel will be shown transparent within the drawing content of that form. If I set the background to black, I can see the underlying window (ie. Desktop or IE). But when I want to draw with the mouse inside that transparent area, my form/window lost its focus (TopMost=true). Even when I'm just moving the mouse, I can see, that I'm "touching" the underlying content...
3
2003
by: Ian Jagger | last post by:
Hi, I am trying to convert a group of wmf files to gif files. Easy you'd think? I'm using the following code: Image img = Image.FromFile (this.tbxFilename.Text); string filename = this.tbxFilename.Text.Replace ("wmf", "gif"); img.Save (filename, ImageFormat.Gif);
0
967
by: pope | last post by:
I am up for shade icon when I click the icon which I draw on a SDI viw with CImageList::Draw(pDC,index,myPoint, ILD_BLEND50). the icons are edited in the vc++ icon editor, with the 'transparent' color(that special greenish color depicted by a screen) set as the background,and these icons can shade correctly. But it fails when I change the greenish color to white color, and set as the background ,instead being blue square when I click...
0
1529
by: Niu Kun | last post by:
Dear all, I'm planning to draw some overlapped pictures on a tabpage. I use PictureBox control. And the picture seems well at first. But when I try to draw a PictureBox on the other. The transparent part of the PictureBox seems to have the same colour with the tabpage background. And the PictureBox under it is covered by that. The covered part is never seen again. Can I simply solve the problem with existing simple control?
10
7523
by: Phil | last post by:
I would like to draw some text which will be in front of any other controls, but without obscuring them completely. If I use DrawString in the form's Paint handler the text is always behind, not in front of the other controls. In VB6 I would have simply used a label control and set it to transparent, but this doesn't work in .NET, the background of a label can be set to 'transparent', but this does not show the other controls through,...
0
8031
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8456
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8107
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
6792
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5971
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
3945
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
3989
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1309
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.