Beiträge von UEZ
-
-
Habe auch mal was gebastelt:
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <Array.au3>
;~ Dim $aNames[10][2] = [["Anton", ""], ["Berta", 15]]
Dim $aNames[10] = ["Antonia", "Anton", "Cäsar", "Dora", "Emil", "Friedrich", "Gustav", "Heinrich", "Ida", "Julius"]Dim $aUnique[100000]
[/autoit] [autoit][/autoit] [autoit]
For $I = 0 To Ubound($aUnique) - 1
$r = Random(0, 9, 1)
$aUnique[$I] = $aNames[$r]
Next$ts = TimerInit()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$test = ArrayUnique($aUnique)
$te = TimerDiff($ts)
ConsoleWrite(Round($te, 2) & " ms." & @CRLF)
_ArrayDisplay($test)Dim $aNames[10][2] = [["Antonia", ""], ["Anton", ""], ["Cäsar", 300], ["Dora", 24], ["Emil", 33], ["Friedrich", 57], ["Gustav", 53], ["Heinrich", 34], ["Ida", 13], ["Julius", 77]]
[/autoit] [autoit][/autoit] [autoit]
Dim $aUnique[100000][2]
For $I = 0 To Ubound($aUnique) - 1
$r = Random(0, 9, 1)
$aUnique[$I][0] = $aNames[$r][0]
$aUnique[$I][1] = $aNames[$r][1]
Next$ts = TimerInit()
[/autoit] [autoit][/autoit] [autoit]
$test = ArrayUnique($aUnique)
$te = TimerDiff($ts)
ConsoleWrite(Round($te, 2) & " ms." & @CRLF)
_ArrayDisplay($test); #FUNCTION# =====================================================================================================================
[/autoit]
; Name.............: ArrayUnique
; Description ...: Returns the Unique Elements of a 1-dimensional or 2-dimensional array.
; Syntax...........: _ArrayUnique($aArray[, $iBase = 0, oBase = 0, $iCase = 0])
; Parameters ...: $aArray - The Array to use
; $iBase - [optional] Is the input Array 0-base or 1-base index. 0-base by default
; $oBase - [optional] Is the output Array 0-base or 1-base index. 0-base by default
; $iCase - [optional] Flag to indicate if the operations should be case sensitive.
; 0 = not case sensitive, using the user's locale (default)
; 1 = case sensitive
; 2 = not case sensitive, using a basic/faster comparison
; Return values: Success - Returns a 1-dimensional or 2-dimensional array containing only the unique elements of that Dimension
; Failure - Returns 0 and Sets @Error:
; 0 - No error.
; 1 - Returns 0 if parameter is not an array.
; 2 - Array has more than 2 dimensions
; 3 - Array is already unique
; 4 - when source array is selected as one base but UBound(array) - 1 <> array[0] / array[0][0]
; 5 - Scripting.Dictionary cannot be created for 1D array unique code
; Author .........: UEZ 2010 for 2D-array, Yashied for 1D-array (modified by UEZ)
; Version ........: 0.96 Build 2010-11-20 Beta
; ================================================================================================================================
Func ArrayUnique($aArray, $iBase = 0, $oBase = 0, $iCase = 0)
If Not IsArray($aArray) Then Return SetError(1, 0, 0) ;not an array
If UBound($aArray, 0) > 2 Then Return SetError(2, 0, 0) ;array is greater than a 2D array
If UBound($aArray) = $iBase + 1 Then Return SetError(3, 0, $aArray) ;array is already unique because of only 1 element
Local $dim = UBound($aArray, 2), $i
If $dim Then ;2D array
If $iBase And UBound($aArray) - 1 <> $aArray[0][0] Then Return SetError(4, 0, 0)
Local $oD = ObjCreate('Scripting.Dictionary')
If @error Then Return SetError(5, 0, 0)
Local $i, $j, $k = $oBase, $l, $s, $aTmp, $flag, $sSep = Chr(01)
Local $aUnique[UBound($aArray)][$dim]
If Not $oBase Then $flag = 2
For $i = $iBase To UBound($aArray) - 1
For $j = 0 To $dim - 1
$s &= $aArray[$i][$j] & $sSep
Next
If Not $oD.Exists($s) And StringLen($s) > 3 Then
$oD.Add($s, $i)
$aTmp = StringSplit(StringTrimRight($s, 1), $sSep, 2)
For $l = 0 To $dim - 1
$aUnique[$k][$l] = $aTmp[$l]
Next
$k += 1
EndIf
$s = ""
Next
$oD.RemoveAll
If $k > 0 Then
If $oBase Then $aUnique[0][0] = $k - 1
ReDim $aUnique[$k][$dim]
Else
ReDim $aUnique[1][$dim]
EndIf
Else ;1D array
If $iBase And UBound($aArray) - 1 <> $aArray[0] Then Return SetError(4, 0, 0)
Local $sData = '', $sSep = ChrW(160), $flag
For $i = $iBase To UBound($aArray) - 1
If Not IsDeclared($aArray[$i] & '$') Then
Assign($aArray[$i] & '$', 0, 1)
$sData &= $aArray[$i] & $sSep
EndIf
Next
If Not $oBase Then $flag = 2
Local $aUnique = StringSplit(StringTrimRight($sData, 1), $sSep, $flag)
EndIf
Return SetError(0, 0, $aUnique)
EndFunc ;==>ArrayUniqueSollte auch für 2D Arrays funzen!
Gruß,
UEZ -
Wer ist denn UZE?

Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <Array.au3>
Dim $aNames[10][2] = [["Anton", 33], ["Berta", 15], ["Cäsar", 300], ["Dora", 24], ["Emil", 33], ["Friedrich", 57], ["Gustav", 53], ["Heinrich", 34], ["Ida", 13], ["Julius", 77]]
Dim $aUnique[1000][2]
For $I = 0 To Ubound($aUnique) - 1
$r = Random(0, 9, 1)
$aUnique[$I][0] = $aNames[$r][0]
$aUnique[$I][1] = $aNames[$r][1]
Next
$test2 = _ArrayUnique3($aUnique)
_ArrayDisplay($test2)Func _ArrayUnique3(Const ByRef $aArray, $iDimension = 0, Const $iBase = 0, Const $iCase = 0, $vDelim = '|')
[/autoit]
If ($iDimension > 2) Or ($iDimension < 0) Then Return SetError(3, 0, -2)
If Not IsArray($aArray) Then Return SetError(1, 0, -1)
If ($vDelim = '|') Then $vDelim = Chr(01)
Local $iUboundDim = UBound($aArray)
Local $sHold
If Not UBound($aArray, 2) Then
For $I = $iBase To $iUboundDim - 1
If Not StringInStr($sHold, $aArray[$I], $iCase) Then $sHold &= $aArray[$I] & $vDelim
Next
Else
For $I = $iBase To $iUboundDim - 1
If Not StringInStr($sHold, $aArray[$I][$iDimension], $iCase) Then $sHold &= $aArray[$I][$iDimension] & $vDelim
Next
EndIf
If $sHold Then Return StringSplit(StringTrimRight($sHold, StringLen($vDelim)), $vDelim, 2)
Return SetError(2, 0, 0)
EndFuncIch bekomme nur ein 1D Array zurück!
Gruß,
UEZ -
2D Arrays scheinen auch nicht zu funzen:
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <Array.au3>
Dim $aNames[10][2] = [["Anton", 33], ["Berta", 15], ["Cäsar", 300], ["Dora", 24], ["Emil", 33], ["Friedrich", 57], ["Gustav", 53], ["Heinrich", 34], ["Ida", 13], ["Julius", 77]]
Dim $aUnique[1000][2]
For $I = 0 To Ubound($aUnique) - 1
$r = Random(0, 9, 1)
$aUnique[$I][0] = $aNames[$r][0]
$aUnique[$I][1] = $aNames[$r][1]
Next
_ArrayDisplay($aUnique, "Vorher")
Dim $T1 = 0, $T2 = 0
For $I = 1 To 20
$T = TimerInit()
$aTemp1 = ___ArrayUnique($aUnique, 1, 1)
$T1 += TimerDiff($T)
$T = TimerInit()
$aTemp2 = _ArrayUnique($aUnique, 1, 1)
$T2 += TimerDiff($T)
Next
_ArrayDisplay($aTemp1, Round($T1) & " ms")
_ArrayDisplay($aTemp2, Round($T2) & " ms")
Exit; #FUNCTION# ====================================================================================================================
[/autoit] [autoit][/autoit] [autoit]
; Name...........: _ArrayUnique
; Description ...: Returns the Unique Elements of a 1-dimensional array.
; Syntax.........: _ArrayUnique($aArray[, $iDimension = 1[, $iBase = 0[, $iCase = 0[, $vDelim = "|"]]]])
; Parameters ....: $aArray - The Array to use
; $iDimension - [optional] The Dimension of the Array to use
; $iBase - [optional] Is the Array 0-base or 1-base index. 0-base by default
; $iCase - [optional] Flag to indicate if the operations should be case sensitive.
; 0 = not case sensitive, using the user's locale (default)
; 1 = case sensitive
; 2 = not case sensitive, using a basic/faster comparison
; $vDelim - [optional] One or more characters to use as delimiters. However, cannot forsee its usefullness
; Return values .: Success - Returns a 1-dimensional array containing only the unique elements of that Dimension
; Failure - Returns 0 and Sets @Error:
; 0 - No error.
; 1 - Returns 0 if parameter is not an array.
; 2 - _ArrayUnique failed for some other reason
; 3 - Array dimension is invalid, should be an integer greater than 0
; Author ........: SmOke_N
; Modified.......: litlmike
; Remarks .......: Returns an array, the first element ($array[0]) contains the number of strings returned, the remaining elements ($array[1], $array[2], etc.) contain the unique strings.
; Related .......: _ArrayMax, _ArrayMin
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func ___ArrayUnique($aArray, $iDimension = 1, $iBase = 0, $iCase = 0, $vDelim = "|")
Local $iUboundDim
;$aArray used to be ByRef, but litlmike altered it to allow for the choosing of 1 Array Dimension, without altering the original array
If $vDelim = "|" Then $vDelim = Chr(01) ; by SmOke_N, modified by litlmike
If Not IsArray($aArray) Then Return SetError(1, 0, 0) ;Check to see if it is valid array;Checks that the given Dimension is Valid
[/autoit] [autoit][/autoit] [autoit]
If Not $iDimension > 0 Then
Return SetError(3, 0, 0) ;Check to see if it is valid array dimension, Should be greater than 0
Else
;If Dimension Exists, then get the number of "Rows"
$iUboundDim = UBound($aArray, 1) ;Get Number of "Rows"
If @error Then Return SetError(3, 0, 0) ;2 = Array dimension is invalid.
;Declare blank array, which will hold the dimension declared by user
Local $aArrayTmp[$iUboundDim]
;If $iDimension Exists, And the number of "Rows" is Valid:
If $iDimension > 1 Then ;Makes sure the Array dimension desired is more than 1-dimensional
For $i = 0 To $iUboundDim - 1 ;Loop through "Rows"
$aArrayTmp[$i] = $aArray[$i][$iDimension - 1] ;$iDimension-1 to match Dimension
Next
Else ;Makes sure the Array dimension desired is 1-dimensional
;If Dimension Exists, And the number of "Rows" is Valid, and the Dimension desired is not > 1, then:
;For the Case that the array is 1-Dimensional
If UBound($aArray, 0) = 1 Then ;Makes sure the Array is only 1-Dimensional
;~ For $i = 0 To $iUboundDim - 1
;~ $aArrayTmp[$i] = $aArray[$i]
;~ Next
$aArrayTmp = $aArray
Else ;For the Case that the array is 2-Dimensional
For $i = 0 To $iUboundDim - 1
$aArrayTmp[$i] = $aArray[$i][$iDimension - 1] ;$iDimension-1 to match Dimension
Next
EndIf
EndIf
EndIfLocal $sHold ;String that holds the Unique array info
[/autoit] [autoit][/autoit] [autoit]
For $iCC = $iBase To UBound($aArrayTmp) - 1 ;Loop Through array
;If Not the case that the element is already in $sHold, then add it
If Not StringInStr($vDelim & $sHold, $vDelim & $aArrayTmp[$iCC] & $vDelim, $iCase) Then _
$sHold &= $aArrayTmp[$iCC] & $vDelim
Next
If $sHold Then
$aArrayTmp = StringSplit(StringTrimRight($sHold, StringLen($vDelim)), $vDelim, 2 - $iBase) ;Split the string into an array
Return $aArrayTmp ;SmOke_N's version used to Return SetError(0, 0, 0)
EndIf
Return SetError(2, 0, 0) ;If the script gets this far, it has failed
EndFunc ;==>_ArrayUniqueFunc ____ArrayUnique(Const ByRef $aArray, $iDimension = 1, Const $iBase = 0, Const $iCase = 0, $vDelim = "|")
[/autoit]
If Not IsArray($aArray) Then Return SetError(1, 0, 0)
If Not $iDimension Then Return SetError(3, 0, 0)
If ($vDelim = '|') Then $vDelim = Chr(01)
Local $iUboundDim = UBound($aArray)
Local $sHold
If (UBound($aArray, 0) = 1) Then
For $I = $iBase To $iUboundDim - 1
If Not StringInStr($sHold, $aArray[$I], $iCase) Then $sHold &= $aArray[$I] & $vDelim
Next
Else
For $I = $iBase To $iUboundDim - 1
If Not StringInStr($sHold, $aArray[$I][$iDimension - 1], $iCase) Then $sHold &= $aArray[$I][$iDimension - 1] & $vDelim
Next
EndIf
If $sHold Then Return StringSplit(StringTrimRight($sHold, StringLen($vDelim)), $vDelim, 2)
Return SetError(2, 0, 0)
EndFunc ;==>___ArrayUniqueWenn ich Zeit finde, bastele ich an einer ArrayUnique Funktion.
Gruß,
UEZ -
Ich habe mir mal die _ArrayUnique() Funktion genauer angeschaut und es sieht nach einem Bug aus:
[autoit]
[/autoit]
...
If $sHold Then
$aArrayTmp = StringSplit(StringTrimRight($sHold, StringLen($vDelim)), $vDelim, 1) ;Split the string into an array
Return $aArrayTmp ;SmOke_N's version used to Return SetError(0, 0, 0)
EndIf
...Der Fehler liegt an dem StringSplit(), sollte so aussehen:
[autoit]
[/autoit]
$aArrayTmp = StringSplit(StringTrimRight($sHold, StringLen($vDelim)), $vDelim, 2 - $iBase) ;Split the string into an arrayDas Beispiel von oben:
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <Array.au3>Dim $aArray[10] = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5]
[/autoit] [autoit][/autoit] [autoit]
_ArrayDisplay($aArray, "$aArray")
$aNewArray = __ArrayUnique($aArray, 1, 0) ;Using Default Parameters
_ArrayDisplay($aNewArray, "$aNewArray represents the 1st Dimension of $aArray"); #FUNCTION# ====================================================================================================================
[/autoit] [autoit][/autoit] [autoit]
; Name...........: _ArrayUnique
; Description ...: Returns the Unique Elements of a 1-dimensional array.
; Syntax.........: _ArrayUnique($aArray[, $iDimension = 1[, $iBase = 0[, $iCase = 0[, $vDelim = "|"]]]])
; Parameters ....: $aArray - The Array to use
; $iDimension - [optional] The Dimension of the Array to use
; $iBase - [optional] Is the Array 0-base or 1-base index. 0-base by default
; $iCase - [optional] Flag to indicate if the operations should be case sensitive.
; 0 = not case sensitive, using the user's locale (default)
; 1 = case sensitive
; 2 = not case sensitive, using a basic/faster comparison
; $vDelim - [optional] One or more characters to use as delimiters. However, cannot forsee its usefullness
; Return values .: Success - Returns a 1-dimensional array containing only the unique elements of that Dimension
; Failure - Returns 0 and Sets @Error:
; 0 - No error.
; 1 - Returns 0 if parameter is not an array.
; 2 - _ArrayUnique failed for some other reason
; 3 - Array dimension is invalid, should be an integer greater than 0
; Author ........: SmOke_N
; Modified.......: litlmike
; Remarks .......: Returns an array, the first element ($array[0]) contains the number of strings returned, the remaining elements ($array[1], $array[2], etc.) contain the unique strings.
; Related .......: _ArrayMax, _ArrayMin
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func __ArrayUnique($aArray, $iDimension = 1, $iBase = 0, $iCase = 0, $vDelim = "|")
Local $iUboundDim
;$aArray used to be ByRef, but litlmike altered it to allow for the choosing of 1 Array Dimension, without altering the original array
If $vDelim = "|" Then $vDelim = Chr(01) ; by SmOke_N, modified by litlmike
If Not IsArray($aArray) Then Return SetError(1, 0, 0) ;Check to see if it is valid array;Checks that the given Dimension is Valid
[/autoit] [autoit][/autoit] [autoit]
If Not $iDimension > 0 Then
Return SetError(3, 0, 0) ;Check to see if it is valid array dimension, Should be greater than 0
Else
;If Dimension Exists, then get the number of "Rows"
$iUboundDim = UBound($aArray, 1) ;Get Number of "Rows"
If @error Then Return SetError(3, 0, 0) ;2 = Array dimension is invalid.;If $iDimension Exists, And the number of "Rows" is Valid:
[/autoit] [autoit][/autoit] [autoit]
If $iDimension > 1 Then ;Makes sure the Array dimension desired is more than 1-dimensional
Local $aArrayTmp[1] ;Declare blank array, which will hold the dimension declared by user
For $i = 0 To $iUboundDim - 1 ;Loop through "Rows"
_ArrayAdd($aArrayTmp, $aArray[$i][$iDimension - 1]) ;$iDimension-1 to match Dimension
Next
_ArrayDelete($aArrayTmp, 0) ;Get rid of 1st-element which is blank
Else ;Makes sure the Array dimension desired is 1-dimensional
;If Dimension Exists, And the number of "Rows" is Valid, and the Dimension desired is not > 1, then:
;For the Case that the array is 1-Dimensional
If UBound($aArray, 0) = 1 Then ;Makes sure the Array is only 1-Dimensional
Dim $aArrayTmp[1] ;Declare blank array, which will hold the dimension declared by user
For $i = 0 To $iUboundDim - 1
_ArrayAdd($aArrayTmp, $aArray[$i])
Next
_ArrayDelete($aArrayTmp, 0) ;Get rid of 1st-element which is blank
Else ;For the Case that the array is 2-Dimensional
Dim $aArrayTmp[1] ;Declare blank array, which will hold the dimension declared by user
For $i = 0 To $iUboundDim - 1
_ArrayAdd($aArrayTmp, $aArray[$i][$iDimension - 1]) ;$iDimension-1 to match Dimension
Next
_ArrayDelete($aArrayTmp, 0) ;Get rid of 1st-element which is blank
EndIf
EndIf
EndIfLocal $sHold ;String that holds the Unique array info
[/autoit]
For $iCC = $iBase To UBound($aArrayTmp) - 1 ;Loop Through array
;If Not the case that the element is already in $sHold, then add it
If Not StringInStr($vDelim & $sHold, $vDelim & $aArrayTmp[$iCC] & $vDelim, $iCase) Then _
$sHold &= $aArrayTmp[$iCC] & $vDelim
Next
If $sHold Then
$aArrayTmp = StringSplit(StringTrimRight($sHold, StringLen($vDelim)), $vDelim, 2 - $iBase) ;Split the string into an array
Return $aArrayTmp ;SmOke_N's version used to Return SetError(0, 0, 0)
EndIf
Return SetError(2, 0, 0) ;If the script gets this far, it has failed
EndFunc ;==>_ArrayUniqueGruß,
UEZ -
Hier ein Workaround:
[autoit]
[/autoit]
#include <Array.au3>
Dim $aArray[10] = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5]
_ArrayDisplay($aArray, "$aArray")
$aNewArray = _ArrayUnique($aArray) ;Using Default Parameters
_ArrayDelete($aNewArray, 0)
_ArrayDisplay($aNewArray, "$aNewArray represents the 1st Dimension of $aArray")Beispiel ist aus der Hilfe.
Gruß,
UEZ -
UEZ: So geht's
[autoit]
[/autoit]
#include <Array.au3>
$string = '14 124 AutoIt 4 283 Coding macht Spass 0815 Ende'
$array = StringRegExp($string, '([^\d+|\h]+?)(?:\h|\z)', 3)
_ArrayDisplay($array)Vielen Dank Oscar!

