Picturebox中的shape控件,mousemove里改变shape大小会闪烁的问题
如题,Picturebox中显示了图片,然后mousemove中改变shape控件的大小,结果一边拖鼠标一边闪烁,怎么办呢?mousemove中的部分代码:
If isMouseDown(0) Then '按下鼠标
'判断是否不成矩形了
If (RoiEndX - RoiX) < Mouse_Scope Or (RoiEndY - RoiY) < Mouse_Scope Then Exit Sub
If RoiX < 0 Then RoiX = 0
If RoiY < 0 Then RoiY = 0
If RoiEndX > Display1.ScaleWidth + Display1.Left Then RoiEndX = Display1.ScaleWidth
If RoiEndY > Display1.ScaleHeight + Display1.Top Then RoiEndY = Display1.ScaleHeight
Shape(0).Left = RoiX
Shape(0).Top = RoiY
Shape(0).width = RoiEndX - RoiX
Shape(0).height = RoiEndY - RoiY
End If
[解决办法]
用line语句代替shape空件