Triangle class?

mattscotney

Member
Joined
Jul 9, 2003
Messages
13
Hi all,

I want to be able to draw a tringle the same way that you draw a rectangle.

I can draw a rectangle:
myGFX.drawRectangle(PEN, x, y, width, height)


I want to draw a triangle the same way:
myGFX.drawTriangle(PEN, x, y, width, height)


I can do it like this::
Dim triangle(3) As Point
triangle(0) = New Point(x, y - (height / 2))
triangle(1) = New Point(x - (width / 2), y + (height / 2))
triangle(2) = New Point(x + (width / 2), y + (height / 2))
triangle(3) = New Point(x, y - (height / 2))
myGFX.DrawPolygon(purplePEN, triangle)


How can I convert the above code so I can draw the triangle using myGFX.drawTriangle?
 
You cant, those are .net classes and methods; you cant add or take away from any class in .net (ie Graphics class). Just do it the way you are doing it.
 
Back
Top