BugFix : ich habe mehrmals deinen Text durchgelesen, aber verstehe das Problem nicht ganz! Das Geklicke soll nur funktionieren, wenn ich auf die Checkbox klicke und nicht auf den Text?
Beiträge von UEZ
-
-
Sorry, was ich gepostet hatte, hat nichts mit deiner Frage zu tun.
Ich denke, dass dies nicht mit diesem Style ($BS_PUSHLIKE) funktioniert, die Hintergrund Farbe zu ändern.
-
Beispiel:
AutoIt
Alles anzeigen#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 324, 222, 192, 124) $Radio1 = GUICtrlCreateRadio("", 104, 72, 14, 17) ;~ DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Radio1), "wstr", 0, "wstr", 0) $Label = GUICtrlCreateLabel("Radio One", 121, 70, 100, 17) $hLabel = GUICtrlGetHandle($Label) GUICtrlSetFont(-1, 12, 400, 0, "Palatino Linotype") GUICtrlSetColor(-1, 0xFF0000) $Radio2 = GUICtrlCreateRadio("Radio Two", 104, 110, 113, 17) GUICtrlSetFont(-1, 12, 400, 0, "Palatino Linotype") GUICtrlSetColor(-1, 0xFF0000) GUISetState(@SW_SHOW) Global $hLabelWndProc = DllCallbackRegister("LabelWndProc", "long", "hwnd;uint;wparam;lparam") Global $hOldLabelProc = _WinAPI_SetWindowLong($hLabel, $GWL_WNDPROC, DllCallbackGetPtr($hLabelWndProc)) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _WinAPI_SetWindowLong($hLabel, $GWL_WNDPROC, $hOldLabelProc) DllCallbackFree($hLabelWndProc) GUIDelete() Exit EndSwitch WEnd Func LabelWndProc($hWnd, $iMsg, $wParam, $lParam) Switch $iMsg Case $WM_LBUTTONDOWN GUICtrlSetState($Radio1, $GUI_CHECKED) GUICtrlSetState($Radio2, $GUI_UNCHECKED) ControlFocus($Form1, "", $Label) EndSwitch Return _WinAPI_CallWindowProc($hOldLabelProc, $hWnd, $iMsg, $wParam, $lParam) EndFunc ;==>EditWndProc -
-
[OT]Original schafft auch nur 1 Umdrehung pro Tag[/OT]

