Andreik Posted November 12, 2009 Share Posted November 12, 2009 (edited) How can I draw in a graphic control a triangle with all angles of 60 degrees? Edited November 12, 2009 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Zedna Posted November 12, 2009 Share Posted November 12, 2009 You can use GDI drawing instead. There is API function Polygon. Look at MSDN for details. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted November 12, 2009 Share Posted November 12, 2009 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). #cs Click somewhere to exit. #ce #Include "SDL_sprig.au3" #Include "SDL.au3" _SDL_Init($_SDL_INIT_VIDEO) _SDL_Startup_sprig() $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) _SDL_Flip($pSurface) While 1 $tRet = _SDL_PollEventEasy() Select Case $tRet = 0 Sleep(10) Case $tRet[0] = $_SDL_MOUSEBUTTONDOWN ExitLoop EndSelect WEnd ConsoleWrite("I am exiting now, bye!" & @CRLF) _SDL_Quit() _SDL_Shutdown_sprig() (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. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now