Ich dachte da eher an einen "Schalter" in RegEx, der das Ergebnis im Prinzip umkehrt. Anscheinend gibt es diesen "Schalter" nicht!
Gruß,
UEZ -
Nach meiner Meinung ist diese Frage irrelevant für AutoIt, da AutoIt der Flaschenhals ist! Ob man jetzt Direct2D, Direct3D, OpenGL, Irrlicht benutzt, ist teilweise eher geschmacksache, aber an der absoluten Geschwindigkeit wird sich nicht viel ändern.
Wer in die Programmierung von 2D/3D Grafiken einsteigen will, sollte lieber eine andere Programmiersprachen nehmen (wie Andy bereits sagte)!
Gruß,
UEZ -
Alizame: Dass es anders geht, ist ja klar, aber wie geht es mit RegEx ist hier die Frage oder?
Apropos Frage: kann man das Resultat umkehren (inventieren) für allgemeine reg. Ausdrücke?
Z.B:
14
124
AutoIt
4
283
Coding
macht
Spaß
0815Suche nach allen Zahlen mit RegEx und inventiere das Ergebnis, so dass man hier nur Wörter erhält!
Warum suchst du nicht gleich nach Wörtern, wäre vielleicht eine Antwort! Aber wenn ich nicht weiß, dass es Wörter sind, aber ich weiß, dass es Zahlen sind, wäre es einfach nach dem Rest zu suchen!
Gruß,
UEZ -
Das keiner drauf gekommen ist
[autoit]
[/autoit][autoit][/autoit][autoit]
#AutoIt3Wrapper_Run_Before=del /f /q "%scriptfile%_x64.exe"
#AutoIt3Wrapper_Run_Before=del /f /q "%scriptfile%_x86.exe"
#AutoIt3Wrapper_Run_Before=""%autoitdir%\aut2exe\aut2exe.exe" /in "%in%" /out "%scriptdir%\%scriptfile%_x64.exe" /nopack /x64"
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Run_After=ren "%out%" "%scriptfile%_x86.exe"If @OSArch = "X86" Then
[/autoit]
MsgBox(0, "CPU", "CPU is x86", 10)
Else
MsgBox(0, "CPU", "CPU is x64", 10)
EndIfGruß,
UEZ -
Vielleicht hilft dir ja dieser Link: [ offen ] CPU Auslastung
Gruß,
UEZ -
Suche doch mal nach Bass.dll und eukalyptus!
Die Wahrscheinlichkeit ist relativ groß was für dich zu finden.
Gruß,
UEZ -
Hilft dir das vielleicht weiter (ohne GDI+
)?Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstantsEx.au3>$iFile = FileOpenDialog("Bitte ein Bild selektieren", "", "Bild (*.jpg;*.png;*.bmp;*.gif)")
[/autoit] [autoit][/autoit] [autoit]
$iD = GetImageDim($iFile)
If @error Then Exit$iW = $iD[0]
[/autoit] [autoit][/autoit] [autoit]
$iH = $iD[1]$base_w = 150
[/autoit] [autoit][/autoit] [autoit]
$base_h = 150$hGUI_w = 320
[/autoit] [autoit][/autoit] [autoit]
$hGUI_h = 150
$button_w = 100
$hGUI = GUICreate("Bild Proportional Anzeiger von UEZ 2010", $hGUI_w, $hGUI_h) ;Titel klingt ja schreg
$button = GUICtrlCreateButton("Exit", $base_w + ($hGUI_w - $base_w - $button_w ) / 2, $hGUI_h / 2 - 12, $button_w)If $iW < $base_w And $iH < $base_h Then
[/autoit] [autoit][/autoit] [autoit]
$w = $base_w / 2 - $iW / 2
$h = $base_h / 2 - $iH / 2
GUICtrlCreatePic($iFile, $base_w / 2 - $iW / 2, $base_h / 2 - $iH / 2, $iW, $iH)
Else
If $iW > $iH Then
$f = $iW / $base_w
$w = $iW / $f
$h = $ih / $f
Else
$f = $iH / $base_h
$w = $iW / $f
$h = $ih / $f
EndIf
GUICtrlCreatePic($iFile, $base_w / 2 - $w / 2, $base_h / 2 - $h / 2, $w, $h)
EndIf$g = GUICtrlCreateGraphic(0, 0, $base_w, $base_h)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xc0c0ff, 0xc0c0ff)
GUICtrlSetGraphic(-1, $GUI_GR_RECT, 0, 0, $base_w, $base_h)GUISetState()
[/autoit] [autoit][/autoit] [autoit]Do
[/autoit] [autoit][/autoit] [autoit]
Switch GUIGetMsg()
Case -3, $button
GUIDelete($hGUI)
Exit
EndSwitch
Until FalseFunc GetImageDim($file) ;code by Melba23 - modified by UEZ
[/autoit]
Local $sFile = StringRegExp($file, "(?i).*\\(.*)", 3)
If Not IsArray($sFile) Or @error Then Return SetError(1, 0, 0)
Local $sPath = StringRegExp($file, "(?i)(.*)\\.+", 3)
If Not IsArray($sFile) Or @error Then Return SetError(1, 0, 0)
Local $sDimensions = ""
Local $oShellApp = ObjCreate("shell.application")
If IsObj($oShellApp) Then
Local $oDir = $oShellApp.NameSpace($sPath[0])
If IsObj($oDir) Then
Local $oFile = $oDir.Parsename($sFile[0])
If IsObj($oFile) Then
If @OSBuild > 6000 Then
$sDimensions = $oDir.GetDetailsOf($oFile, 31)
ElseIf @OSVersion = "WIN_XP" Then
$sDimensions = $oDir.GetDetailsOf($oFile, 26)
EndIf
EndIf
EndIf
EndIf
If $sDimensions = "" Then Return SetError(1, 0, 0) ;"Object creation failed"
Local $aDimensions = StringRegExp($sDimensions, "(?i)[\d]*x*[\d]", 3)
If Not IsArray($aDimensions) Then Return SetError(1, 0, 0) ;"Cannot get image resolution!"
Return SetError(0, 0, $aDimensions)
EndFuncEinige PNGs bzw. BMPs werden leider mit GUICtrlCreatePic() überhaupt nicht bzw. falsch angezeigt!
Da ich mich nicht so mit den Styles auskenne, kann es sein, dass man den Code mit Styles verkürzen kann...
Zitat
ich hab ein gui, bei dem des Picture Control 150x150 groß ist.. in diesem control soll ein bild (beispielsweiße 1500x3000) proportional angezeit (es wird also auf 150x300 runterskaliert..)Du meinst hier doch bestimmt 75x150 oder?
Gruß,
UEZ -
[autoit]
[/autoit]
For $i = 1 To 50
$f = StringFormat("%04d", $i)
ConsoleWrite($f & @CRLF)
NextGruß,
UEZ -
Steh grad aufm Schlauch
Was soll ich wie testen?Wenn du F7 drückst, werden doch die Befehle im unteren Fenster von SciTE ausgegeben. Dort kannst du auch die Fehler beim Erstellen der Exe sehen.
Gruß,
UEZ -
Hier eine schnell erstellte Variante:
[autoit]
[/autoit][autoit][/autoit][autoit]
#include <File.au3>Check1("Test1.txt", "Test1_new.log")
[/autoit][autoit][/autoit][autoit]Func Check1($file, $newlog)
[/autoit]
Local $aTxt, $i, $sNew
_FileReadToArray($file, $aTxt)
For $i = 1 To $aTxt[0]
If StringInStr($aTxt[$i], " Logging o") Then $sNew &= $aTxt[$i] & @CRLF
Next
Local $hFile = FileOpen($newlog, 2)
FileWrite($newlog, $sNew)
FileClose($hFile)
Return 1
EndFuncGruß,
UEZ -
Schaue dir mal den Beitrag im engl. Forum an: Natural Order String Comparison
Gruß,
UEZ -
Dann sieht es so aus, dass die Zeile
#AutoIt3Wrapper_Run_Before="%autoitdir%\aut2exe\aut2exe.exe" /in "%in%" /out "%scriptfile%_64bit.exe" /nopack /x64
nicht ausgeführt wird.Was sagt denn die Console von SciTE?
Gruß,
UEZ -
-
Ich habe auch den Code von Post #5 angepasst!
Da bewegt sich nur das Label und der Rest bleibt "stehen"!
Natürlich kann man auch "Child" GUIs nehmen, wie im Beispiel von Großvater und den Scrollbalken direkt darunter plazieren - ist anwendungsspezifisch!
Gruß,
UEZ