|
>'====================================================================
>Function mk_triangle(ByVal x1 As Double, ByVal y1 As Double, _
> ByVal x2 As Double, ByVal y2 As Double, _
> ByVal x3 As Double, ByVal y3 As Double) As Shape
'作成する三角形の面積が小さい(境界は不明)とエラーになる場合もあります。
'その場合は、拡大して作成し、縮小すると言う手順をとらなければなりませんが。
> With Shapes.BuildFreeform(msoEditingAuto, x1, y1)
> .AddNodes msoSegmentLine, msoEditingAuto, x2, y2
> .AddNodes msoSegmentLine, msoEditingAuto, x3, y3
> .AddNodes msoSegmentLine, msoEditingAuto, x1, y1
> Set mk_triangle = .ConvertToShape
> With mk_triangle
> .Fill.Visible = msoTrue
> .Fill.Solid
> .Fill.ForeColor.SchemeColor = 2
> End With
> End With
>End Function
|
|