热门

最新

红包

立Flag

投票

同城

我的

发布
piratenox
PirateNOX
5 年前
truepiratenox

为什么用下面的代码绘出来的图一闪就没有了

Private Sub Button1_Click(ByVal sender As Systemobject, ByVal e As System.EventArgs)Hardles Button1.Click

DrawALine(PageToShow,Color.Red,50, 50,5,100)

End Sub

”以下建立绘图函数
Public sub DrawALine(ByVal WhereToraw as Picture,ByVal Draw_Color As Color,
ByVal StartPoint_X As Integer,ByVal StartPoint Y As Integer, ByVal Line_Width As Integer, ByVal Line_Height As Integer)
Dim Pic As New PictureBox
With Pic
.Name ="Pic"
.Size = New Size(Line_Width+ 6, Line_Height + 6)
.SizeMode = PictureBoxSizemode.StretchImage
.Parent = WhereToDraw
.Location= New PointStartPoint_x-3 StartPoint_Y-3)
End With
Dim g As Graphics=Pic.CreateGraphics
Dim Draw_Pen As New Pen(Draw_color, Line Width)
g.DrawLine (Draw_Pen, 3 3,3+ Line_Width, 3 + Line_Height)

Ernd Sub

保持热爱共赴山海
CSDN App 扫码分享
分享
评论
1
打赏
  • 复制链接
  • 举报
下一条动态
立即登录