Painting 3D Edge on Ovals

  • Thread starter Thread starter SStory
  • Start date Start date
S

SStory

You know there is the controlpaint.Draw3DBorder and it works great for
rectangles.
How can one do this on ovals.

'thi is my rectangle code
ControlPaint.DrawBorder3D(g, rctShape.X, rctShape.Y, rctShape.Width,
rctShape.Height, Border3DStyle.Sunken, Border3DSide.Top Or Border3DSide.Left
Or Border3DSide.Right Or Border3DSide.Bottom)

Is there a way for ovals or do I need to design one.

If so, how?

Thanks,

Shane
 
* "SStory said:
You know there is the controlpaint.Draw3DBorder and it works great for
rectangles.
How can one do this on ovals.

'thi is my rectangle code
ControlPaint.DrawBorder3D(g, rctShape.X, rctShape.Y, rctShape.Width,
rctShape.Height, Border3DStyle.Sunken, Border3DSide.Top Or Border3DSide.Left
Or Border3DSide.Right Or Border3DSide.Bottom)

Is there a way for ovals or do I need to design one.

You will need to design one.
 
Thanks.

Any suggestions for how to do this and get the type of style listed below?
Seem I will be either drawing 2 ellipses or many arcs.

I assume I should use systemcolors 3d light and the like also.

Any pointers?

Thanks
 
Hi,

If you draw a white arc on half of the ellipse and black on the other
it will appear 3d. If the white is on top it appears raised and the
bottom it appears sunken.

Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim g As Graphics = e.Graphics
Dim pTop As New Pen(Color.White, 1)
Dim pBottom As New Pen(Color.Black, 1)
Dim rDraw As New Rectangle(400, 10, 50, 50)
g.FillEllipse(Brushes.SkyBlue, rDraw)

g.DrawArc(pTop, rDraw, 0, 360)
g.DrawArc(pBottom, rDraw, 0, 180)
End Sub

Ken
---------------------------

SStory said:
Thanks.

Any suggestions for how to do this and get the type of style listed below?

Seem I will be either drawing 2 ellipses or many arcs.

I assume I should use systemcolors 3d light and the like also.

Any pointers?

Thanks


"Herfried K. Wagner [MVP]" <HYPERLINK
"mailto:[email protected]"(e-mail address removed)> wrote in message
 
I will give that a try Ken.

Thanks,

Shane.
Ken Tucker said:
Hi,

If you draw a white arc on half of the ellipse and black on the other
it will appear 3d. If the white is on top it appears raised and the
bottom it appears sunken.

Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim g As Graphics = e.Graphics
Dim pTop As New Pen(Color.White, 1)
Dim pBottom As New Pen(Color.Black, 1)
Dim rDraw As New Rectangle(400, 10, 50, 50)
g.FillEllipse(Brushes.SkyBlue, rDraw)

g.DrawArc(pTop, rDraw, 0, 360)
g.DrawArc(pBottom, rDraw, 0, 180)
End Sub

Ken
 
Back
Top