Ich muss mal schauen, ob ich eine Map mit weniger Polygonen finde, damit schneller läuft oder gleich Andy's ASM Variante modifizieren und einbauen.
-
Das Problem vom Globus ist ja die Transparenz der Meere. Würdest du die Meere blau einfärben, könnte man zuerst die Länder der Globusrückseite zeichnen, dann die vorderen. Das vordere überdeckt das hintere Bild...
Jein, denn ich benutze ja Pfade (Pathes) und deren Punkte können gleichzeitig auf der vorderen bzw. hinteren Seite (Z-Achse) sein. Die Transparenz spielt hier keine Rolle.
Eukalyptus hatte das in seinem Beispiel mit der Schrift auf der Kugel anders gelöst. Vielleicht kann man diese Idee verwenden, um das Problem mit der Z-Achse zu lösen.
AutoIt
Alles anzeigen;by eukalyptus #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("MustDeclareVars", 1) Opt("GUIOnEventMode", 1) Global $iWidth = 400;@DesktopWidth Global $iHeight = 400;@DesktopHeight Global $fRX = 0.1 Global $fRY = 1.5 Global $fRZ = -0.3 Global Const $PI = ATan(1) * 4 Global Const $PI2 = $PI * 2 Global Const $Deg2Rad = $PI / 180 Global Const $Rad2Deg = 180 / $PI _GDIPlus_Startup() Global Const $ghGDIPDll = $__g_hGDIPDll Global $hGui = GUICreate("3D Test by Eukalyptus", $iWidth, $iHeight) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui) Global $hBmpBuffer = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics) Global $hGfxBuffer = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer) _GDIPlus_GraphicsSetSmoothingMode($hGfxBuffer, 2) _GDIPlus_GraphicsClear($hGfxBuffer, 0xFF000000) Global $hBmpScale = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics) Global $hGfxScale = _GDIPlus_ImageGetGraphicsContext($hBmpScale) _GDIPlus_GraphicsClear($hGfxScale, 0xFF000000) Global $fScale = 0.02 DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "hwnd", $hGfxScale, "int", 5) DllCall($ghGDIPDll, "uint", "GdipTranslateWorldTransform", "hwnd", $hGfxScale, "float", -($iWidth / 2 * $fScale), "float", -($iHeight / 2 * $fScale), "int", 0) DllCall($ghGDIPDll, "uint", "GdipScaleWorldTransform", "hwnd", $hGfxScale, "float", 1 + $fScale, "float", 1 + $fScale, "int", 0) Global $hPenBG = _GDIPlus_PenCreate(0xFF005500, 1) Global $hPenFG = _GDIPlus_PenCreate(0xFF00FF00, 2) DllCall($ghGDIPDll, "uint", "GdipSetPenLineJoin", "hwnd", $hPenFG, "int", 2) Global $hPenGL = _GDIPlus_PenCreate(0x2400AAFF, 1) Global $hBrush = _GDIPlus_BrushCreateSolid(0x30000000) GUIRegisterMsg($WM_PAINT, "WM_PAINT") GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND") GUISetState() GUICreate("Rotate", 200, 100, 0, 0, -1, -1, $hGui) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") Global $cSliderX = GUICtrlCreateSlider(10, 10, 180, 30) GUICtrlSetData(-1, 50 + ($fRX * 10)) GUICtrlSetOnEvent(-1, "_SetRotate") Global $cSliderY = GUICtrlCreateSlider(10, 40, 180, 30) GUICtrlSetData(-1, 50 + ($fRY * 10)) GUICtrlSetOnEvent(-1, "_SetRotate") Global $cSliderZ = GUICtrlCreateSlider(10, 70, 180, 30) GUICtrlSetData(-1, 50 + ($fRZ * 10)) GUICtrlSetOnEvent(-1, "_SetRotate") GUISetState() Global $aPnt = _CreateBall("GDI+ AutoIt Script|3D Text-Ball|by Eukalyptus", 0.65, 0.25, $iWidth, $iHeight, 0.7) While 1 _Draw() ;Sleep(10) WEnd Func _SetRotate() Switch @GUI_CtrlId Case $cSliderX $fRX = (50 - GUICtrlRead($cSliderX)) / 10 Case $cSliderY $fRY = (50 - GUICtrlRead($cSliderY)) / 10 Case $cSliderZ $fRZ = (50 - GUICtrlRead($cSliderZ)) / 10 EndSwitch EndFunc ;==>_SetRotate Func _Draw() Local $iW2 = $iWidth / 2 Local $iH2 = $iHeight / 2 Local Static $fA = 0, $fB = 0, $fC = 0 $fA += $fRX $fB += $fRY $fC += $fRZ If $fA >= 360 Then $fA -= 360 ElseIf $fA <= 0 Then $fA += 360 EndIf If $fB >= 360 Then $fB -= 360 ElseIf $fB <= 0 Then $fB += 360 EndIf If $fC >= 360 Then $fC -= 360 ElseIf $fC <= 0 Then $fC += 360 EndIf _Rotate($aPnt[0], $aPnt[3], $aPnt[4], $aPnt[1], $aPnt[2], $fA, $fB, $fC, $iW2, $iH2) Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreatePath2", "ptr", $aPnt[6], "ptr", $aPnt[7], "int", $aPnt[0], "int", 0, "int*", 0) Local $hPath = $aResult[5] $aResult = DllCall($ghGDIPDll, "uint", "GdipCreatePath", "int", 0, "int*", 0) Local $hPath_FG = $aResult[2] $aResult = DllCall($ghGDIPDll, "uint", "GdipCreatePath", "int", 0, "int*", 0) Local $hPath_BG = $aResult[2] $aResult = DllCall($ghGDIPDll, "uint", "GdipCreatePathIter", "int*", 0, "hwnd", $hPath) Local $hPathIter = $aResult[1] Local $aIter = $aPnt[8] For $i = 1 To $aIter[0][0] DllCall($ghGDIPDll, "uint", "GdipPathIterNextSubpathPath", "hwnd", $hPathIter, "int*", 0, "hwnd", $aIter[$i][1], "int*", 0) If DllStructGetData($aPnt[2], 1, ($aIter[$i][2]) + 1) > 10 Then DllCall($ghGDIPDll, "uint", "GdipAddPathPath", "hwnd", $hPath_BG, "hwnd", $aIter[$i][1], "int", 1) Else DllCall($ghGDIPDll, "uint", "GdipAddPathPath", "hwnd", $hPath_FG, "hwnd", $aIter[$i][1], "int", 1) EndIf Next DllCall($ghGDIPDll, "uint", "GdipDeletePathIter", "hwnd", $hPathIter) For $i = 1 To 3 _GDIPlus_GraphicsDrawImage($hGfxBuffer, $hBmpScale, 0, 0) _GDIPlus_GraphicsFillRect($hGfxBuffer, 0, 0, $iWidth, $iHeight, $hBrush) DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGfxBuffer, "hwnd", $hPenGL, "hwnd", $hPath) _GDIPlus_GraphicsDrawImage($hGfxScale, $hBmpBuffer, 0, 0) Next DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGfxBuffer, "hwnd", $hPenBG, "hwnd", $hPath_BG) DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGfxBuffer, "hwnd", $hPenFG, "hwnd", $hPath_FG) DllCall($ghGDIPDll, "uint", "GdipDeletePath", "hwnd", $hPath) DllCall($ghGDIPDll, "uint", "GdipDeletePath", "hwnd", $hPath_BG) DllCall($ghGDIPDll, "uint", "GdipDeletePath", "hwnd", $hPath_FG) _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0) EndFunc ;==>_Draw Func _Rotate($iCount, ByRef $tP_O, ByRef $tPZ_O, ByRef $tP_N, ByRef $tPZ_N, $fA, $fB, $fC, $iW2, $iH2) $fA *= $Deg2Rad $fB *= $Deg2Rad $fC *= $Deg2Rad Local $fX, $fY, $fZ, $fPX, $fPY, $fPZ For $i = 0 To $iCount - 1 $fPX = DllStructGetData($tP_O, 1, $i * 2 + 1) $fPY = DllStructGetData($tP_O, 1, $i * 2 + 2) $fPZ = DllStructGetData($tPZ_O, 1, $i + 1) $fY = $fPY * Cos($fA) - $fPZ * Sin($fA) $fZ = $fPY * Sin($fA) + $fPZ * Cos($fA) $fPY = $fY $fPZ = $fZ $fX = $fPX * Cos($fB) + $fPZ * Sin($fB) $fZ = -$fPX * Sin($fB) + $fPZ * Cos($fB) $fPX = $fX DllStructSetData($tP_N, 1, $fPX * Cos($fC) - $fPY * Sin($fC) + $iW2, $i * 2 + 1) DllStructSetData($tP_N, 1, $fPY * Cos($fC) + $fPX * Sin($fC) + $iH2, $i * 2 + 2) DllStructSetData($tPZ_N, 1, $fZ, $i + 1) Next EndFunc ;==>_Rotate Func _CreateBall($sText, $fScaleX, $fScaleY, $iW, $iH, $fBallSize, $sFont = "Arial", $fFlat = 5) Local $aSplit = StringSplit($sText, "|") Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreatePath", "int", 0, "int*", 0) Local $hPath = $aResult[2] Local $hFormat = _GDIPlus_StringFormatCreate() Local $hFamily = _GDIPlus_FontFamilyCreate($sFont) Local $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0) Local $tBounds = _GDIPlus_RectFCreate(0, 0, 0, 0) For $i = 1 To $aSplit[0] DllCall($ghGDIPDll, "uint", "GdipAddPathString", "hwnd", $hPath, "wstr", $aSplit[$i], "int", -1, "hwnd", $hFamily, "int", 0, "float", 50, "ptr", DllStructGetPtr($tLayout), "hwnd", $hFormat) DllCall($ghGDIPDll, "uint", "GdipGetPathWorldBounds", "hwnd", $hPath, "ptr", DllStructGetPtr($tBounds), "hwnd", 0, "hwnd", 0) DllStructSetData($tLayout, "Y", DllStructGetData($tBounds, "Y") + DllStructGetData($tBounds, "Height")) Next DllCall($ghGDIPDll, "uint", "GdipFlattenPath", "hwnd", $hPath, "hwnd", 0, "float", $fFlat) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) $aResult = DllCall($ghGDIPDll, "uint", "GdipGetPointCount", "hwnd", $hPath, "int*", 0) Local $iCount = $aResult[2] Local $tPathData = DllStructCreate("int;ptr;ptr") Local $tPoints = DllStructCreate("float[" & $iCount * 2 & "]") Local $tTypes = DllStructCreate("ubyte[" & $iCount & "]") Local $tPointsZ = DllStructCreate("float[" & $iCount & "]") DllStructSetData($tPathData, 1, $iCount) DllStructSetData($tPathData, 2, DllStructGetPtr($tPoints)) DllStructSetData($tPathData, 3, DllStructGetPtr($tTypes)) DllCall($ghGDIPDll, "uint", "GdipGetPathData", "hwnd", $hPath, "ptr", DllStructGetPtr($tPathData)) Local $fRad = $iH / 2 * $fBallSize If $iH > $iW Then $fRad = $iW / 2 * $fBallSize Local $fPIY = $PI * $fScaleY Local $fX, $fY, $fZ, $fA, $fB, $fPX, $fPY, $fPZ Local $fBX = (DllStructGetData($tBounds, "X") + DllStructGetData($tBounds, "Width")) / $fScaleX Local $fBY = (DllStructGetData($tBounds, "Y") + DllStructGetData($tBounds, "Height")) / $fScaleY For $i = 0 To $iCount - 1 $fX = DllStructGetData($tPoints, 1, $i * 2 + 1) $fY = DllStructGetData($tPoints, 1, $i * 2 + 2) $fB = $PI - $fX * $PI2 / $fBX $fA = $fPIY - $fY * $PI2 / $fBY $fPX = 0 $fPY = 0 $fPZ = $fRad $fY = $fPY * Cos($fA) - $fPZ * Sin($fA) $fZ = $fPY * Sin($fA) + $fPZ * Cos($fA) $fPY = $fY $fPZ = $fZ $fX = $fPX * Cos($fB) + $fPZ * Sin($fB) $fZ = -$fPX * Sin($fB) + $fPZ * Cos($fB) DllStructSetData($tPoints, 1, $fX, $i * 2 + 1) DllStructSetData($tPoints, 1, $fY, $i * 2 + 2) DllStructSetData($tPointsZ, 1, $fZ, $i + 1) Next Local $tPointsRotate = DllStructCreate("float[" & $iCount * 2 & "]") Local $tPointsZRotate = DllStructCreate("float[" & $iCount & "]") $aResult = DllCall($ghGDIPDll, "uint", "GdipCreatePathIter", "int*", 0, "hwnd", $hPath) Local $hPathIter = $aResult[1] $aResult = DllCall($ghGDIPDll, "uint", "GdipPathIterGetSubpathCount", "hwnd", $hPathIter, "int*", 0) Local $iSubCount = $aResult[2] Local $aIter[$iCount + 1][3] = [[$iSubCount]] For $i = 1 To $iSubCount $aResult = DllCall($ghGDIPDll, "uint", "GdipCreatePath", "int", 0, "int*", 0) $aIter[$i][1] = $aResult[2] $aResult = DllCall($ghGDIPDll, "uint", "GdipPathIterNextSubpath", "hwnd", $hPathIter, "int*", 0, "int*", 0, "int*", 0, "int*", 0) $aIter[$i][2] = $aResult[3] Next DllCall($ghGDIPDll, "uint", "GdipDeletePathIter", "hwnd", $hPathIter) DllCall($ghGDIPDll, "uint", "GdipDeletePath", "hwnd", $hPath) Local $aReturn[9] $aReturn[0] = $iCount $aReturn[1] = $tPointsRotate $aReturn[2] = $tPointsZRotate $aReturn[3] = $tPoints $aReturn[4] = $tPointsZ $aReturn[5] = $tTypes $aReturn[6] = DllStructGetPtr($tPointsRotate) $aReturn[7] = DllStructGetPtr($tTypes) $aReturn[8] = $aIter Return $aReturn EndFunc ;==>_CreateBall Func WM_PAINT($hWnd, $uMsgm, $wParam, $lParam) _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0) Return $GUI_RUNDEFMSG EndFunc ;==>WM_PAINT Func WM_ERASEBKGND($hWnd, $uMsgm, $wParam, $lParam) _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0) Return $GUI_RUNDEFMSG EndFunc ;==>WM_ERASEBKGND Func _Exit() Local $aIter = $aPnt[8] For $i = 1 To $aIter[0][0] DllCall($ghGDIPDll, "uint", "GdipDeletePath", "hwnd", $aIter[$i][1]) Next _GDIPlus_PenDispose($hPenBG) _GDIPlus_PenDispose($hPenFG) _GDIPlus_PenDispose($hPenGL) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGfxScale) _GDIPlus_BitmapDispose($hBmpScale) _GDIPlus_GraphicsDispose($hGfxBuffer) _GDIPlus_BitmapDispose($hBmpBuffer) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() Exit EndFunc ;==>_Exit -
Momentan sieht die Rotation richtig aus, ist aber im Grunde genommen eine optische Täuschung (beide Beispiele)!

