473,782 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Q: Transparent image on a form

Hi

Can anybody help me with the following? It is driving me crazy!!!

I'm trying to produce a non-rectangular form as follows:

(1) Produce a bitmap e.g. gif, using paint shop pro 5.
(2) The Background color of the bitmap is set to white.
(3) Draw a design on the bitmap in a color other than white.
(4) Create a windows application.
(5) Set the forms background image to be the bitmap created earlier.
(6) Set the transparencyKey of the form to be white i.e. the same as the
background color of the bitmap.
(7) Set the FormBorderStyle to None
(8) Run the application.

I expected just the non-white images but instead I still see the white
background! D'OH!!!

Can anybody tell me what I'm doing wrong?

Here's a link to Microsoft describing the same thing.

Thanks in adavance

Geoff
Nov 21 '05
40 2015
For WindowsXP and Windows 2000 Go to the Control Panel and change the
Settings(to less than 32). Only then it will work.I assume that you have
set the FormTransparenc y Key property.

with regards,
J.V.Ravichandra n
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandra n+J.V.&cob=aspn etpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID= P3966388&BN=999 &PN=2
- Or, just search on "J.V.Ravichandr an"
at http://www.Google.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #31
Thank you Ravichandran. It does indeed work if you set the colour depth to,
for example, 16. However, as you'll see in the other posts there is a
"better" way using regions. Several users have kindly given code which shows
how this can be done.

Geoff

"Ravichandr an J.V." <jv************ @yahoo.com> wrote in message
news:O4******** ******@TK2MSFTN GP12.phx.gbl...
For WindowsXP and Windows 2000 Go to the Control Panel and change the
Settings(to less than 32). Only then it will work.I assume that you have
set the FormTransparenc y Key property.

with regards,
J.V.Ravichandra n
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandra n+J.V.&cob=aspn etpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID= P3966388&BN=999 &PN=2
- Or, just search on "J.V.Ravichandr an"
at http://www.Google.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 21 '05 #32
Geoff,
It has nothing to do with "thank you",

You did not tell why the approaches we offered you did not fit.

While Peter's last message was in my opinion directly a correct one, did you
directly go on with communicating with Herfried when he came in this thread
and left us alone and even not react on the sample from Peter. At the end
you got an answer from Herfried basicly the same as Peters.

When you had answered me directly on my question "if you had tried my
sample", than I had as well directly told to take the approach of MSDN
sample, combined with mine, and in that the part of Peter.

However next time I will leave you for Herfried to answer your questions,
than this will not happen again. Our answers seem not good enough for you.

In addition, that has nothing to do with thank you.

Cor

Nov 21 '05 #33
Cor

I've looked through the tree again and accept what you are saying. I didn't
reply to Peter or yourself and for that I can only apologise. No excuse!
But, as I have so obviously offended you I'll try not to write to this
newsgroup again.

Geoff

"Cor Ligthert" <no************ @planet.nl> wrote in message
news:eq******** ******@TK2MSFTN GP12.phx.gbl...
Geoff,
It has nothing to do with "thank you",

You did not tell why the approaches we offered you did not fit.

While Peter's last message was in my opinion directly a correct one, did
you directly go on with communicating with Herfried when he came in this
thread and left us alone and even not react on the sample from Peter. At
the end you got an answer from Herfried basicly the same as Peters.

When you had answered me directly on my question "if you had tried my
sample", than I had as well directly told to take the approach of MSDN
sample, combined with mine, and in that the part of Peter.

However next time I will leave you for Herfried to answer your questions,
than this will not happen again. Our answers seem not good enough for you.

In addition, that has nothing to do with thank you.

Cor

Nov 21 '05 #34
Geoff,

I am glad that you understand what I was writting, so I forget it and answer
your following questions again normally, I only wanted to show you that this
is not nice for people who wants to help.

Cor
Nov 21 '05 #35
"Ravichandr an J.V." <jv************ @yahoo.com> schrieb:
For WindowsXP and Windows 2000 Go to the Control Panel and change the
Settings(to less than 32). Only then it will work.I assume that you have
set the FormTransparenc y Key property.


