本文介绍了图形将逐页!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用以下代码:
I use the code below:
Protected Function OMID_GetPath() As GraphicsPath
Dim w As Integer = Me.Width
Dim h As Integer = Me.Height
Dim path As GraphicsPath = New GraphicsPath()
path.AddArc(0, 0, 2 * w, 2 * h, 180, 90)
path.AddLine(w, 0, w, h)
path.CloseFigure()
Return path
End Function
和:
and:
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim bb As GraphicsPath = OMID_GetPath()
e.Graphics.SmoothingMode = SmoothingMode.HighQuality
e.Graphics.FillPath(Brushes.Black, bb)
End Sub
和这个:
and this:
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
Me.Refresh()
End Sub
我画了一条曲线但是当我改变窗口大小时,图形会逐页显示。
我该怎么做才能解决这个问题?
I have drawn a curve But when I change the window size Graphics will be page by page.
What can I do to solve this problem?
推荐答案
Private Sub Form1_ResizeEnd(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ResizeEnd
Invalidate()
End Sub
每当你想要重新绘制你的窗口时,你可以调用Me.Invalidate()
编辑:删除一个死链接
You can call Me.Invalidate() whenever you want to repaint your window
Removed a dead link
这篇关于图形将逐页!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!