[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

DrawEllipse appears to clip using ClientRectangle

Roy Soltoff

1/21/2005 7:51:00 PM

Given a small class derived from Control where I want to draw a circle that
may or may not be filled at the extent of the control, I override OnPaint
with the following code. This always appears to clip a pixel on the right
and bottom edges. Is this a bug in DrawEllipse? I have to work around it by
reducing the width and height by 1.

Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)

Try

e.Graphics.DrawEllipse(New Pen(Color.Black), Me.ClientRectangle)

If (myFillStyle = FillStyles.Opaque) Then

e.Graphics.FillEllipse(New SolidBrush(myFillColor),
Me.ClientRectangle)

End If

Catch ex As Exception

End Try

End Sub