Jump to content
Sign in to follow this  

Graphic Control problem

Recommended Posts


How can I draw in a graphic control a triangle with all angles of 60 degrees?

Edited by Andreik

When the words fail... music speaks

Share this post

Link to post
Share on other sites

You can use GDI drawing instead.

There is API function Polygon.

Look at MSDN for details.

SDL can do this too, but you want to use trigon instead of polygon (it's easier).

Click somewhere to exit.
#Include "SDL_sprig.au3"
#Include "SDL.au3"


$pSurface = _SDL_GuiCreate("Triangle demo", 600, 600, 32, $_SDL_SWSURFACE)

_SPG_PushAA(1)  ;Enable anti-aliasing ;)

_SPG_TrigonFilled($pSurface, 100, 500, 500, 500, 200, 400, 0xFFFFFF)

While 1
    $tRet = _SDL_PollEventEasy()
        Case $tRet = 0
        Case $tRet[0] = $_SDL_MOUSEBUTTONDOWN

ConsoleWrite("I am exiting now, bye!" & @CRLF)

(I seem to have forgot how to calculate the triangle position, but I am sure you can come up with something)

There is also trigon stuff in SDL_gfx and SDL_sge, take your pick.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this