JohnOne Posted March 25, 2014 Share Posted March 25, 2014 expandcollapse popup#include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ScreenCapture.au3> #include <Array.au3> HotKeySet("{END}", "_CapControl") Global $aLabels[16][2] For $i = 0 To 15 $aLabels[$i][1] = $i + 1 Next _ArrayShuffle2($aLabels, 0, 0, 1) Global $hwnd Example() Func Example() Local $msg Local $index = 0 $hwnd = GUICreate("", 336, 464) GUISetIcon(@AutoItExe, -2, $hwnd) GUICtrlCreatePic("", 0, 0, 338, 464, $BS_ICON) GUICtrlSetImage(-1, @ScriptDir & "\file.bmp") GUICtrlSetDefColor(0xFFFFFF) For $y = 0 To (464 - 116) Step 116 For $x = 0 To (336 - 84) Step 84 $aLabels[$index][0] = GUICtrlCreateLabel($aLabels[$index][1], $x, $y, 84, 116, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE) GUICtrlSetFont(-1, 15) GUICtrlSetBkColor(-1, 0x000000) $index += 1 Next Next GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $aLabels[0][0] GUICtrlDelete(Int($aLabels[0][0])) Case $aLabels[1][0] GUICtrlDelete(Int($aLabels[1][0])) Case $aLabels[2][0] GUICtrlDelete(Int($aLabels[2][0])) Case $aLabels[3][0] GUICtrlDelete(Int($aLabels[3][0])) Case $aLabels[4][0] GUICtrlDelete(Int($aLabels[4][0])) Case $aLabels[5][0] GUICtrlDelete(Int($aLabels[5][0])) Case $aLabels[6][0] GUICtrlDelete(Int($aLabels[6][0])) Case $aLabels[7][0] GUICtrlDelete(Int($aLabels[7][0])) Case $aLabels[8][0] GUICtrlDelete(Int($aLabels[8][0])) Case $aLabels[9][0] GUICtrlDelete(Int($aLabels[9][0])) Case $aLabels[10][0] GUICtrlDelete(Int($aLabels[10][0])) Case $aLabels[11][0] GUICtrlDelete(Int($aLabels[11][0])) Case $aLabels[12][0] GUICtrlDelete(Int($aLabels[12][0])) Case $aLabels[13][0] GUICtrlDelete(Int($aLabels[13][0])) Case $aLabels[14][0] GUICtrlDelete(Int($aLabels[14][0])) Case $aLabels[15][0] GUICtrlDelete(Int($aLabels[15][0])) EndSwitch WEnd EndFunc ;==>Example Func _ArrayShuffle2(ByRef $avArray, $iStart_Row = 0, $iEnd_Row = 0, $iCol = 0) ; http://www.autoitscript.com/forum/topic/159789-execute-items-in-for-next-loop-in-random-order/#entry1159625 ; Fisher–Yates algorithm If $iStart_Row = Default Then $iStart_Row = 0 If $iEnd_Row = Default Then $iEnd_Row = 0 If $iCol = Default Then $iCol = 0 If Not IsArray($avArray) Then Return SetError(1, 0, -1) Local $iDim_1 = UBound($avArray, $UBOUND_ROWS) If $iEnd_Row = 0 Then $iEnd_Row = $iDim_1 - 1 If $iStart_Row < 0 Or $iStart_Row > $iDim_1 - 1 Then Return SetError(3, 0, -1) If $iEnd_Row < 1 Or $iEnd_Row > $iDim_1 - 1 Then Return SetError(3, 0, -1) If $iStart_Row > $iEnd_Row Then Return SetError(4, 0, -1) Local $vTmp, $iRand Switch UBound($avArray, $UBOUND_DIMENSIONS) Case 1 For $i = $iEnd_Row To $iStart_Row + 1 Step -1 $iRand = Random($iStart_Row, $i, 1) $vTmp = $avArray[$i] $avArray[$i] = $avArray[$iRand] $avArray[$iRand] = $vTmp Next Return 1 Case 2 Local $iDim_2 = UBound($avArray, $UBOUND_COLUMNS) If $iCol < 0 Or $iCol > $iDim_2 - 1 Then Return SetError(5, 0, -1) Local $iCol_Start, $iCol_End If $iCol Then $iCol_Start = $iCol $iCol_End = $iCol Else $iCol_Start = 0 $iCol_End = $iDim_2 - 1 EndIf For $i = $iEnd_Row To $iStart_Row + 1 Step -1 $iRand = Random($iStart_Row, $i, 1) For $j = $iCol_Start To $iCol_End $vTmp = $avArray[$i][$j] $avArray[$i][$j] = $avArray[$iRand][$j] $avArray[$iRand][$j] = $vTmp Next Next Return 1 Case Else Return SetError(2, 0, -1) EndSwitch EndFunc ;==>_ArrayShuffle2 Func _CapControl() _ScreenCapture_CaptureWnd(@ScriptDir & "\test.bmp", $hwnd) EndFunc ;==>_CapControl AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
wakillon Posted March 25, 2014 Author Share Posted March 25, 2014 Where do you define/declare  $UBOUND_ROWS, $UBOUND_DIMENSIONS and $UBOUND_COLUMNS ? AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
JohnOne Posted March 25, 2014 Share Posted March 25, 2014 It's in Array.au3 I think. Sorry ran with latest beta you see, had to when found M23' Shuffle code. AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
wakillon Posted March 25, 2014 Author Share Posted March 25, 2014 It's in Array.au3 I think. Sorry ran with latest beta you see, had to when found M23' Shuffle code.  i have tried v3.3.11.3 (Beta) too, but without success. AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
JohnOne Posted March 25, 2014 Share Posted March 25, 2014 I just press Alt and F5 and it runs, that's why I thought it was in Array.au3.But I remove #include <Array.au3> and it still works. AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
wakillon Posted March 25, 2014 Author Share Posted March 25, 2014 i have set them to 2 and it works. AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
wakillon Posted March 25, 2014 Author Share Posted March 25, 2014 I just press Alt and F5 and it runs, that's why I thought it was in Array.au3. But I remove #include <Array.au3> and it still works.  Ok it's good too, but you should take in count ratio dimension of the picture for avoid distortion. AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
JohnOne Posted March 25, 2014 Share Posted March 25, 2014 It's bad lol AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
JohnOne Posted March 25, 2014 Share Posted March 25, 2014 Yeah, I just added pics of a specific size while testing.Was just a quick project I had a bit of time AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
wakillon Posted March 25, 2014 Author Share Posted March 25, 2014 It's bad lol  Not at all, it's an other way. I saw you hide the picture with black labels, it's more simple than my method and it works ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
JohnOne Posted March 25, 2014 Share Posted March 25, 2014 Thanks, the hard part was stealing M23' shuffle code Shhhhh, don't tell him. AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 25, 2014 Moderators Share Posted March 25, 2014 JohnOne,Be my guest - it will be in the next release anyway. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
wakillon Posted March 25, 2014 Author Share Posted March 25, 2014 Thanks, the hard part was stealing M23' shuffle code Shhhhh, don't tell him.  Why use a random array for the Labels ? AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
deniali Posted March 26, 2014 Share Posted March 26, 2014 (edited) Can you edit the image quality as original after split image ?  Thanks And split multi file? Edited March 26, 2014 by deniali Link to comment Share on other sites More sharing options...
wakillon Posted March 26, 2014 Author Share Posted March 26, 2014 Can you edit the image quality as original after split image ?  Thanks And split multi file?  It's a good idea ! I will add this features AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
wakillon Posted March 26, 2014 Author Share Posted March 26, 2014 (edited) @deniali Firstly, Welcome to the AutoIt Forums ! and secondly, as you had suggested me, script is Updated with DPI Resolution preserved and Multi files Split allowed !  Edited March 26, 2014 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
JohnOne Posted March 27, 2014 Share Posted March 27, 2014 Why use a random array for the Labels ? If using as a game, the squares can be revealed in order (1 - 16) without being left -> right, top -> bottom. AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Gianni Posted March 30, 2014 Share Posted March 30, 2014 (edited) Hey, nice software wakillon, thanks to share. one question please, how do you transform pictures in that data contained in the $sFileBin variable? (the hidden Bill Clinton from post >#16 for example ) thanks Edited March 30, 2014 by PincoPanco  Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
wakillon Posted March 30, 2014 Author Share Posted March 30, 2014 Hey, nice software wakillon, thanks to share. one question please, how do you transform pictures in that data contained in the $sFileBin variable? (the hidden Bill Clinton from post >#16 for example ) thanks  A winner for my little game ! I use BinaryToAu3Kompressor for "compress" picture and include it in the script. See link in my signature. Thanks AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Gianni Posted March 30, 2014 Share Posted March 30, 2014 great, I win! Ok, I was able to find the link of "BinaryToAu3Kompressor" in the middle of your signature .... Thanks again  Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... 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