Andy: das der drehende Globus langsam läuft, ist offensichtlich, wenn man sich Schleife anschaut. Keine Ahnung, wann ich das Problem mit der Z-Achse gelöst bekomme. Anschließend kann der ASM Boost anfahren, um die Darstellung richtig und schnell darzustellen. Ferner müssen wir uns überlegen, wie man verdeckte Bereiche eines Objekts nicht zeichnet (3D Objekte). Diese Beispiele sind ja "nur" flache Objekte.
Der Weg zu dem drehenden und brennenden 3D AutoIt Logo ist noch ein bissl weit weg (zumindest für mich)...
-
Seit dieser Zeit hat sich AutoIt verändert.
Probiere es mal mit diesem Source Code:
AutoIt
Alles anzeigen;code by UEZ 2009 #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Run_After=upx.exe --best --lzma "%out%" ;~ #AutoIt3Wrapper_Run_After=upx.exe --ultra-brute "%out%" #include <GUIConstantsEx.au3> #include <GDIplus.au3> #include <Memory.au3> #include <Misc.au3> #include <WindowsConstants.au3> #include "Bass.au3" ;thanks to BrettF, ProgAndy and eukalyptus Opt("GUIOnEventMode", 1) #Region load image files Global $dll = DllOpen("user32.dll") _GDIPlus_Startup() Global $bitmap_from_file $bitmap_from_file = _GDIPlus_BitmapCreateFromMemory(VU_Image()) ;thanks to AIMP2 player ;-) Global $bitmap_from_file2 $bitmap_from_file2 = _GDIPlus_BitmapCreateFromMemory(VU_Fragement_Image()) Global Const $iX = _GDIPlus_ImageGetWidth($bitmap_from_file) Global Const $iY = _GDIPlus_ImageGetHeight($bitmap_from_file) Global Const $width = $iX * 2 Global Const $height = $iY #EndRegion #Region initialize sound and load MP3 Global $levels, $LeftChLvl, $RightChLvl, $l_x2, $l_y2, $r_x2, $r_y2, $r, $current Global $ChLevel = 0x1000 Global $volume_error = 0 Global $ve Global $volume_boost_level = 2 Global $needle_decrease_speed = 0.0275 Global $no_load = 0 Global Const $bass_dll = _BASS_Startup(@ScriptDir & "\BASS.dll") If @error = -1 Then MsgBox(16, "ERROR!", "Could not load BASS.dll" & @CR & "Terminating... ") Exit EndIf Global $file = FileOpenDialog("Select MP3...", "", "MP3 Files (*.mp3)"); If @error Then $no_load = 1 MsgBox(16, "Error", "Could not load audio file!" & @CRLF & @CRLF & "At main screen you can press O to open file open dialog window" & @CRLF & "or you can drag'n'drop a mp3 file to window!", 20) EndIf Global $filename = StringMid($file, StringInStr($file, "\", 0, -1) + 1, StringLen($file) - StringInStr($file, "\", 0, -1) - 4) ;get the filename only Global $file_suffix _BASS_Init($BASS_DEVICE_CPSPEAKERS) Global $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0) Global $song_length = _BASS_ChannelGetLength($MusicHandle, $BASS_POS_BYTE) #EndRegion #Region GUI ;~ Global Const $WM_DROPFILES = 0x0233 Global $hwnd = GUICreate("", $width, $height, -1, -1, Default, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW, $WS_EX_ACCEPTFILES)) GUISetOnEvent($GUI_EVENT_CLOSE, "Close") GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "Move") ;move main window when lmb pressed and hold on main window GUISetState() #EndRegion #Region initialize GDI+ Global $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd) Global $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics) Global $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap) _GDIPlus_GraphicsSetSmoothingMode($backbuffer, 4) Global Const $pen_size = 2 Global $pen = _GDIPlus_PenCreate(0, $pen_size) Global $brush_l = _GDIPlus_BrushCreateSolid() Global $brush_r = _GDIPlus_BrushCreateSolid() _GDIPlus_GraphicsDrawImage($backbuffer, $bitmap_from_file, 0, 0) _GDIPlus_GraphicsDrawImage($backbuffer, $bitmap_from_file, $iX, 0) #EndRegion #Region constants Global Const $pi = 4 * ATan(1) Global Const $pi_div_180 = $pi / 180 Global Const $max_amplitude = 450 Global Const $min_x = 25 Global Const $max_x = 160 Global Const $pointer_ini_point_y = 80 ;less is longer Global Const $pointer_start_y = 93 Global Const $pointer_length = 65 Global Const $ellipse_size = 8 Global Const $ellipse_size_half = $ellipse_size / 2 Global Const $width_div_4 = $width / 4 Global Const $width_div_2 = $width / 2 Global Const $sleep = 30 #EndRegion #Region play audio _BASS_ChannelPlay($MusicHandle, 1) $volume = _BASS_GetVolume() If @error Or $volume = 1 Then ;check whether _BASS_GetVolume() returns 1 $volume_error = 1 $ve = "YES! Volume controlled peak disabled!" Else $ve = "NO!" EndIf #EndRegion #Region initialize title in window Dim $title[25] = ["º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`", _ " GDI+ Visualization: Analog Meter", _ " Playing: " & $filename, _ " Get volume error: " & $ve, _ " Press P to pause current song", _ " Press C to continue after P was pressed", _ " Press O to open another song", _ " Press ESC to exit program", _ " Credits:", _ " Main coding by: UEZ 2009", _ " Bass UDF: BrettF (modified by ProgAndy)", _ " Bass DLL: www.un4seen.com", _ " Image: AIMP Player", _ " And of course", _ " AutoIt developers ;-)", _ "•*´¯`*•.¸ .. ¥ .. ¸.•*´¯`*•*´¯`*•.¸ .. ¥ .. ¸.•*´¯`*•*´¯`*•.¸ .. ¥ .. ¸.•*´¯`*.¸ .. ¥ .. ¸.•*´¯", _ " Greetings to: ", _ " All members from", _ " www.autoitscript.com / www.autoit.de", _ " Richie for the good ideas to improve Analog Meter", _ " Christos", _ " and", _ " DrSchulz (http://www.drschulz-music.de/) ;-)", _ " ", _ " Restarting text..."] Global $c = 0 ;counter for sleep Global $i = 1 ;for character Global $j = 0 ;for array Global $k = UBound($title) - 1 Global $s = 150 ;sleep time Global $in = True Global $effect = Random(1, 2, 1) Global $g = 0x00 Global $b = 0x00 Global $pause = 0 #EndRegion #Region additional GUI functions GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES") ;enable drag'n'drop GUIRegisterMsg($WM_TIMER, "Draw") ;$WM_TIMER = 0x0113 DllCall("User32.dll", "int", "SetTimer", "hwnd", $hwnd, "int", 0, "int", $sleep, "int", 0) ;set GUIRegisterMsg($WM_TIMER, "Draw") timer #EndRegion Do Until False * Not Sleep(100000) ;do nothing, just sleep Func Draw() If WinGetState($hwnd) = 15 Then ;only activate keys when window is active If _IsPressed("50", $dll) Then ;P pressed (pause) _BASS_Pause() $pause = 1 ElseIf _IsPressed("43", $dll) Then ;C pressed (continue after pause) _BASS_Start() $pause = 0 ElseIf _IsPressed("4F", $dll) Then ;O pressed (open file dialoge) $file = FileOpenDialog("Select MP3...", "", "MP3 Files (*.mp3)") If Not @error Then $file_suffix = StringRight($file, 3) If StringLower($file_suffix) = "mp3" Then $filename = StringMid($file, StringInStr($file, "\", 0, -1) + 1, StringLen($file) - StringInStr($file, "\", 0, -1) - 4) ;get the filename only $title[2] = "Music: " & $filename _BASS_ChannelStop($MusicHandle) $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0) $song_length = _BASS_ChannelGetLength($MusicHandle, $BASS_POS_BYTE) _BASS_ChannelStop($MusicHandle) _BASS_ChannelPlay($MusicHandle, 1) EndIf EndIf EndIf EndIf $levels = _BASS_ChannelGetLevel($MusicHandle) ;get 16-bit level for l/r If $no_load Then $levels = 0x00000000 $l_w = BitShift($levels, 16) ;_WinAPI_HiWord($levels) ;get volume level from left (15-8 bit) $r_w = BitAND($levels, 0x0000FFFF) ;_WinAPI_LoWord($levels) ;get volume level from right (7-0 bit) If $l_w < 0 Then $l_w = ($l_w + 1) * - 1 ;invert value to positive value (a bug in bass.dll?) If $r_w < 0 Then $r_w = ($r_w + 1) * - 1 If $volume_error = 1 And $pause = 0 Then $volume = 0.33333 Else If $pause = 0 Then $volume = _BASS_GetVolume() * $volume_boost_level EndIf If $pause = 1 Then ;if pause then move needle to position 0 If $volume >= 0 Then $volume -= $needle_decrease_speed EndIf $LeftChLvl = 1 + Round($l_w * 135 / $ChLevel * $volume, 0) ; 135 = $max_x - $min_x $RightChLvl = 1 + Round($r_w * 135 / $ChLevel * $volume, 0) $l_x2 = $min_x + $max_x * ($LeftChLvl / $max_amplitude) ;set x/y coordinate of needle If $l_x2 >= $max_x Then $l_x2 = $max_x ;avoid exceeding right limit of needle If $l_x2 < $min_x Then $l_x2 = $min_x ;avoid exceeding left limit of needle $l_y2 = $pointer_ini_point_y - Sin($l_x2 * $pi_div_180) * $pointer_length ;calculate length of left needle (radius) depending and new x/y coordinate $r_x2 = $min_x + $max_x * ($RightChLvl / $max_amplitude) If $r_x2 >= $max_x Then $r_x2 = $max_x If $r_x2 < $min_x Then $r_x2 = $min_x $r_y2 = $pointer_ini_point_y - Sin($r_x2 * $pi_div_180) * $pointer_length _GDIPlus_PenSetColor($pen, 0xCF111111) _GDIPlus_GraphicsDrawLine($backbuffer, $width_div_4 - 1, $pointer_start_y, $l_x2, $l_y2, $pen) ;draw left needle _GDIPlus_GraphicsDrawLine($backbuffer, $width - $width_div_4 - 1, $pointer_start_y, $width_div_2 + $r_x2, $r_y2, $pen) ;draw right needle _GDIPlus_GraphicsDrawImageRect($backbuffer, $bitmap_from_file2, 68, 76, 53, 30) _GDIPlus_GraphicsDrawImageRect($backbuffer, $bitmap_from_file2, $iX + 68, 76, 53, 30) $r = $LeftChLvl * ($LeftChLvl / 0xFF) _GDIPlus_BrushSetSolidColor($brush_l, "0xFF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2)) _GDIPlus_GraphicsFillEllipse($backbuffer, $width_div_4 - $ellipse_size_half - 1, $pointer_start_y - $ellipse_size_half, $ellipse_size, $ellipse_size, $brush_l) $r = $RightChLvl * ($RightChLvl / 0xFF) _GDIPlus_BrushSetSolidColor($brush_r, "0xFF" & Hex($r, 2) & Hex($g, 2) & Hex($b, 2)) _GDIPlus_GraphicsFillEllipse($backbuffer, $width - $width_div_4 - $ellipse_size_half - 1, $pointer_start_y - $ellipse_size_half, $ellipse_size, $ellipse_size, $brush_r) _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, $width, $height) _GDIPlus_GraphicsDrawImage($backbuffer, $bitmap_from_file, 0, 0) ;clear screen by overwritting screen with bmp (left) _GDIPlus_GraphicsDrawImage($backbuffer, $bitmap_from_file, $iX, 0) ;clear screen by overwritting screen with bmp (right) $current = _BASS_ChannelGetPosition($MusicHandle, $BASS_POS_BYTE) ;get current song position If $current >= $song_length Then _BASS_ChannelPlay($MusicHandle, 1) ;replay song when it is finished Display_Info() ;display win title info EndFunc ;==>Draw Func Move() ;move whole window when pressed lmb and hold continuing drawing of window content DllCall("user32.dll", "int", "SendMessage", "hWnd", $hwnd, "int", 0x00A1, "int", 2, "int", 0) ;$WM_NCLBUTTONDOWN = 0x00A1 EndFunc ;==>Move Func WM_DROPFILES($hwnd, $msg, $wParam, $lParam) ;drag'n'drop function - I don't know who made this Local $tBuffer = DllStructCreate("char[256]") Local $iString ;Get dropped items count Local $aRet = DllCall("shell32.dll", "int", "DragQueryFile", "int", $wParam, "int", -1, "ptr", 0, "int", 0) ;Getting name only from 1st dropped item DllCall("shell32.dll", "int", "DragQueryFile", "int", $wParam, "int", 0, "ptr", DllStructGetPtr($tBuffer), "int", DllStructGetSize($tBuffer)) $iString = DllStructGetData($tBuffer, 1) DllCall("shell32.dll", "none", "DragFinish", "int", $wParam) $file = $iString $filename = StringMid($file, StringInStr($file, "\", 0, -1) + 1, StringLen($file) - StringInStr($file, "\", 0, -1) - 4) ;get the filename only $file_suffix = StringRight($file, 3) If StringLower($file_suffix) = "mp3" Then _BASS_ChannelStop($MusicHandle) $title[2] = "Music: " & $filename $MusicHandle = _BASS_StreamCreateFile(False, $file, 0, 0, 0) $song_length = _BASS_ChannelGetLength($MusicHandle, $BASS_POS_BYTE) _BASS_ChannelStop($MusicHandle) _BASS_ChannelPlay($MusicHandle, 1) EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_DROPFILES Func Display_Info() If $in Then If $i <> StringLen($title[$j]) + 1 Then If $effect = 1 Then WinSetTitle($hwnd, "", StringLeft($title[$j], $i)) ;effect 1a, 1 by 1 Else WinSetTitle($hwnd, "", StringRight($title[$j], $i)) ;effect 2a, scroll to right EndIf $i += 1 Else If $c = $s Then $i = 1 $in = False $c = 0 $effect = Random(1, 2, 1) Else $c += 1 EndIf EndIf Else If $i <> StringLen($title[$j]) + 1 Then If $effect = 1 Then WinSetTitle($hwnd, "", StringLeft($title[$j], StringLen($title[$j]) - $i)) ;effect 1b, 1 by 1 Else WinSetTitle($hwnd, "", StringRight($title[$j], StringLen($title[$j]) - $i)) ;effect 2b, scroll to left EndIf $i += 1 Else $i = 1 $in = True $effect = Random(1, 2, 1) If $j = $k Then $j = 0 Else $j += 1 EndIf EndIf EndIf EndFunc ;==>Display_Info Func Close() _BASS_Stop() _BASS_Free() DllClose(@ScriptDir & "\BASS.dll") GUIRegisterMsg($WM_DROPFILES, "") GUIRegisterMsg($WM_TIMER, "") DllClose($dll) _GDIPlus_PenDispose($pen) _GDIPlus_BrushDispose($brush_l) _GDIPlus_BrushDispose($brush_r) _GDIPlus_BitmapDispose($bitmap) _GDIPlus_GraphicsDispose($graphics) _GDIPlus_GraphicsDispose($backbuffer) _GDIPlus_Shutdown() GUIDelete($hwnd) Exit EndFunc ;==>Close Func VU_Image() Local $VU = '0x89504E470D0A1A0A0000000D49484452000000BE0000006B0803000000FE59C833000002A6504C5445000000FFFFFF282828707070B8B8B8484848D8D8D8F8F8F8808080A0A0A0181818E0E8E0F0F0' $VU &= 'E8E8F0E8C8D0D0E8F0F0F0F8F0D8E0D8809088586868909898E0E8E8F0F8F8607068707878B0B8B8F8F8F098A0A0D0D8D880888898A8A0D8E0E0C0C8C8C0C0C0687070C0C8C0C0C0B8E0E0D8788080B8' $VU &= 'C0C0D0D0D0585858787878888888D0D8D0B0B8B0F8F0F0606060909090A8B0B0A0A8A850605868686860686898A098808880708078A8B0A8485858889090A0A8A0F0F0F8989898707880788078788888' $VU &= '7078709898A0788880506860D0D0D8F8F0F8808890687878909890B8C0B8A0A098806040A08080D04838D0C8C888908890A098808078B84030D04038C03828C86050E0C0A0B8B8B0C8C8D0C03830C840' $VU &= '30C83830C04840505858B8C8C0C84038E08080889898D03830A08060888880B06058E8E0D8586860F0E8E8687068F8F0E8384840789088907068C8D0C8C83828986858C83028202020C83020D8D8D098' $VU &= '7870B0B0B8708080586060485050B0B0A8606860687870B06860C02020787070806060A87060404020787870806868A8A8A03838380404042C2C2C4C4C4CDCDCDCFCFCFC8484840C0C0CA4A4A4B4B4B4' $VU &= '1C1C1CF4F4F4F8FCF8C4C4C4FCFCF8D4D4D4CCCCCC7C7C7C8C8C8C545454F8FCFC6464645C5C5CFCF8F8FCF8FC6C6C6C9C9C9CF8F8FCFCE0E084807CBCC4C07C88848C7C7CB06458A4ACA87884809C6C' $VU &= '60D0D0CC808C88A47C7C8C94949C808098A09C90746CC44038D4D4D0807C7CA04C4074807C787C7CBC4838CCD0CCB8BCB8A46C58C8CCC8E4E8E0F0FCF8E4E8E4B0B4B0ACB4AC748080B05044BCC0BCC0' $VU &= 'C4C0F4F8F4808C8CAC5848DCE0DCB4B8B4E0E4E0909C98D0D4D0D4D8D4ECECEC080808F0F0F0E0E0E0C8C8C8303030BCBCBC343434747474ACACAC404040A8A8A8505050101010E8E8E8E4E4E4B0B0B0' $VU &= '3C24B1380000138849444154785ED4CE091180400C03C0F87797F4BBE3C70903A8E82A58BC7474849F726E773FCBD0B75FCB78B29FD80520CBDCAF861803D0E443ADB930B7719D67386F84D997A82060' $VU &= '652F69620196209902AC094004AAD0A201B156DA38159D984E2A516A493111CBDED354AEABA497B4EEC56D33196D860A964B8E02696123AD5BB95737BD5A7553A9357BA1EBB0D80DC71C3687FC27DD3D' $VU &= '806C6A466401096CC9678667170B70F6392FBFF3EDC10C9D1A0D1C380CA736F45F1FF8CE86A8E140521357BFFA81EFCCD70C1C488C5AE0173DFD927130FD8D52E040A75F6AA48FB6E31CC6DEB357FA22' $VU &= '14728E8450E748588908F8080121F6505F2E02431E1E663D1C518F3EF2A8D6D9059F4EEDB1EEA80A494844F040348CA4DE5EA71FD2118DC57B34C227FEDD22DADD0B807A88899EB0B977E9F7AD01A50D' $VU &= '6761CDC0421F9A4357750BDBA06532A422D11F40973310F8D0F7805A52585043AA8ADE4753780F9D6CD6735D0194AD55EFC02D07C67DF50D6CDD58C5D2D7C45007E0FD34533FA44EA66320F4BB524A2A' $VU &= 'E366E1F6C748E1284A08D1FE30542015CD887832FEBE3C84D394BF01BE7B0DB8F678ED6B6BA8DDE8DB517FF55800C31D181A028687D0042455DF3452D675BC87A0A320D7EF200B8FFCF7A5CA5D001871' $VU &= '10EDE9B47097D4F10FE755B329FFABD76BA5EB7DF4D46BD777D28781A1AFF0F8163AEAFABB87AF53922502FD230901E23D4CA49F489E182565ED3FF664774E9E9188152296BC4C20FCE14C6F320AB009' $VU &= '7D71C31D3C56ABFD6FFA7DC7D78F8BBBE9EFE84F50272801A114F3C998BAFD5DC089C6EB5E3C12118A68E8331FA54D13365861ACA08A421ECDF1956BC3D7BCE258D85DBF74E8C63030FFF26AE9DDE19D' $VU &= 'D3274DA88E0EB24267204D22DC93C6364894554AE76D156E9327BB4C0B0D0A39A4BBB74F7AB7F8176E78EAA543631CFCDEC19DF46120F8DF2EB0F9EEF5EB87941DF4E913C93DF9FD11E8603CA550A4C3' $VU &= '85C23DD5439B03B948432B11149010423969120D466227B5A7EAD77D5801B9A37EEDE543252070ECF8B1E1D28EFA40CD316080CA620D3BCBC32968A74E45EA45444BCD7CC4B76705EF41B845D1388B6A' $VU &= '114854247E60DB2C7B7FF0A38FF40220558064D689606736053CC4E215DF6FF7C79621871DED492190D3BAC04A850DBABA68DB3621314984F375531BB9BBEB8288E655E8044CF94A3D2A7D093DE924C9' $VU &= 'D050E1E1F73CF2FCFE2D9F55BB629A204174697992B0E9A1EB48F8B224984F80F223F13147EA5B9E3EC146E3C9D1A2457F3B6143282C37AEC73F12054432B6FBB6418EC6036DD958A75CB56942B821B5' $VU &= '90A387D437758487D2204DBFA0E5822694B1A7C10A6095F3BE3E818F21A20560EBE8D504BAC0BC1629AB000826A3C948249F74F66AC749CB22510F9E69D781D3110525302D1D915886202DA40A521570' $VU &= 'F2E1C6C76377D387A3C96BD11FAAB20BCE232964650400A943391100F746DFAE5A047B3BCBA46DA942B72052BDB2724CAABA45223712814EA2B7A0420D09E5E94CFFA9DC482C56D062FDA7F3F95C34E5' $VU &= 'C6D54041E61BCB43253ED4A180A00DD3247572645CBD579F6D4CDF632C291337CD323D0027206B2097024FC22D2800184AF7C7A2C1582C968FA61289703C1E5794DEDE703811CDE563B16477F019D771' $VU &= '4E2920F9F14F3C3BF15CD6A2C8DA242D1E15F00F68C036EAD3041249D5E9C8F9FEB42AB009F1C91448331A3B821022B154281D0D6ADAA772036941DC0F5528CF8C7E4A3BF1643E1D81F8E1336727CF9C' $VU &= '3BFF231B02A4CD4E15A4499F0AC0066D4A5FA4B23F7A8A08271DE866D52ED326311013C8C2D1126059F4F4C7F2195789C0476ADC7F3F4CA124F29A96FFE427A62626A62FCC7833C85A3A5CAD57CE8226' $VU &= 'A9FA7D1440B94DFA44E2D31A92792FE3005456099A20C4480A24735A3CA515728DCCEBC38E7FFABA917AF833E3E3E3335317272626CE5E3C37FBF5C88FE5A47DC53449FA7DD419D204DAA4AFB2B33FEA' $VU &= 'F41773DD0A74BB6C9BA64D12294D806AFEA33DB9B0DA48AB19480B80353EFEFB2FCE5C9C3B3B71616AF6C77FE20828A990F0FBA813CD6B026D4A9F88F73FAD16C7C22069B2EC8F1FAB44F21925373E7A' $VU &= 'D404CA680D822C0FBC7AFA0FFFE8E2F4D9B3D39333B33FC5B2CE3A2AE1913971B43DFA10AE8354FF610032A00A65F7815AF8692D2500130F46B5BA7AF3B527FEF8CCE4F4C4D9A999D99F0149DBAC10A1' $VU &= 'B49BEFF8D9F6741E42A41412AE83CE9C03B242593AA194968F13241E0276FDC99F9EFE337F15CC5D3877FEB3A00FC4899F2BA69C87D4679D0A850049942DE6345297F26AB49077F0F090D6DB7F7EFA2F' $VU &= '6626A7CF5E983A77DE2E93EC82F8DCE7BA2AF0301F589FA41C6D0296491F44623950273850C81F0688366093B5D86B7FF90DAF0D5DF09600988513E9FA8C83874A9F84C86404C8B269DB264DD324E1F8' $VU &= 'CFAAEA252DE8A07D50D7F5D74F3FFB8DE727262ECE9CCFE2E9EEF4FBB9930FA24FA2735CD39E4883B42C5AA6E51F88818288C4B430DA0D3B0BA77FE1F939AF82669F4BA6409D2024BBE97F7517FD4041' $VU &= '20DA110749D3F2C3B74D12D17ECD55B117FC55CF5FFFCDF4C4DCF499675966B5AE4FAAA4BE5BFA1BF7D3A74D284303508341153449D3362D9270C63501624FE0CADFFEFC0B73D35E0FCD8255D3040824' $VU &= '334901ABB5E2D121B47191EA4E9C8C8D8440DB96954F0B033DA9965A258956587DE4EFFEFEC2D90B93E7BE5EF66F4AEA0825C723B8F4CC11E84DA62FED0BB958B2F352F244410169D9F4ED11098E09E8' $VU &= '2D1895DE192CA115AA6BAFFDC3E485B9CBE73E0FFA37B5993C9C1418481655B4A0AF0C29C20B5AA443A054B76DC2D146D50A4DAB697FBEB9B47489065AE11F4F7F61F2F9B91766CE83FC266DD2AE300B' $VU &= 'E5291746B3FA34D5742892FFA5A80BD8A44E1FB88530C88A65A3490C717BD3B92D5AD387FECF43FFE2F94F9DB7A99BD411D714B5E7576291E6D3A76E9AB432BF9A14A12F5E828C9E88161C90AC12CD52' $VU &= '5A1E14627099688D7FFDB79E7F7F61EEF2D4AC6D67AB44FCB18CF36B79902D148FEA3A883EA58099A40BFAE462219036596D3A7CE796B3BAEAAC6C1A680DFEE7AB3F7979FAF9C9D9ACAD1348FCFAA7B5' $VU &= '93660BB56FAAA930784485AE23D19D4296EA5891205931D134A59545E1F1CEAD125A83E5FC6B9EFFE5C9D9CF96F99C4BA11064F3FA74D2042D929E7FF8A91C446194F56F8855340BBFB5EC080FE7AD2B' $VU &= '2DC66F92B95F7EF1F2DC0BBF316BE77ED32D1326C9E6FB3E6952A243B8914B3DB142942069A3798CDAA8227C36176F975AF3376DF2D68917A7E6E6667ECB2B6055A507764ABF761FFD063A39F2443CFF' $VU &= '6800244DA205F8C682B32971FEE01DA225E89138FDDB53675EFA9D23C8D29655D0D2A6017568E95FECE8CF116415AD60883B8AA72FF9D6E86A6BF1DB0079E9D5DF7DE9F7AAD469FBFE6821FDED58F028' $VU &= '93680D2E2FF9F61267E04DB65AFDE8FAE6958F3F53A66ED307BBEAB71BC3787B4571DE43B9D3F4B3CBB2D0802C83ACCF053BE87FF01E7D03BB0336AB5F5A59BA5237F7872BEE328D66F56D34A8EE94FA' $VU &= 'DEA7AFDCAA7B2FAE2CCA49DC7EBB597DC084846017EA34917EFB904D7349B9E2B1B8B2BCE29F28EE4AA9F5BB10FF3FFA7CE32D69AF2CBFB99A7115390FA54D77D97B7D63757450DABB999AE1DC5EF4CE' $VU &= '14F74ECD300E84BEC1E5BE45C563E9CEDB86FF6270707069616B900742DF30366F0FFAF683B73C6303B595A24730B87240F44B2B0B8B3ECB8DAD6669B5E653327020F4959525DF7EB0CF91D6F7D2CE59' $VU &= 'B4BFEFCBA6B93028F503C5E03DBCFEFAC848B0F816DB9AFE77ADB7579F6FDC1A6CE02EF479ACADC9211008DC2EDE743789F6E9AF79FAED4DDF58BDB920DD975C692FF1DC57EE146F29B5120DB453BFDD' $VU &= 'E91B1C58715D571A37B8BA75F5F6CDD137376B256F0D1BD8BFFAB269DEDC0A5CBDBAE5E31FD6D7B746FDD8595B5596B78A77560D633FEB9756E6D7EFB2B1B1BE5E1C75FFA944C360A6589C9FDF985FE3' $VU &= 'BED6BF321F9CDFD8D898F71ACDC64631A0D4287D0D2E8FCC7B048BFF61ECDBA56B18A59BAF78E2AF8C0537FC26E3C7FE5E3B9DF7DF098E8D960C639FA66F70F095316D2C381F5C91B11BDB67B6383236' $VU &= 'F6CAD8D8C81BDCB7FAA53B63C1EDB16FD72FDD1996AC97DAA7DFD7567DD46E66646F6FC8DFEB2FAE06D63C166A86B15F97AE54DFB1B4EA18D8AFE963D7FF9C37EA603FE9B7CEC1D037600077D3360E98' $VU &= 'BE0189D4971807465FAAD694BEE1C70FBDEC71E8F1E13EA5262FFFDFEA1BA55A8D0F225F5A1A3EFEA56F7FF9830DBEFCED2F1DBBE6961E6402945F321F40DF40EDCAC2FAD6924318ADC9AFFE0FE756B4' $VU &= '9CAA0E451B0C89F8DC1FC81BC5077CE099AFF223A88285320CA8A333FA4734092844217F7283B6A770CFB9BDED592A387BEFC9ACACBDB3639C41EE3C45F974F2DE713AA9A978B668C00F87C26D262BE2' $VU &= 'D3BF519FA6EE78B359877EFCA3277CB0DC2F34C5FDC6FE763B75E892B1AD6817F16DC4BEB036B3F1CCA43FA5AF683077255C578CC336F88168E85C2CEEDCEBA57D50C53F72F67A7D9FC862E1643FE95C' $VU &= '8D1C2B06E166E36310FC507D9A8C67B6BD77662B137F3FDBF052D41D3CDDB6D68AF9656B3BE7B565D7DECD5CE8F2FB8D02A3A93BDADBF66C55D29FFD685029A672B5BD6CB74B7B45E877E9C7E272D93F' $VU &= 'EDB7B53EB20E975ABBBEBCBDBD5DE7F565B43EE8F593725D9647FADD64C6C96AB7DC2AACC59F8B2E268BFFA00F024AB6A75AE16467F49BECA9B01D6B3CB67567BDAF4FDAF57ADA1F0EF669729D9FF4DD' $VU &= '5A99C7E3B563BBF91F98F41FD6FBD82BE26CE779B74C7614DF5FBD384007F48788D176A12AD6D30E2CFE865C41C77EEF8CA7D6E562ED54B1CF5F74C1681C53269F147FAF76ACE576BD1A1F9EDCFC7BFA' $VU &= 'E3C6D2BA55B4D0BBB5FBFFEA078332CEA5A71585B62479F02DED71B577A6B391EE5875A1D84FC68CD25881D276367FF5BC6269D9FA79361DED8DDFD2C97C9A6293509A99D8375384EF7AF0AD62B03819' $VU &= '79B7741B1FA828EA339435C0CFF0803E2B4D24A1292346A20C71151E53E8E8CB11A7F8361DC263D8CA469A304A7104E3DF562DB1157B5BB7EC42B1D726B3B6C9E91D4D7B7C55FA178573D69DD9D4D947' $VU &= 'C34E1200689023811C9A5102AB2811F71325A699B5D46D99E37B0C95CC4D8E5042112722EB174F208F50D06CC65925431395DDF01853C628C6F74419A2A9D80CBABCAA2066B21D663308D0C1DECC2EDB' $VU &= '753DEFB6A9898358F30B0C9D275D3B9D2FD797A7D9C676CC000C90B8C72A444026666CC8924777F79D418E6FEC73C335210B8F4722650628CC07EABBC7B26A1237415292368D62FC71C008EEFA64EE91' $VU &= '54CC758D44701A10180CE50BE8E66935D577A3422B14B44594B24FB4293CCD6F76CFDA2F67D3A771D32FFF001021A5292547426611E161692A639F41009228A92225AE2C230C7068B41DFDE2437D9EF9' $VU &= '4C121F96392F3306617B5FE41F00BC61256F13D34C4D00A82CF3BEFA2AA0DC9F2D7D64CFB562B15814AF76827CE4BF0321C40FAF3787A61D0EFAD47A92C346D82D119033809B1C505575AD1A7E70FA09' $VU &= '020A00A53856A04110E44D7C57FFF58B8DE4071BA465DB97F572A2DD50BC8E93B40733E59B7971F74D9EACE5C839B04E9D1FE1F778A5FE07FD28C349D4B028C13C0E383139565E96519E129E91848280' $VU &= 'F332C10043642698247858F972BF7CB28A8936BF61319F1233EBC1248F0BEDEED4AEF5FAB2DD8741BF78D2927342987AA3D2447E9A22546256129F93B4F33765C21100698609E50941CAC500A0BFE807' $VU &= '3E521643B491297320A06B6060CECCF298F26329239182401866C90197A282992958BF76036AD53B4BBBCEDF51CC57900F006785F6E19D14EBBD3E6AFAE5534A3FEA3A4AC488E0A812A1846E6A4A1855' $VU &= 'D2ECEA0755709A005C1938314A215126A3B2AF7E809BC8C4C710101EE581806685B198C15619248255B76BCBB0C94A40122138427050F940D62367727D9DBC2AA86BA15932213D2472AC151FEEF9757E' $VU &= '3E7812F4F813E9C34AF8823724EA9A4F65548F9257A12F09BAD137D47000B98F6960E41561A608D9A078046CA22A35AB889651023188202C194424C8222E1AAE3480308214E48240C9C22807BDCD4EE8' $VU &= 'D6F67A9D7CE05A68F611963D40C3D18AC967C075775E42F079904C18200D2F21411C26314C9128591931A406C97010048803BF22D24C212E6954A61CA181FA00DF3FF4D6AD06CFFD759DEBCE15BF5FB0' $VU &= '0A093E0B379E2EC7F5DBB5074DAB570246BF00ABA9AE69FD88B7E55A7F049F12BC1FEC3106EF8DF2C33858220A7D6AB46B9C77FAACEB9C7E0310F35BD098AC6D6966A6A8F1E9FF7503D3B6ADC5F3B58F' $VU &= '89A7EDA6B2AA6487EEBE71346F320879F6C6DB03FBE2F8759F448B529421C69A386D1105BE99372CE54C997D1074F40B49BB6956D3A31186110E8D48C67C631C1FB399EB0A1E31107C79B872F5F3EEE5' $VU &= 'F96580B745713A4C8508C51D9B9157146F6F839887D7D161293A79BF1227095DE91A86A8905B4559136EB898B91B28852131A0C47BA85D8AD5182D6A106369DCE48C05D467CCCFD5451963107CA10FDF' $VU &= '6DC7FAC3F3DB10CF2FF5C2B32D5709628486BBDED55A7DFD77D0C3F3657D19A12FFF97034DAB94677E9BB64DE3D3B84554D1F4D5F79BFA86FE503BE8AFF7ADD45A9E47AF0F7FC0B52E4E17FBBC9A4E57' $VU &= '67FBE22DEAC99FA2E6D66139F5C15F82B2D1E5A1D8594DFC4F2B75B0E2200C840178BAD968C95BECB173E9250F995457E9D18ABE532D4A24CC40DFA4B1746F6D6060BFF39F7F0602534AFDA6D73FA887' $VU &= '2EC27B1CC357889A4847770AD1C07B5577ACF673B9DD0BB16B333AF076B4DF452D34DF9B03D9AE6FE1933644B79C364E07864F78DC0F74BC9CE7A29652A3F200AC5435588994A6CAAEA8197278894F4B' $VU &= '3E660857AB69AB156E81E6F583889D00A6B8A205003CE4B1310C597EAB08B43E4B45B06FFFE6FB49C6C3BFF39314240FFB2BE73850E508D20000000049454E44AE426082' Return Binary($VU) EndFunc Func VU_Fragement_Image() Local $VU_Fragment = '0x89504E470D0A1A0A0000000D49484452000000350000001E0803000000BB53A6B7000000AE504C54450000003030302828281010104040404848485050507878786060606868683838381818182C2C' $VU_Fragment &= '2C343434202020080808A8A8A88888889090907070705858588080807474744C4C4C7C7C7C5C5C5C6C6C6CB8B8B8B0B0B0646464D8D8D8F0F0F0E0E0E0ACACACC0C0C08484840C0C0CA4A4A41C1C1C8C' $VU_Fragment &= '8C8C545454040404A0A0A0E8E8E8E4E4E4D4D4D4C4C4C4D0D0D0C8C8C8B4B4B49898989C9C9CBCBCBCDCDCDCF4F4F4CCCCCCECECEC909898AA04C38C0000000174524E530040E6D8660000025D494441' $VU_Fragment &= '54785EC5D2D772DB381480611EF4CEDE49F52E773BC9EEFBBF58204AB1A954E52ADF053183C37F301C30F8E716094F1B2FE5C9E2C624910A0CBA30A0C4F68F49D72B64C05A75612D18A444F4DBA636C8' $VU_Fragment &= '2743342CF644F97037FF6554803927A4148DFFB054D6949C7B63E4CF9B9601395154F0CA076C2764517141143901FAB32862ACCEEA1DA1296F1841781586217684A5554349E647AC7CFD311292E7B9A0' $VU_Fragment &= 'B2AA894518DBBA6984D5D859DA577E3BCF2B295EBE8F6A99C79C31DE13A5DC8A46B3E9E7CFD35997F94C11C9CB5DB5CC9BEC3A9BD7324E522A39011FE97C36F591CFA67789DB28052517B448E2B43E8C' $VU_Fragment &= 'A285F091A05C808F904EEE8EFF4DCF8E77AF1B6715802CA84C62593F7F548DD8266C5711A7AC052D27B3E3BBD9A4D0A7FB7065C5B2642BE47BB4CD9631ED5340E021F37C3FFB7077DF5A37EC2B5E9749' $VU_Fragment &= '9CE597E8AD2E384D8543608C818D78987C9A7CBA984C264FCD661820D43434E65977AEB810AC2A351AC0267FB81F79BC7FDA3A40039DF13295CDE5E72B330E1AB98171F1E2F1CBC8E3E27F83CE438449' $VU_Fragment &= 'C576F57A388AF41C6177016ED93E5D691340EE424355D3F4E88F22A9D478A3379E7F02E2DDC362E4A1CB117C1B3BEC8A46754144F90E63FD0D06245EDBB791F62011E87718F74519943909F108426419' $VU_Fragment &= 'B5CFEFDA794C11C223615905DCECF19856A88FBBF9BC1BF8752B91D2786CAF82D57E752534609B388AD6D1D936550061B81A0B827D786DBF224609FE7258AF0FEBC34BD51344F0F72F053FC2042C13C5' $VU_Fragment &= '328E978560CA101DDC02138B2CA18C51A28CF5D16D56962830278A5A1CDC0C0319000EFE0ED6FA97C957E7B64B82E69A2ACC0000000049454E44AE426082' Return Binary($VU_Fragment) EndFunc -
Hier eine kleine 3D Studie (Konzept) für
eine Text Rotation auf einer "Glaskugel",
eine Text Rotation um eine Kugel,
3D Object Rotation v1.1.7.jpgeine Globus Rotation.
3D Object Rotation v1.2.6.jpgDie Globus Rotation läuft quasi in "Echtzeit", momentan noch...

