Click to See Complete Forum and Search --> : Drawing and Clipping


TSmooth
June 8th, 2005, 09:27 PM
I have a collection of objects that hold info for drawing an ellipses. They represent various range bands from a central point so there is a single point that have several rings around them. For simplicity lets just say there is a minimum range and a maximum range ring. I want to fill the area between the min. range and max range but nothing inside the min. range. How do I go about doing this? I've tried so many things today and was unable to get it to work. Here's my Paint event that does the drawing of the ellipses which come out nicely:


Private Sub MapView_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim curRB As RangeBand
Dim GP As New Drawing2D.GraphicsPath

For Each curRB In RangeBands
GP.AddEllipse(curRB.pt.x, curRB.pt.y, curRB.Radius * 2, curRB.Radius * 2)
e.DrawPath(curRB.Pen, GP)
Next

End Sub


So basically there's a circle inside a circle and i want to fill the area between the two circles. I've tried so many combinations of regions and clipping settings and just couldn't get it to work right, was driving me crazy.

- Tom

TSmooth
June 9th, 2005, 07:00 AM
Made a simple test program this morning in 10min. and I think I got it figured out now... amazing what leaving a situation and coming back to it at a later time can do for you.

- Tom

Gizmo001
June 9th, 2005, 07:25 AM
Easiest thing to do is to start with the outermost ellipse, fill it with the right color, then the next inner ellipse and fill that with opaque color. The fill will cover the first circle except the annular region between the two circles. Proceed in this manner to the innermost circle. Good luck.