I can't understand transparency/background colours - can you ? 
Author Message
 I can't understand transparency/background colours - can you ?

Hi, I'm having difficulty understanding transparency. Can someone add
a few words of wisdom how to get transparency working after I've done
the 4 steps below.

1. Create a new VB.Net project with a blank form with a grey
background (the default).
2. Add a 'Label' to the form with its 'caption' property set to the
following text "The quick brown fox jumps over the lazy dog"
3. Add a 'Picturebox' to the form and set its background colour to red
or yellow or something.
4. Move the label so that part of the label is over the picturebox and
part isn't (the label is in front of the picturebox).

Okay, how do I get the background colour of text over the picturebox
to be the colour of the picturebox, and the background colour of the
text not over the picturebox to be the colour of the form.

Thanks
Colin



Tue, 01 Feb 2005 23:20:36 GMT  
 I can't understand transparency/background colours - can you ?
Hi Colin,

The short answer is that the way that transparency is implemented in .NET
makes this impossible. What we did with our Graphical Text control
(http://www.vbtrain.net/productDisplay.aspx?id=4) is give the option of
creating a Region that exactly matches the text. This "cuts out" the text
and allows any objects behind the text to show through. The only downside is
that you cannot antialias the text in this mode since .NET doesn't see the
color of the object behind the control.

Hope this is helpful.

--
Jeff Rhodes
Author of "VBTrain.Net: Creating Computer and Web Based Training with Visual
Basic? .NET"
www.vbtrain.net
Home of the Shape and Graphical Text controls


Quote:
> Hi, I'm having difficulty understanding transparency. Can someone add
> a few words of wisdom how to get transparency working after I've done
> the 4 steps below.

> 1. Create a new VB.Net project with a blank form with a grey
> background (the default).
> 2. Add a 'Label' to the form with its 'caption' property set to the
> following text "The quick brown fox jumps over the lazy dog"
> 3. Add a 'Picturebox' to the form and set its background colour to red
> or yellow or something.
> 4. Move the label so that part of the label is over the picturebox and
> part isn't (the label is in front of the picturebox).

> Okay, how do I get the background colour of text over the picturebox
> to be the colour of the picturebox, and the background colour of the
> text not over the picturebox to be the colour of the form.

> Thanks
> Colin



Wed, 02 Feb 2005 12:18:10 GMT  
 I can't understand transparency/background colours - can you ?
Hi Colin,

The label control can be made transparent using the code at the following
link:

http://www.syncfusion.com/FAQ/WinForms/FAQ_c41c.asp#q710q

This works for some simple controls.

Hope this helps!
Bharat Patel
Microsoft, Visual Basic .NET

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.              



Sat, 05 Feb 2005 00:23:48 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. 'Canned' data in VB program

2. How do I create a canned form?

3. Canned AcctReceivable Module needed!

4. Canned pages....

5. Cans access2.0 engine access btrieve files?

6. Crystal Reports Canned Code

7. Canned objects and/or images

8. Switching from inhouse software to canned package.

9. line graph in vb (canned routine)

10. Looking 4 Canned Control

11. Setting Window Colours/Transparency

12. Toolbar Background/Foreground colours in VB.NET

 

 
Powered by phpBB® Forum Software