Click here to Skip to main content
15,892,005 members

Comments by O.G.I. (Top 6 by date)

O.G.I. 22-Apr-13 7:53am View    
Thank you for the quick response guys, about the exception, I think I found good solution in the forum:
How to close a multi-threaded .NET Windows Forms application and prevent the ObjectDisposedException from getting thrown[^]

I didn't know that the 'try' statements will be invoked only if exception occurs, I thought that it is some kind of check that repeats each time the code inside is executed, thank you CHill60.
O.G.I. 16-Jan-13 5:44am View    
Unfortunately when you set the 'CombineMode' to Union the whole screen becomes blank with no dark areas at all. Either I don't know how exactly to do that, either it is impossible. If you know how to achieve this effect:

http://dustwallow.webs.com/clip2.png


Just tell me, I know what the technical terminology is, but here this isn't the case, the case is very simple: either you can do the effect shown on the picture above with Set.Clip or you can't. If you can tell me how, if you can't, then thank you for your efforts to help me, I'll continue to search for another ways.
Here is a picture showing all results from the CombineMode options(also shows what I need):
http://dustwallow.webs.com/Goal.png
O.G.I. 15-Jan-13 19:24pm View    
Brisingr, thank you for the suggestions, but I couldn't make it work even with the 'Exclude Clip'.

Ok... let's put the question this way:

You have a path:
Dim clipPath As New GraphicsPath()

You add two shapes to this path - ellipses:
clipPath.AddEllipse(intX, intY, intrW, intH)
clipPath.AddEllipse(intX + 100, intY + 100, intrW, intH)

Then you set the clipping region to the path:
e.Graphics.SetClip(clipPath, CombineMode.Replace)

And you get this:
http://dustwallow.webs.com/clip.png
two intersected ellipses with third black ellipse between

how can I perform the 'Set.Clip' operation so the end result to be like this:
http://dustwallow.webs.com/clip2.png

I'm using Set.Clip function, because I don't want to display the areas in the dark, I don't want this areas to be calculated - only the spot light areas(the ellipses in the pictures).

Sorry, but I can't explain the problem more simply than this, I hope you understand...
O.G.I. 15-Jan-13 19:21pm View    
Deleted
Brisingr, thank you for the suggestions, but I couldn't make it work even with the 'Exclude Clip'.

Ok... let's put the question this way:

You have a path:
Dim clipPath As New GraphicsPath()

You add two shapes to this path - ellipses:
clipPath.AddEllipse(intX, intY, intrW, intH)
clipPath.AddEllipse(intX + 100, intY + 100, intrW, intH)

Then you set the clipping region to the path:
e.Graphics.SetClip(clipPath, CombineMode.Replace)

And you get this:
http://dustwallow.webs.com/clip.png
two intersected ellipses with third black ellipse between

how can I perform the 'Set.Clip' operation so the end result to be like this:
http://dustwallow.webs.com/clip2.png

I'm using Set.Clip function, because I don't want to display the areas in the dark, I don't want this areas to be calculated - only the spot light areas(the ellipses in the pictures).

Sorry, but I can't explain the problem more simply than this, I hope you understand...
O.G.I. 15-Jan-13 17:41pm View    
The goal is:

- A black layer to cover the playground field.

- Transparent regions(ellipses) moving on random positions to show what is underneath the black layer.

The picture actually shows exactly what the problem is:
- when two 'clip' regions intersect with each other they didnt merge - instead they make a third black ellipse between them.
Neither one of the 'CombineMode' options solves the problem:
- I tried them all(Complement, Exclude, Intersect, Replace, Union and Xor), they produce different results but not merge.
Why 'clip' regions:
- because I don't want to waste computational power drawing something that is inside the dark regions.