intercepting lines

  • Thread starter Thread starter Valery Polyakov
  • Start date Start date
V

Valery Polyakov

I am drawing lines with a semi-transparent color
(alpha=100). When these lines intercept, the color
becomes more intense. Is there a way to avoid this, so
that I would get the same intensity of color?

Thanks a lot.
 
How can i do this?
-----Original Message-----


not with an easy drawing method.
you have to modify the drawing to don't draw any point twice.

--
------ooo---OOO---ooo------

Peter Koen - www.kema.at
MCAD CAI/RS CASE/RS IAT

------ooo---OOO---ooo------
.
 
You could draw the lines on a Bitmap (with no transparency and hence points
of intersection are the same color as the line) and then draw the bitmap to
the destination Graphics with the appropriate transparency. I'm not sure
what the background is that you want to "show through". If you want to see
the desktop through a Form, you can use the Opacity property of the form.
If the background is some bitmap you have drawn to another Graphics, you
will need to combine the lines' Bitmap with that. You can set the
transparent color of the bitmap you drew the lines on to its background
(initial) color.
 
Hi Valery,

You can first construct a GraphicsPath object, then you can pass it as
parameter to the Region class's constructor.
At last, you can use Region.Union method to combine these 2 regions.

Btw: if your 2 lines are not vertical or horizontal, you have to calculate
the coordinates of the region yourself.( which may be complex)

Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Valery Polyakov" <[email protected]>
| Sender: "Valery Polyakov" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: RE: intercepting lines
| Date: Wed, 5 Nov 2003 04:48:26 -0800
| Lines: 60
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcOjmxr+hTIipKdNS3Sat+Rx+luaLg==
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:196891
| NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Yes, My lines are of the same color.
|
| How do I treat them as a region?
| >-----Original Message-----
| >
| >Hi Valery,
| >
| >Thanks for posting in this group.
| >Are your 2 lines the same color and alpha value?
| >If it is(and it should be the same), you can give up the
| drawline method,
| >but treat the 2 lines as a region, then you can combine
| these 2 regions
| >into a big region, finally, you can fill it with what
| you want.(And it
| >color will not be intense in intercepting region)
| >
| >Hope this helps,
| >
| >Best regards,
| >Jeffrey Tan
| >Microsoft Online Partner Support
| >Get Secure! - www.microsoft.com/security
| >This posting is provided "as is" with no warranties and
| confers no rights.
| >
| >--------------------
| >| Content-Class: urn:content-classes:message
| >| From: "Valery Polyakov" <[email protected]>
| >| Sender: "Valery Polyakov" <[email protected]>
| >| Subject: intercepting lines
| >| Date: Tue, 4 Nov 2003 07:35:05 -0800
| >| Lines: 7
| >| Message-ID: <[email protected]>
| >| MIME-Version: 1.0
| >| Content-Type: text/plain;
| >| charset="iso-8859-1"
| >| Content-Transfer-Encoding: 7bit
| >| X-Newsreader: Microsoft CDO for Windows 2000
| >| X-MimeOLE: Produced By Microsoft MimeOLE
| V5.50.4910.0300
| >| Thread-Index: AcOi6Tivlu1vBQxXRquUBkYjRh61Fg==
| >| Newsgroups: microsoft.public.dotnet.languages.csharp
| >| Path: cpmsftngxa06.phx.gbl
| >| Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:196612
| >| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| >| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| >|
| >| I am drawing lines with a semi-transparent color
| >| (alpha=100). When these lines intercept, the color
| >| becomes more intense. Is there a way to avoid this, so
| >| that I would get the same intensity of color?
| >|
| >| Thanks a lot.
| >|
| >|
| >
| >.
| >
|
 
Back
Top