zeffy Posted January 8, 2011 Share Posted January 8, 2011 (edited) Hi, I'm trying to build an array to use with _GDIPlus_GraphicsDrawPolygon(), and I have all of the array values done, but I want a more elegant way of doing it, like shown here, but I don't really know how to do it right. This is what I have so far:Local $aPoints[11][2] $aPoints[0][0] = 10 $aPoints[1][0] = 0 $aPoints[1][1] = 11 $aPoints[2][0] = 5 $aPoints[2][1] = 16 $aPoints[3][0] = 5 $aPoints[3][1] = 13 $aPoints[4][0] = 14 $aPoints[4][1] = 13 $aPoints[5][0] = 14 $aPoints[5][1] = 5 $aPoints[6][0] = 10 $aPoints[6][1] = 5 $aPoints[7][0] = 10 $aPoints[7][1] = 9 $aPoints[8][0] = 5 $aPoints[8][1] = 9 $aPoints[9][0] = 5 $aPoints[9][1] = 6 $aPoints[10][0] = 0 $aPoints[10][1] = 11 _GDIPlus_GraphicsDrawPolygon ($hGraphic, $aPoints) Edited January 8, 2011 by zeffy Link to comment Share on other sites More sharing options...
shanet Posted January 8, 2011 Share Posted January 8, 2011 This looks like you do not understand what you are trying to do. You are declaring arrays on top of arrays. [font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS: %programfiles%/AutoIt3/autoit3.chm Link to comment Share on other sites More sharing options...
MvGulik Posted January 8, 2011 Share Posted January 8, 2011 (edited) You are declaring arrays on top of arrays.No, zeffy is not "declaring arrays on top of arrays". zeffy: When the data you need, or are using, gets bigger than what you care to maintain as a hard-coded array setup+fill. You should start looking at dropping that data into a external data file, and code you code to read and process that file as your array data input source. Alt: Local $aPoints[11][2] = [[10,''],[0,11],[5,16],[5,13],[14,13],[14,5],[10,5],[10,9],[5,9],[5,6],[0,11]] (done with Array_GetDefinition) Edited January 8, 2011 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
zeffy Posted January 8, 2011 Author Share Posted January 8, 2011 (edited) Thanks MvGulik! Edited January 8, 2011 by zeffy Link to comment Share on other sites More sharing options...
guinness Posted January 8, 2011 Share Posted January 8, 2011 And for the future in case you have a large array that spans the whole screen, try to use "_" underscore separator to move to the next line. You can see the use of this in some of the examples in my sig! Local $aPoints[11][2] = [[10, ''],[0, 11],[5, 16],[5, 13],[14, 13], _ [14, 5],[10, 5],[10, 9],[5, 9],[5, 6], _ [0, 11]] UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 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