mPen1 =新笔(Color.Red,mPenWidth) mPen2 =新笔(Color.Blue,mPenWidth) mPen3 =新笔(颜色。绿色,mPenWidth) mPen4 =新笔(Color.Yellow,mPenWidth) 结束子 这将画出一个完整的在表单上的圆圈,每个四分之一圆圈是一个不同的颜色,并且每个都是单独绘制的...这也跟随鲍威尔的 双缓冲示例以及更顺畅的绘画体验:) HTH, MythranNot sure if this is what you meant, but I''ll post it just in case...Create a new form and add the following:Private mPen1 As PenPrivate mPen2 As PenPrivate mPen3 As PenPrivate mPen4 As PenPrivate mPenWidth As IntegerPrivate mBackBuffer As BitmapProtected Overrides Sub OnPaint(ByVal e As PaintEventArgs)If mBackBuffer Is NothingmBackBuffer = _New Bitmap(Me.ClientSize.Width, Me.ClientSize.Height)End IfDim canvas As Graphics = Graphics.FromImage(mBackBuffer)'' Draw the background.canvas.Clear(Me.BackColor)Dim rect As Rectangle = Me.ClientRectangle'' Draw the top-left quarter-circle.canvas.DrawArc(mPen1, rect, 180, 90)'' Draw the top-right quarter-circle.canvas.DrawArc(mPen2, rect, 270, 90)'' Draw the bottom-right quarter-circle.canvas.DrawArc(mPen3, rect, 0, 90)'' Draw the bottom-left quarter-circle.canvas.DrawArc(mPen4, rect, 90, 90)'' Cleanup.canvas.Dispose()'' Copy the back buffer to the screen.e.Graphics.DrawImageUnscaled(mBackBuffer, 0, 0)End SubProtected Overrides Sub OnPaintBackground( _ByVal pevent As System.Windows.Forms.PaintEventArgs _)'' Don''t paint the background.End SubProtected Overrides Sub OnResize(ByVal e As System.EventArgs)Me.Invalidate()If Not mBackBuffer Is NothingmBackBuffer.Dispose()mBackBuffer = NothingEnd IfMyBase.OnResize(e)End SubPrivate Sub Form_Load( _ByVal sender As Object, _ByVal e As System.EventArgs _) Handles MyBase.LoadmPenWidth = 5mPen1 = New Pen(Color.Red, mPenWidth)mPen2 = New Pen(Color.Blue, mPenWidth)mPen3 = New Pen(Color.Green, mPenWidth)mPen4 = New Pen(Color.Yellow, mPenWidth)End SubThis will draw a full circle on the form, each quarter circle is a differentcolor and are each drawn separately...this also follows powell''sdouble-buffering example as well for a smoother drawing experience :)HTH,Mythran < snip><snip> < snip><snip> Qu ****** @ aol.com 写道: 我本以为你会直接在VS.NET中搜索 帮助,查找DrawArc,找到图形。结果中的DrawArc方法 窗格(你正在寻找.NET框架中的东西)和 双击它,然后点击同步内容 ;按钮(在Web工具栏中看起来像是一个蓝色的左右箭头)并查看了图形部分中的其他方法,在那里您可以找到DrawPie方法。 HTH AndrewI would have thought you would have gone straight to the search in VS.NEThelp, looked up DrawArc, found the Graphics.DrawArc method in the resultspane (you''re looking for things in the .NET framework Location) anddouble-clicked it, then clicked the "Sync Contents" button (looks like ablue left-right arrow in the Web toolbar) and looked at the other methods inthe Graphics section, where you would have found the DrawPie method.HTHAndrew 这篇关于Quater Cirlce的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-02 00:12