-
Schon mal hier reingeschaut?: https://www.autoitscript.com/forum/topic/18…ws-udf-version/
-
Ohh - das könnte doch ein altes GDI+ Script von mir sein
Bingo - sehr gut erkannt!

Apropos prozedurale Grafik - die 4KB prozedurale Grafik waren nicht schlecht. Sollten wir auch mal (mit)machen.

-
Mit dem Schnurrbart kann ich aushelfen - es gibt tatsächlich ein altes Bild von mir mit AutoIt-Shirt und Schnurrbart aus Mülltütenplastik:
Der Sultan aus Wien.
Apropos AutoIt T-Shirt: ist dir bei unseren T-Shirts was aufgefallen?Hier mit Dali Bart:
big_Capture01663_fun2.png -
Bei UEZ fehlt mir aber der Schnurrbart auf dem Bild
Das Avatar ist einfach zu prägend...Die Augenringe passen dafür...

-
Hier ein paar Gruppen Selfies von der Party
big_Capture01404.jpgbig_Capture01405.jpgbig_Capture01662.jpg
big_Capture01663.jpgbig_Capture01664.jpgbig_Capture01665.jpgMeine Meinung zu den Beiträgen: im Großen und Ganzen waren die Beiträge ok, aber zu viel "billige" Produktionen. Irgendwie fehlt der Nachwuchs oder die Ideen gehen aus. Die Highlights waren Fairlight und Cocoon. Eine ukrainische Invitation Demo fand ich auch noch sehr gelungen.
Abgesehen von den Beiträgen, ist natürlich das Live Erlebnis / Atmosphäre nicht zu toppen! Vor allem als Gruppe mit AutoIt T-Shirts zusammen auf der Party zu sein!



