Click here to Skip to main content
15,896,063 members
Home / Discussions / C#
   

C#

 
GeneralPorting MFC Container into C# Pin
13-Feb-02 7:58
suss13-Feb-02 7:58 
Generaldrawing an icon on a form Pin
Senkwe Chanda13-Feb-02 2:34
Senkwe Chanda13-Feb-02 2:34 
GeneralRe: drawing an icon on a form Pin
Peter Stephens13-Feb-02 10:30
Peter Stephens13-Feb-02 10:30 
GeneralRe: drawing an icon on a form Pin
Senkwe Chanda13-Feb-02 19:15
Senkwe Chanda13-Feb-02 19:15 
GeneralAuthenticating request from another machine Pin
bcooper13-Feb-02 2:29
bcooper13-Feb-02 2:29 
GeneralTransparent backgrounds for controls Pin
Profox Jase13-Feb-02 2:11
Profox Jase13-Feb-02 2:11 
GeneralRe: Transparent backgrounds for controls Pin
Senkwe Chanda13-Feb-02 3:16
Senkwe Chanda13-Feb-02 3:16 
GeneralRe: Transparent backgrounds for controls Pin
Profox Jase13-Feb-02 5:38
Profox Jase13-Feb-02 5:38 
Hi Senkwe,

Thanks for taking the time to help me. I have tried your idea but nfortunately your suggestion does not solve the problem.

My polygon represents an irregular shape - actually, an asteroid.

The foreground is, say, red - yes, a red asteroid (and why not?).
The background which c# paints it on is the same colour as the form (grey).
It is possible to change the background colour to black, green etc etc. When you do this, you get a red asteroid in a black (or whatever) rectangle.

When two asteroids overlap slightly the rectangle from one blocks out (is on top of) the other asteroid - this is my problem. All asteroid need to be drawn on a transparent rectangle so that their canvasses do not obscure each other.

If you look at control.settype, it seems there may be a way to make the background colour transparent, in fact I have managed this, however, the asteroid is redrawn very slowly.... here is some of the code from the constructor of asteroid:control

public asteroid(int startX, int startY, int incX, int incY, Form theForm)
{
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.backgroundColor = Color.FromArgb(1,Color.Gray);
...


I think I will tidy up my code and paste here for people to read. As an additional problem, when I am performing collision testing, I have a peculiar problem that seems to be inconsistent. When I create a rectangular region from my asteroid control, I can use region.isVisible(point) to test whether point is included in the region. This works. When I create an asteroid shaped region (instead of a rectangular shape), the call to region.isVisible(point) always seems to return false. Perhaps I am misunderstanding the region concept. Any ideas?





Jase

jason.king@profox.co.uk
Feel the love at www.profox.co.uk
GeneralRe: Transparent backgrounds for controls Pin
James T. Johnson13-Feb-02 8:11
James T. Johnson13-Feb-02 8:11 
GeneralRe: Transparent backgrounds for controls Pin
Profox Jase17-Feb-02 0:46
Profox Jase17-Feb-02 0:46 
GeneralC# and .NET books Pin
Oyvind Bratland13-Feb-02 0:42
Oyvind Bratland13-Feb-02 0:42 
GeneralRe: C# and .NET books Pin
Mazdak13-Feb-02 2:15
Mazdak13-Feb-02 2:15 
GeneralRe: C# and .NET books Pin
Oyvind Bratland13-Feb-02 2:21
Oyvind Bratland13-Feb-02 2:21 
GeneralRe: C# and .NET books Pin
Peter Stephens13-Feb-02 10:29
Peter Stephens13-Feb-02 10:29 
GeneralRe: C# and .NET books Pin
Oyvind Bratland13-Feb-02 19:57
Oyvind Bratland13-Feb-02 19:57 
GeneralRe: C# and .NET books Pin
James T. Johnson13-Feb-02 20:00
James T. Johnson13-Feb-02 20:00 
GeneralRe: C# and .NET books Pin
Peter Stephens14-Feb-02 8:45
Peter Stephens14-Feb-02 8:45 
GeneralRe: C# and .NET books Pin
TigerNinja_18-Feb-02 7:31
TigerNinja_18-Feb-02 7:31 
GeneralRe: C# and .NET books Pin
Tom Archer18-Feb-02 15:42
Tom Archer18-Feb-02 15:42 
GeneralRe: C# and .NET books Pin
Oyvind Bratland18-Feb-02 20:18
Oyvind Bratland18-Feb-02 20:18 
GeneralRe: C# and .NET books Pin
Tom Archer19-Feb-02 2:02
Tom Archer19-Feb-02 2:02 
GeneralRe: C# and .NET books Pin
Oyvind Bratland19-Feb-02 2:02
Oyvind Bratland19-Feb-02 2:02 
GeneralRe: C# and .NET books Pin
Tom Archer19-Feb-02 2:13
Tom Archer19-Feb-02 2:13 
GeneralRe: C# and .NET books Pin
Oyvind Bratland19-Feb-02 2:21
Oyvind Bratland19-Feb-02 2:21 
GeneralRe: C# and .NET books Pin
Tom Archer19-Feb-02 2:21
Tom Archer19-Feb-02 2:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.