Transparency
-
I am using transparency effects to create shaped windows, I have followed the basic tutorial found here : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv\_vstechart/html/vbtchShapedWindowsFormsControlsInVisualStudioNET.asp Now on my machine this works like a dream, but on other machines it does not work correctly - transparency doesnt work at all. All machines are set to the same resolution and colour depth (32bpp). Does anybody have any ideas on the cause of this? More info : The image in question is a 24bit bmp, the transparency key I am using is 255,0,255 (fuschia)
-
I am using transparency effects to create shaped windows, I have followed the basic tutorial found here : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv\_vstechart/html/vbtchShapedWindowsFormsControlsInVisualStudioNET.asp Now on my machine this works like a dream, but on other machines it does not work correctly - transparency doesnt work at all. All machines are set to the same resolution and colour depth (32bpp). Does anybody have any ideas on the cause of this? More info : The image in question is a 24bit bmp, the transparency key I am using is 255,0,255 (fuschia)
MrEyes wrote: Now on my machine this works like a dream, but on other machines it does not work correctly - transparency doesnt work at all. All machines are set to the same resolution and colour depth (32bpp). Are the other test machines running Windows XP? As far as I know only WXP supports transparency out of the box.
Paul Watson
Bluegrass
Cape Town, South AfricaRay Cassick wrote:
Well I am not female, not gay and I am not Paul Watson -
MrEyes wrote: Now on my machine this works like a dream, but on other machines it does not work correctly - transparency doesnt work at all. All machines are set to the same resolution and colour depth (32bpp). Are the other test machines running Windows XP? As far as I know only WXP supports transparency out of the box.
Paul Watson
Bluegrass
Cape Town, South AfricaRay Cassick wrote:
Well I am not female, not gay and I am not Paul WatsonWindows 2000 and greater support transparency. (95/98/Me Dont) Contract Software Developer: andrew_lewis@mail.com
-
MrEyes wrote: Now on my machine this works like a dream, but on other machines it does not work correctly - transparency doesnt work at all. All machines are set to the same resolution and colour depth (32bpp). Are the other test machines running Windows XP? As far as I know only WXP supports transparency out of the box.
Paul Watson
Bluegrass
Cape Town, South AfricaRay Cassick wrote:
Well I am not female, not gay and I am not Paul WatsonSubject. ===================== http://wasp.elcat.kg
-
Subject. ===================== http://wasp.elcat.kg
Ahhh, thanks, my mistake :)
Paul Watson
Bluegrass
Cape Town, South AfricaRay Cassick wrote:
Well I am not female, not gay and I am not Paul Watson -
Windows 2000 and greater support transparency. (95/98/Me Dont) Contract Software Developer: andrew_lewis@mail.com
Andrew Lewis wrote: Windows 2000 and greater support transparency. (95/98/Me Dont) Ahhh, thanks, my mistake :)
Paul Watson
Bluegrass
Cape Town, South AfricaRay Cassick wrote:
Well I am not female, not gay and I am not Paul Watson -
MrEyes wrote: Now on my machine this works like a dream, but on other machines it does not work correctly - transparency doesnt work at all. All machines are set to the same resolution and colour depth (32bpp). Are the other test machines running Windows XP? As far as I know only WXP supports transparency out of the box.
Paul Watson
Bluegrass
Cape Town, South AfricaRay Cassick wrote:
Well I am not female, not gay and I am not Paul WatsonThanks for the replies but unfortunatly they dont bring me any closer to an answer. The following is a summary of the test machines : 1) Win 2000 (SP2) - 1024*768 - 32bit color depth 2) Win XP - 1024*768 - 32bit color depth 3) Win 2000 (SP2) - 1024*768 - 32bit color depth 4) Win XP - 1024*768 - 32bit color depth Now my form background transparency works fine on machines 1 & 2 but does not work on other two (2 & 3). I have also noticed that "opacity" works on all machines (i.e. setting the entire form to 25% opactity results in a "see through" form) I have also tried using different image formats (i.e. gif) and also different transparency colors (current using fuschia (255,0,255) all to no avail. I am 100% this is probably all being caused by some option I have missed, but if that is the case it isnt detailed in MSDN link above Once again, thanks for the replies so far, any further suggestions would be greatly appreciated PS. if anybody is interested enough, a copy of the VS .NET projects files can be found here (http://www.randomportal.com/shapedwindow.zip 256kb) - bear in mind this is a test application and is not "pretty" PPS. Alternativly the following is the source code for the form (bear in mind that the image is held with a resx resource file). This code is also autogenerated by VS .NET, so one would assume that its correct, hmmmm using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace ShapedWindow { public class Form1 : System.Windows.Forms.Form { private System.ComponentModel.Container components = null; public Form1() { InitializeComponent(); } protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1)); this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.BackgroundImage = ((System.Drawing.Bitmap)(resources.GetObject("$this.BackgroundImage"))); this.ClientSize = new System.Drawing.Size(229, 228); this.Name = "Form1"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Form1"; this.TopMost = true; this.TransparencyKey = System.Drawing.Color.Fuchsia; } [STAThread] static void Main() { Application.Run(new
-
Thanks for the replies but unfortunatly they dont bring me any closer to an answer. The following is a summary of the test machines : 1) Win 2000 (SP2) - 1024*768 - 32bit color depth 2) Win XP - 1024*768 - 32bit color depth 3) Win 2000 (SP2) - 1024*768 - 32bit color depth 4) Win XP - 1024*768 - 32bit color depth Now my form background transparency works fine on machines 1 & 2 but does not work on other two (2 & 3). I have also noticed that "opacity" works on all machines (i.e. setting the entire form to 25% opactity results in a "see through" form) I have also tried using different image formats (i.e. gif) and also different transparency colors (current using fuschia (255,0,255) all to no avail. I am 100% this is probably all being caused by some option I have missed, but if that is the case it isnt detailed in MSDN link above Once again, thanks for the replies so far, any further suggestions would be greatly appreciated PS. if anybody is interested enough, a copy of the VS .NET projects files can be found here (http://www.randomportal.com/shapedwindow.zip 256kb) - bear in mind this is a test application and is not "pretty" PPS. Alternativly the following is the source code for the form (bear in mind that the image is held with a resx resource file). This code is also autogenerated by VS .NET, so one would assume that its correct, hmmmm using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace ShapedWindow { public class Form1 : System.Windows.Forms.Form { private System.ComponentModel.Container components = null; public Form1() { InitializeComponent(); } protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1)); this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.BackgroundImage = ((System.Drawing.Bitmap)(resources.GetObject("$this.BackgroundImage"))); this.ClientSize = new System.Drawing.Size(229, 228); this.Name = "Form1"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Form1"; this.TopMost = true; this.TransparencyKey = System.Drawing.Color.Fuchsia; } [STAThread] static void Main() { Application.Run(new
MrEyes wrote: I have also noticed that "opacity" works on all machines Silly me, I thought you were talking about opacity all along. Anyway I had a look around and from what I can tell shape forms using the TransparencyKey are not reliable. Shaped Windows Forms and Controls in Visual Studio .NET[^] says "Note Monitors set to a color depth of greater than 24-bit can display problems with certain parts of the form not being transparent, despite setting of the TransparencyKey property. To avoid this problem, ensure that the monitor's color depth is set to less than 24-bit in the Display control panel. When developing applications that feature this transparency, keep in mind that you will have to make your users aware of this issue." which is pretty pathetic IMO as they offer no help or even admit there is a bug.
Paul Watson
Bluegrass
Cape Town, South AfricaRay Cassick wrote:
Well I am not female, not gay and I am not Paul Watson -
MrEyes wrote: I have also noticed that "opacity" works on all machines Silly me, I thought you were talking about opacity all along. Anyway I had a look around and from what I can tell shape forms using the TransparencyKey are not reliable. Shaped Windows Forms and Controls in Visual Studio .NET[^] says "Note Monitors set to a color depth of greater than 24-bit can display problems with certain parts of the form not being transparent, despite setting of the TransparencyKey property. To avoid this problem, ensure that the monitor's color depth is set to less than 24-bit in the Display control panel. When developing applications that feature this transparency, keep in mind that you will have to make your users aware of this issue." which is pretty pathetic IMO as they offer no help or even admit there is a bug.
Paul Watson
Bluegrass
Cape Town, South AfricaRay Cassick wrote:
Well I am not female, not gay and I am not Paul Watson