Wer ist wer?
Demo Link: http://www.pouet.net/party.php?which=1550&when=2016
-
Habe es noch nicht vollständig getestest:
AutoIt
Alles anzeigen#include <WinAPI.au3> #include <WinAPIGdi.au3> Local $sFile = "c:\Windows.old\windows\System32\wucltux.dll" Local $iIconIndex = -1 Local $iIcons = _WinAPI_ExtractIconEx($sFile, $iIconIndex, 0, 0, 0) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iIcons = ' & $iIcons & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console Local $tIcons = DllStructCreate("ptr hIcons[" & $iIcons & "]") Local $tDim = DllStructCreate($tagBITMAP), $hHBitmap Local $iExtIcons = _WinAPI_PrivateExtractIcons($sFile, $iIconIndex, $iIcons, 0, 0, $tIcons) For $i = 1 To $iIcons $hHBitmap = _WinAPI_Create32BitHBITMAP($tIcons.hIcons(($i)), 0) DllCall('gdi32.dll', 'int', 'GetObject', 'int', $hHBitmap, 'int', DllStructGetSize($tDim), 'ptr', DllStructGetPtr($tDim)) ConsoleWrite($tDim.bmWidth & " x " & $tDim.bmHeight & @CRLF) _WinAPI_DeleteObject($hHBitmap) _WinAPI_DestroyIcon($tIcons.hIcons(($i))) Next ; #FUNCTION# ==================================================================================================================== ; Name ..........: _WinAPI_PrivateExtractIcons ; Description ...: Creates an array of handles to icons that are extracted from a specified file. ; Syntax ........: _WinAPI_PrivateExtractIcons($sFile, $iIconIndex[, $iIcons = 1[, $iWidth = 0[, $iHeight = 0[, $tIcons = Null[, ; $tResourceIdent = Null[, $iFlags = $LR_LOADFROMFILE]]]]]]) ; Parameters ....: $sFile - The path and name of the file from which the icon(s) are to be extracted. ; $iIconIndex - The zero-based index of the first icon to extract. For example, if this value is zero, ; the function extracts the first icon in the specified file. ; $iIcons - [optional] The number of icons to extract from the file. This parameter is only valid ; when extracting from .exe and .dll files. ; $iWidth - [optional] The horizontal icon size wanted. See Remarks. ; $iHeight - [optional] The vertical icon size wanted. See Remarks. ; $tIcons - [optional] A pointer to the returned array of icon handles. ; $tResourceIdent - [optional] A pointer to a returned resource identifier for the icon that best fits the _ ; current display device. The returned identifier is 0xFFFFFFFF if the identifier ; is not available for this format. The returned identifier is 0 if the identifier ; cannot otherwise be obtained. ; $iFlags - [optional] Specifies flags that control this function. These flags are the LR_* flags used ; by the LoadImage function. ; Return values .: If the phicon parameter is NULL and this function succeeds, then the return value is the number of icons in the file. ; If the function fails then the return value is 0. ; If the phicon parameter is not NULL and the function succeeds, then the return value is the number of icons extracted. ; Otherwise, the return value is 0xFFFFFFFF if the file is not found. ; Author ........: UEZ ; Modified ......: ; Remarks .......: This function extracts from executable (.exe), DLL (.dll), icon (.ico), cursor (.cur), animated cursor (.ani), and bitmap (.bmp) ; files. Extractions from Windows 3.x 16-bit executables (.exe or .dll) are also supported. ; The $iWidth and $iHeight parameters specify the size of the icons to extract. Two sizes can be extracted by putting the first ; size in the LOWORD of the parameter and the second size in the HIWORD. ; For example, MAKELONG(24, 48) for both the $iWidth and $iHeight parameters would extract both 24 and 48 size icons. ; You must destroy all icons extracted by PrivateExtractIcons by calling the DestroyIcon function. ; This function was not included in the SDK headers and libraries until Windows XP Service Pack 1 (SP1) and Windows Server 2003. ; If you do not have a header file and import library for this function, you can call the function using LoadLibrary and ; GetProcAddress. ; Related .......: ; Link ..........: https://msdn.microsoft.com/en-us/library/windows/desktop/ms648075(v=vs.85).aspx ; Example .......: No ; =============================================================================================================================== Func _WinAPI_PrivateExtractIcons($sFile, $iIconIndex, $iIcons = 1, $iWidth = 0, $iHeight = 0, $tIcons = Null, $tResourceIdent = Null, $iFlags = $LR_LOADFROMFILE) Local $aResult = DllCall("user32.dll", "int", "PrivateExtractIcons", _ "str", $sFile, _ "int", $iIconIndex, _ "uint", $iWidth, _ "uint", $iHeight, _ "struct*", $tIcons, _ "struct*", $tResourceIdent, _ "uint", $iIcons, _ "uint", $iFlags) If @error Or $aResult[0] = 0xFFFFFFFF Then Return SetError(1, 0, $aResult[0]) Return $aResult[0] EndFuncEdit: ist nicht dass, was du willst. Eukalyptus' Version sollte es machen!


