用VB画三角形后如何填充颜色呀
用VB画三角形后如何填充颜色呀,我用三条线组成的三角形,里面为什么不会填充颜色?PrivateSubPicture1_Click()WithPicture1.FillCo...
用VB画三角形后如何填充颜色呀,我用三条线组成的三角形,里面为什么不会填充颜色?
Private Sub Picture1_Click()
With Picture1
.FillColor = vbRed
.FillStyle = 0
.ForeColor = vbBlue
Picture1.Line (Picture1.ScaleLeft, Picture1.ScaleTop)-(Picture1.ScaleLeft + Picture1.ScaleWidth, Picture1.ScaleTop + Picture1.ScaleHeight / 2)
Picture1.Line -(Picture1.ScaleLeft, Picture1.ScaleTop + Picture1.ScaleHeight)
Picture1.Line -(Picture1.ScaleLeft, Picture1.ScaleTop)
end with 展开
Private Sub Picture1_Click()
With Picture1
.FillColor = vbRed
.FillStyle = 0
.ForeColor = vbBlue
Picture1.Line (Picture1.ScaleLeft, Picture1.ScaleTop)-(Picture1.ScaleLeft + Picture1.ScaleWidth, Picture1.ScaleTop + Picture1.ScaleHeight / 2)
Picture1.Line -(Picture1.ScaleLeft, Picture1.ScaleTop + Picture1.ScaleHeight)
Picture1.Line -(Picture1.ScaleLeft, Picture1.ScaleTop)
end with 展开
2个回答
展开全部
Private Declare Function ExtFloodFill Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long, ByVal wFillType As Long) As Long
Private Sub Picture1_Click()
With Picture1
.FillColor = vbRed
.FillStyle = 0
.ForeColor = vbBlue
Picture1.Line (Picture1.ScaleLeft, Picture1.ScaleTop)-(Picture1.ScaleLeft + Picture1.ScaleWidth, Picture1.ScaleTop + Picture1.ScaleHeight / 2)
Picture1.Line -(Picture1.ScaleLeft, Picture1.ScaleTop + Picture1.ScaleHeight)
Picture1.Line -(Picture1.ScaleLeft, Picture1.ScaleTop)
End With
Call ExtFloodFill(Picture1.hdc, Picture1.ScaleLeft + 1, Picture1.ScaleTop + 1, vbBlue, 0)
End Sub
Private Sub Picture1_Click()
With Picture1
.FillColor = vbRed
.FillStyle = 0
.ForeColor = vbBlue
Picture1.Line (Picture1.ScaleLeft, Picture1.ScaleTop)-(Picture1.ScaleLeft + Picture1.ScaleWidth, Picture1.ScaleTop + Picture1.ScaleHeight / 2)
Picture1.Line -(Picture1.ScaleLeft, Picture1.ScaleTop + Picture1.ScaleHeight)
Picture1.Line -(Picture1.ScaleLeft, Picture1.ScaleTop)
End With
Call ExtFloodFill(Picture1.hdc, Picture1.ScaleLeft + 1, Picture1.ScaleTop + 1, vbBlue, 0)
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询