请问用VB6如何绘制着色的三角形
请问用VB6如何绘制着色的三角形,已知三角形三个顶点坐标,绘制一个三角形,三角形内部填充指定颜色。多谢!
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