There are thousands of users who don't run their machine with the required
color depth, so using 'TransparencyKe y' for arbitrary shaped forms is not a
good idea.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #36
"Cor Ligthert" <no************ @planet.nl> schrieb:
You got from me very early a sample, that combined with the sample on MSDN
and that combined with the code Peter was providing you is in my opinion
more than you got now at least from Herfried.


Your sample doesn't show how to create an arbitrary shaped form from a
bitmap/mask.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #37
"Geoff Jones" <no********@ema il.com> schrieb:
But, as I have so obviously offended you I'll try not to write to this
newsgroup again.


You are welcome.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #38
You got from me very early a sample, that combined with the sample on
MSDN
and that combined with the code Peter was providing you is in my opinion
more than you got now at least from Herfried.


Your sample doesn't show how to create an arbitrary shaped form from a
bitmap/mask.


Did I say that?

Cor
Nov 21 '05 #39
"Cor Ligthert" <no************ @planet.nl> schrieb:
You got from me very early a sample, that combined with the sample on
MSDN
and that combined with the code Peter was providing you is in my opinion
more than you got now at least from Herfried.


Your sample doesn't show how to create an arbitrary shaped form from a
bitmap/mask.


Did I say that?


Well, that's what the OP was obviously looking for.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #40

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

Similar topics

0
1847
by: Graphics_master | last post by:
Anyone know how to create a transparent splash screen similar to Photoshop, After Effects, or premiere. They have a wonderful transparent look. I realize that I can use the key color property of a form to make colors transparent, but I'm not satisfied with aliased edges. I want full 256 color alpha support. I see that the png format has nice transparent support but the form shows through. Forms don't support a transparent background...
2
33532
by: Alex Gray | last post by:
Hi, I'm trying to make my PictureBox transparent to the BackgroundImage of the Form, not the BackColor of the form. Here's what i have: --------------------------------------------------- this.BackColor = Color.Wheat; this.gameBackgroundBMP = new Bitmap(GetType(),"MyForm.backGround.bmp");
2
8312
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...
9
7819
by: don | last post by:
I want to create a transparent form and can write something on it by using Ink. I try to set form.backcolor = color.transparent, but it dosen't accept. And everything will be transprent when i use Opacity. Finally, i try to use transparencykey, but any mouse actions will be transferred to the windows below the transparent area. Any solutions? thx
1
13142
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/")
8
10610
by: Grahammer | last post by:
Is it possible to set the background of a usercontrol as transparent? I tried setting the background image of the usercontrol to a transparent GIF, but that caused MAJOR problems. I'm making some controls that aren't rectangular and it won't be pretty if I end up with a grey rectangle behind each one. http://msdn.microsoft.com/library/en-us/vbcon/html/vbtskGivingYourControlTransparentBackground.asp?frame=true
5
2545
by: Tony Clark | last post by:
Hi, I have a bmp that is set in a panel, i want to make the white color in the bmp image transparent so i can see the color of the panel below. How is this done? thanks tony
1
1597
by: Lucile | last post by:
Hi All, I am trying to obtain some sort of a "Model" based on horizontal & vertical lines (like a frame) drawn on a form or on a PictureBox. For frames configuration purposes, I created a white background image; and that works fine. But the "Model" will be used to cut off pieces of a given image with MS Office. I would therefore like that the lines be appearent on the image to be cut; but the the underlying control be transparent (so as...
8
2150
by: MikeB | last post by:
Hi, I created a picturebox with a map as an image. I want to make certain areas on the map clickable hotspots and the way I'm trying to do this is to create a transparent label with a different cursor (hand) and then I code the click_event for that label. However, I cannot make the label transparent, even if I choose the Transparent option for the attribute for the background color of the label. Any ideas or suggestions? Thanks
4
10248
by: Dale | last post by:
I am creating GIF images with transparent backgrounds on-the-fly for a web app and rendering them by using System.Drawing.Image.Save(Response.OutputStream, ImageType.GIF). I am confident that the transparency is working properly because if I save the created image to the local hard disk and then view it in a web page or an image editor, the transparency is correct. I can also view the transparency on-the-fly in a Windows.Forms...
0
9639
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9479
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10311
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...
0
9942
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...
0
8967
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 project—planning, coding, testing, and deployment—without 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...
0
6733
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
5378
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
5509
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2874
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.