-
Hier eine Lösung für ICO Dateien (ich weiß, dass es direkt nicht mit deinem Problem zu tun hat, vielleicht hilft's für's Finden von Lösungen).
-
256 = 0x100
Wenn das Skript jeweils 2 Bytes für die Dimension speichert, dann kann das nur bis zu einer Größe von 0xFF x 0XFF (255 x 255) funktionieren. 256 hat 3 Bytes.
-
Wenn Fileread() etwa 90% der Zeit braucht, nützt es dir nichts bei den verbleibenden 10% in Beschleunigung zu investieren!
Ich meine mich erinnern zu können, dass das Lesen kein Ding war, eher das Suchen nach @LF. Aber mich wundern doch die 165ms ein wenig...
Das mit der Block Größe ist richtig
. So kann man den Ladevorgang doch erheblich beschleunigen. 
-
Es gibt auch die Built-in Funktion,
die ähnlich der AspirinJunkie's Version ist.Hier eine ASM Version:
AutoIt
Alles anzeigen#include <File.au3> $sTestFile = @ScriptDir & "\Test.csv" $fTimer = TimerInit() ConsoleWrite(_FileCountLines($sTestFile) & " / " & TimerDiff($fTimer) & @CRLF) $fTimer = TimerInit() $hFile = FileOpen($sTestFile) $iLines = _ASM_StringLFCharCount_Bin(FileRead($hFile)) FileClose($hFile) ConsoleWrite($iLines & " / " & TimerDiff($fTimer) & @CRLF) Func _ASM_StringLFCharCount_Bin($sString) Local $tCodeBuffer = DllStructCreate("byte ASM[27]") ;reserve memory for ASM opcode $tCodeBuffer.ASM = "0x8B7424048B7C240831DBAC3C0074093C0A75F783C301EBF2891FC3" ;write opcodes into memory (struct) / length: 27 Local $tResult = DllStructCreate("dword AmountLF") DllCall("user32.dll", "none", "CallWindowProcW", "ptr", DllStructGetPtr($tCodeBuffer), "str", $sString, "ptr", DllStructGetPtr($tResult), "int", 0, "int", 0) Return $tResult.AmountLF EndFuncBenötigt für eine 230 mb große CSV Datei ca. 7600 ms, um die Zeilen zu zählen. Built-in ca. 8500 ms. -> kein richtiger Gewinn. Ich frage mich, wie die GNU Variante auf 165 ms kommt!
-
Ich habe die Links überarbeitet - sollte jetzt wieder funktionieren.