AutoIt
#include <GUIConstantsEx.au3> #include <GDIPlus.au3> _Main() Func _Main() Local $hGUI, $hGraphic, $aPoints[8][2] ; Create GUI $hGUI = GUICreate("GDI+", 400, 300) ; Draw a cardinal spline _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $aPoints=_ArrayPoints(10,10,0,0.0001) _GDIPlus_GraphicsDrawCurve($hGraphic, $aPoints) GUISetState() ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Clean up resources _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>_Main ;Local $x=_ArrayPoints(10,10,0) Func _ArrayPoints($sHeight,$iX,$iY,$__Add,$sStep=1) Local $sArray[Number(10^(StringLen(StringMid($__Add,StringInStr($__Add,'.',2)+1))+1))+2][2],$__X=$iX,$__Y=$iY $sArray[0][0]=0 If $iY>$sHeight Then $sStep=-1 Else $sStep=1 EndIf While 1 If $iY>=$sHeight+$__Add Then ExitLoop ConsoleWrite('Y:'&$iY) ConsoleWrite(' X:'&$iX&@CRLF) $sArray[0][0]+=1 $sArray[$sArray[0][0]][0]=$iX If $iY< $sHeight/2 Then $iX=Round($iX+$__Add,Number(StringLen(StringMid($__Add,StringInStr($__Add,'.',2)+1)))) Else $iX=Round($iX-$__Add,Number(StringLen(StringMid($__Add,StringInStr($__Add,'.',2)+1)))) EndIf $sArray[$sArray[0][0]][1]=$iY $iY=Round($iY+$__Add,Number(StringLen(StringMid($__Add,StringInStr($__Add,'.',2)+1)))) WEnd ConsoleWrite('Total Array:'&$sArray[0][0]&@CRLF) Return $sArray EndFunc
Basically i want to make a Figure like
..____
( ____)
to make the curve structure very smooth i made a Function which can make a Array of very fine X Y coordinates using Float numbers
But nothing is showing in the GUI
.................................................................. ___ ........................... ____
When i tried with Integers i got a Figure <___> rather than this ( ____) therefore i was forced to use Floats
Edited by PhoenixXL, 15 June 2012 - 06:39 AM.





