_parseCSV.au3 klingt doch ganz gut.
Beiträge von UEZ
-
-
Sehr gut!

In beiden _Array2* Beispielen fehlt ein #include "_parseCSV.au3" und FileWrite ohne das Drumherum ist nicht Optimum, da immer in die bestehende Datei angehängt wird und Unicode ist aus nicht, zumindest auf meiner Kiste.

-
Das Ergebnis sieht dann bei mir so aus:

Dies ist aber sicher nicht das gewünschte Ergebnis...
Was bewirken bei (($i)) die doppelten Klammern?
Sorry, aber
Zitat
Danach werden die Pixel je nach Algorithmus durch andere ersetzt und dafür bräuchte ich eine Möglichkeit wie man jetzt auf einfachem Wege das Struct nochmals als gleicher Typ der Variable $tBitmapData neu zuweist. ImageSaveToStream bekomm ich nicht zum Laufen, zeigt alles schwarz andas verstehe ich nicht ganz. Ein simples Beispiel würde Licht ins Dunkele bringen., wie z.B. ich lade ein Bild, um es in Graustufen umzuwandeln.
Die Doppelklammern sind nötig, damit das Array in der Struct (Bitmap) angesprochen werden kann.
Beispiel:
$tPixelData.Scan0(($i)) = Mod($i, 256) == DllStructSetData($tPixelData, 1, Mod($i, 256), $i)
Hier ist die Struct als Byte deklariert, damit man die Farbkanäle direkt als rot, grün blau und alpha ansprechen kann.
-
Hier eine GDI+ Variante:
AutoIt
Alles anzeigen#include <GDIPlus.au3> FileDelete(@ScriptDir & "\Test.png") _GDIPlus_Startup() Local $iW = 128, $iH = 128 Local $tPixelData = DllStructCreate("byte scan0[" & $iW * $iH * 4 & "];") ConsoleWrite(DllStructGetSize($tPixelData) & @CRLF) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH, $GDIP_PXF32ARGB, $iW * 4, $tPixelData) For $i = 1 to $iW * $iH * 4 Switch Mod($i, 4) Case 0 $tPixelData.Scan0(($i)) = 0xFF ;alpha channel Case 1 $tPixelData.Scan0(($i)) = Mod($i, 256) ;blue Case 2 $tPixelData.Scan0(($i)) = Mod($i * 2, 256) ;green Case 3 $tPixelData.Scan0(($i)) = Mod($i / 2, 256) ;red EndSwitch Next _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\Test.png") _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_Shutdown() ShellExecute(@ScriptDir & "\Test.png") -
Prima, danke!
-
Wenn du möchtest kann ich aber fix ne W7 Installation aufsetzen, sollte nich allzu lange dauern.
Wir haben gleich Mitternacht. Vielleicht ist jemand gnädig und kann mal mit Win7 schnell testen, dann kannst du zeitig schlafen gehen.
Die Installation raubt mindestens 30 Minuten...
-
Die sind beide gepackt. Die 4k Version mit UPX, die 2K Version mit Crinkler. Hast du unter Win7 getestet?
-
Ich habe es endlich verstanden, wie ich in FreeBasic Crinkler benutzen kann.
Das Resultat: 2.05 KB!
Kann jemand bitte testen, ob die Exe Dateien zu starten sind? Ab Windows 7 wäre es für mich interessant.
Ich musste leider bei Ole32.dll Funktion CLSIDFromString(Wstr("{633C80A4-1843-482b-9EF2-BE2834C5FDD4}"), @tGUID) für die Blur Funktion tricksen, da sonst Crinkler immer mir eine Fehlermeldung bringt.
Zitat: warning LNK: Import 'CLSIDFromString' from 'ole32' uses forwarded RVA. Replaced by 'CLSIDFromString' from 'api-ms-win-core-com-l1-1-0'
: error LNK: Cannot find DLL 'API-MS-WIN-CORE-COM-L1-1-0.DLL'
Immer diese Olle...

-
Geschaftt - 4096 Bytes!

-
Hmm, habe leider nur die Exe auf 5120 Bytes komprimieren können.

Keine Ahnung, wie ich Crinkler mit FB nutzen kann...

Wer es mal probieren will, im Archiv nur die FB x64 Version, da GDI+ v1.1 nur in der x64 existiert.
-
Nachdem ich das Beispiel hier von Bradley Taunt gesehen hatte, das mit CSS realisiert wurde, dachte ich mir, ob das irgendwie auch mit Windows Bordmitteln zu realisieren ist.
Hier das Ergebnis (ohne Shader / Ray Tracing gedöns):
AutoIt
Alles anzeigen;Inspired from https://codepen.io/bradleytaunt/details/VwvzKyb ;Coded by UEZ build 2020-05-07 #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> If @OSBuild < 7600 Then Exit MsgBox(BitOR($MB_TOPMOST, $MB_ICONERROR), "ERROR", "This demo requires GDIPlus v1.1", 10) _GDIPlus_Startup() Global Const $iW = 1200, $iH = 700, $iSize_globe = 450 Global Const $hGUI = GUICreate("GDI+ Procedural Gfx / Blue Orb v1.20 by UEZ", $iW, $iH, -1, -1, $WS_POPUP, $WS_EX_TOPMOST) Global Const $hCanvas = _GDIPlus_GraphicsCreateFromHWND($hGUI) Global Const $hImage = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Global Const $hGfx = _GDIPlus_ImageGetGraphicsContext($hImage) _GDIPlus_GraphicsSetSmoothingMode($hGfx, $GDIP_SMOOTHINGMODE_ANTIALIAS8X8) ;~ _GDIPlus_GraphicsSetCompositingQuality($hGfx, $GDIP_COMPOSITINGQUALITYHIGHQUALITY) _GDIPlus_GraphicsSetInterpolationMode($hGfx, $GDIP_INTERPOLATIONMODE_HIGHQUALITYBICUBIC) _GDIPlus_GraphicsSetPixelOffsetMode($hGfx, $GDIP_PIXELOFFSETMODE_HALF) ;draw background Global Const $hBrush_bg = _GDIPlus_LineBrushCreate($iW / 2, 0, $iW / 2, $iH / 2, 0xFF1E88E5, 0xFF1565C0, 2) _GDIPlus_LineBrushSetSigmaBlend ($hBrush_bg, 0.95, 1) ;create blurry edge _GDIPlus_GraphicsFillRect($hGfx, 0, 0, $iW, $iH, $hBrush_bg) ;draw blurred text Global Const $hImage_text = _GDIPlus_BitmapCreateFromScan0($iW, $iH / 2) Global Const $hGfx_text = _GDIPlus_ImageGetGraphicsContext($hImage_text) Global Const $hPath_text = _GDIPlus_PathCreate() Global Const $hFamily = _GDIPlus_FontFamilyCreate("Impact") Global Const $hStringFormat = _GDIPlus_StringFormatCreate() Global Const $hBrush_txt = _GDIPlus_LineBrushCreate($iW / 2, 0, $iW / 2, $iH / 2, 0xE0FFFFFF, 0xA01A237E) ;_GDIPlus_BrushCreateSolid(0xF02E86FB) _GDIPlus_LineBrushSetSigmaBlend($hBrush_txt, 0.66, 1) Global Const $hPen_txt = _GDIPlus_PenCreate(0x801A237E, 1) _GDIPlus_StringFormatSetAlign($hStringFormat, 1) _GDIPlus_StringFormatSetLineAlign($hStringFormat, 1) _GDIPlus_GraphicsSetSmoothingMode($hGfx_text, $GDIP_SMOOTHINGMODE_ANTIALIAS8X8) _GDIPlus_GraphicsSetTextRenderingHint($hGfx_text, $GDIP_TextRenderingHintAntialias) _GDIPlus_GraphicsSetPixelOffsetMode($hGfx_text, $GDIP_PIXELOFFSETMODE_HALF) _GDIPlus_GraphicsSetCompositingQuality($hGfx_text, $GDIP_COMPOSITINGQUALITYHIGHQUALITY) Global $tLayout = _GDIPlus_RectFCreate() $tLayout.width = $iW $tLayout.height = $iH / 2 $tLayout.y = -$iH * 0.05 _GDIPlus_PathAddString($hPath_text, "AutoIt rulez!", $tLayout, $hFamily, 0, $iW / 8, $hStringFormat) _GDIPlus_GraphicsFillPath($hGfx_text, $hPath_text, $hBrush_txt) _GDIPlus_GraphicsDrawPath($hGfx_text, $hPath_text, $hPen_txt) Global Const $hEffect_blur_text = _GDIPlus_EffectCreateBlur(20) _GDIPlus_BitmapApplyEffect($hImage_text, $hEffect_blur_text) _GDIPlus_GraphicsDrawImageRect($hGfx, $hImage_text, 0, 0, $iW, $iH / 2) ;draw shadow of the text Global Const $hBrush_txt_shadow = _GDIPlus_BrushCreateSolid(0x40000000) _GDIPlus_GraphicsClear($hGfx_text, 0) _GDIPlus_PathReset($hPath_text) $tLayout.width = $iW $tLayout.height = $iH / 2 $tLayout.y = 0 _GDIPlus_PathAddString($hPath_text, "AutoIt rulez!", $tLayout, $hFamily, 0, $iW / 8, $hStringFormat) _GDIPlus_GraphicsFillPath($hGfx_text, $hPath_text, $hBrush_txt_shadow) Global Const $hEffect_blur_text_shadow = _GDIPlus_EffectCreateBlur(60) _GDIPlus_BitmapApplyEffect($hImage_text, $hEffect_blur_text_shadow) _GDIPlus_GraphicsDrawImageRect($hGfx, $hImage_text, 0, $iH * 0.55, $iW, $iH / 8) ;draw shadow Global Const $iW_shadow1 = $iSize_globe * 0.85, $iH_shadow1 = $iSize_globe * 0.1, $iW_shadow2 = $iSize_globe * 0.60, _ $iW_shadow_Img = $iW_shadow1 * 2, $iH_shadowImg = $iH_shadow1 * 4 Global Const $hImage_shadow = _GDIPlus_BitmapCreateFromScan0($iW_shadow_Img, $iH_shadowImg) Global Const $hGfx_shadow = _GDIPlus_ImageGetGraphicsContext($hImage_shadow) _GDIPlus_GraphicsSetSmoothingMode($hGfx_shadow, $GDIP_SMOOTHINGMODE_ANTIALIAS8X8) Global Const $hBrush_shadow = _GDIPlus_BrushCreateSolid(0x66000000) _GDIPlus_GraphicsFillEllipse($hGfx_shadow, ($iW_shadow_Img - $iW_shadow1) / 2, ($iH_shadowImg / 4 + $iH_shadow1), $iW_shadow1, $iH_shadow1, $hBrush_shadow) _GDIPlus_BrushSetSolidColor($hBrush_shadow, 0xB3000000) _GDIPlus_GraphicsFillEllipse($hGfx_shadow, ($iW_shadow_Img - $iW_shadow2) / 2, ($iH_shadowImg / 4 + $iH_shadow1), $iW_shadow2, $iH_shadow1, $hBrush_shadow) Global Const $hEffect_blur_shadow = _GDIPlus_EffectCreateBlur(32) _GDIPlus_BitmapApplyEffect($hImage_shadow, $hEffect_blur_shadow) _GDIPlus_GraphicsDrawImageRect($hGfx, $hImage_shadow, ($iW - $iW_shadow_Img) / 2, $iH / 2 + $iH_shadow1 * 2.20, $iW_shadow_Img, $iH_shadowImg) ;draw globe Global Const $hPath_globe = _GDIPlus_PathCreate() _GDIPlus_PathAddEllipse($hPath_globe, ($iW - $iSize_globe) / 2, ($iH - $iSize_globe) / 2, $iSize_globe, $iSize_globe) Global Const $hLBrush_globe1 = _GDIPlus_LineBrushCreate($iW / 2, ($iH - $iSize_globe) / 2, $iW / 2, ($iH + $iSize_globe) / 2, 0, 0, 1) Global $aInterpolations[5][2] $aInterpolations[0][0] = 4 $aInterpolations[1][0] = 0xFFFFFFFF $aInterpolations[1][1] = 0 $aInterpolations[2][0] = 0xFFEEEEEE $aInterpolations[2][1] = 0.10 $aInterpolations[3][0] = 0xFF2E86FB $aInterpolations[3][1] = 0.50 $aInterpolations[4][0] = 0xFF1A237E $aInterpolations[4][1] = 1.0 _GDIPlus_LineBrushSetPresetBlend($hLBrush_globe1, $aInterpolations) _GDIPlus_GraphicsFillPath($hGfx, $hPath_globe, $hLBrush_globe1) Global Const $iSize_globe2 = $iSize_globe * 0.85, $iSize_globe2_Img = $iSize_globe2 * 1.5 Global Const $hImage_globe2 = _GDIPlus_BitmapCreateFromScan0($iSize_globe2_Img, $iSize_globe2_Img) Global Const $hGfx_globe2 = _GDIPlus_ImageGetGraphicsContext($hImage_globe2) Global Const $hBrush_globe2 = _GDIPlus_BrushCreateSolid(0x7F000000) ;draw shadow and blur it Global Const $px = ($iSize_globe2_Img - $iSize_globe2) / 2, $py = ($iSize_globe2_Img - $iSize_globe2) / 2 _GDIPlus_GraphicsFillEllipse($hGfx_globe2, $px, $py + ($iSize_globe - $iSize_globe2) * 0.25, $iSize_globe2, $iSize_globe2, $hBrush_globe2) Global Const $hEffect_blur_shadow2 = _GDIPlus_EffectCreateBlur(15) _GDIPlus_BitmapApplyEffect($hImage_globe2, $hEffect_blur_shadow2) ;draw 2nd smaller globe and blur it, too Global Const $hLBrush_globe2 = _GDIPlus_LineBrushCreate($iW / 2, $py, $iW / 2, $py + $iSize_globe2, 0, 0) Dim $aInterpolations[4][2] $aInterpolations[0][0] = 3 $aInterpolations[1][0] = 0xFFFFFFFF $aInterpolations[1][1] = 0 $aInterpolations[2][0] = 0xFF2E86FB $aInterpolations[2][1] = 0.60 $aInterpolations[3][0] = 0xFF283593 $aInterpolations[3][1] = 1.0 _GDIPlus_LineBrushSetPresetBlend($hLBrush_globe2, $aInterpolations) _GDIPlus_GraphicsFillEllipse($hGfx_globe2, $px, $py, $iSize_globe2, $iSize_globe2, $hLBrush_globe2) Global Const $hImage_globe2_blur = _Blur($hImage_globe2, $iSize_globe, $iSize_globe) ;windows gdi+ blur doesn't work properly _GDIPlus_GraphicsDrawImageRect($hGfx, $hImage_globe2_blur, ($iW - $iSize_globe2_Img) / 2 - ($iSize_globe - $iSize_globe2) / 8, ($iH - $iSize_globe2_Img) / 2, $iSize_globe2_Img, $iSize_globe2_Img) GUISetState() _GDIPlus_GraphicsDrawImageRect($hCanvas, $hImage, 0, 0, $iW, $iH) ;~ _GDIPlus_ImageSaveToFile($hImage, @ScriptDir & "\Blue Orb v1.20.png") ;clean-up ressources _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hStringFormat) _GDIPlus_EffectDispose($hEffect_blur_text) _GDIPlus_EffectDispose($hEffect_blur_text_shadow) _GDIPlus_EffectDispose($hEffect_blur_shadow) _GDIPlus_EffectDispose($hEffect_blur_shadow2) _GDIPlus_PathDispose($hPath_text) _GDIPlus_PathDispose($hPath_globe) _GDIPlus_PenDispose($hPen_txt) _GDIPlus_BrushDispose($hBrush_txt) _GDIPlus_BrushDispose($hBrush_txt_shadow) _GDIPlus_BrushDispose($hBrush_bg) _GDIPlus_BrushDispose($hLBrush_globe1) _GDIPlus_BrushDispose($hLBrush_globe2) _GDIPlus_BrushDispose($hBrush_globe2) _GDIPlus_ImageDispose($hImage) _GDIPlus_ImageDispose($hImage_text) _GDIPlus_ImageDispose($hImage_shadow) _GDIPlus_ImageDispose($hImage_globe2) _GDIPlus_ImageDispose($hImage_globe2_blur) _GDIPlus_GraphicsDispose($hCanvas) _GDIPlus_GraphicsDispose($hGfx_text) _GDIPlus_GraphicsDispose($hGfx_shadow) _GDIPlus_GraphicsDispose($hGfx_globe2) _GDIPlus_Shutdown() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete($hGUI) Exit Func _Blur($hBitmap, $iW, $iH, $fScale = 0.0525, $dx1 = 0, $dy1 = 0, $dx2 = 0, $dy2 = 0, $qual = 6) ; by eukalyptus Local $hBmpSmall = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local $hGfxSmall = _GDIPlus_ImageGetGraphicsContext($hBmpSmall) _GDIPlus_GraphicsSetPixelOffsetMode($hGfxSmall, $GDIP_PIXELOFFSETMODE_HALF) Local $hBmpBig = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local $hGfxBig = _GDIPlus_ImageGetGraphicsContext($hBmpBig) _GDIPlus_GraphicsSetPixelOffsetMode($hGfxBig, $GDIP_PIXELOFFSETMODE_HALF) _GDIPlus_GraphicsScaleTransform($hGfxSmall, $fScale, $fScale) _GDIPlus_GraphicsSetInterpolationMode($hGfxSmall, $qual) _GDIPlus_GraphicsScaleTransform($hGfxBig, 1 / $fScale, 1 / $fScale) _GDIPlus_GraphicsSetInterpolationMode($hGfxBig, $qual) _GDIPlus_GraphicsDrawImageRect($hGfxSmall, $hBitmap, 0, $dx1, $iW, $iH + $dy1) _GDIPlus_GraphicsDrawImageRect($hGfxBig, $hBmpSmall, 0, $dx2, $iW, $iH + $dy2) _GDIPlus_BitmapDispose($hBmpSmall) _GDIPlus_GraphicsDispose($hGfxSmall) _GDIPlus_GraphicsDispose($hGfxBig) Return $hBmpBig EndFunc ;==>_BlurVorschau:
Ich werde versuchen mit FB an die 4kb Exe Grenze zu kommen. Mal sehen, ob das klappen wird...
Wenn ihr auch was habt, dann postet's einfach hier rein.

-
-
Sehr nettes Tools.

Eine Kleinigkeit ist mir aufgefallen: wenn die Fehlerkorrektur auf 7% steht und die Vergrößerung z.B. auf 486x486 und ich setze die Fehlerkorrektur z.B. auf 25% und drücke auf Show QR Code, dann wird das Bild wieder klein dargestellt, obwohl der Slider immer noch auf 486x486 steht.
-
In der CMD Box manuel nim c HelloWorld.nim dauert höchstens 3 Sekunden.
Kann dies am VS bei dir liegen?
-
trancexx hatte auch klasse Ideen, wie die Zukunft von Autoit aussehen könnte, aber da gab es auch Differenzen, die zum Ausstieg von trancexx geführt hatten.
-
MVPs arbeiten nicht am Core mit, haben aber die Möglichkeit im Repository an den UDFs und der Doku rumzuschrauben.
Jon ist wahrscheinlich auch sehr, sehr vorsichtig mit Leuten, die am Core rumfummelnd dürfen. Da gab es schlechte Erfahrungen mit Codern, deren großes Ego Kompromisse oder andere Sichtweisen nicht zuliessen.Wenigstens gäbe es dann einen Fortschritt und keinen Stillstand, auch wenn der Verlauf nicht unbedingt dem entspräche, was sich Jon vorstellt. Soweit ich mich noch erinnern kann, gab es coole Ideen, wie sich Autoit weiter entwickeln könnte...
Apropos Jon, anscheinend schreibt er lieber coole Amiga Demos anstatt sich um die Entwicklung von AutoIt zu kümmern....
-
Krasse Fantasie Leute

Ich dachte eher an bewegenden Zellen eines Blattes oder so, aber ein Darm ist mir nie in den Sinn gekommen, dann eher Lava, wenn die Darstellung in rot wäre...

Das wird mir wohl in die Annalen gehen...

-
Interessant, dass die x86 Versionen schneller als die x64 Versionen laufen. Ist auf meinem Rechner ähnlich, bis auf -gen gcc -Wc -Ofast, wo die x64 schneller läuft.
Eine andere Sache ist, dass wenn ich die interne Circle Funktion aufrufe, dann ist die Geschwindigkeit auch höher. Ich frage mich, was an der internen Circle Funktion anders läuft, zumal sie noch diverse Checks durchführt, wie z.B. Überschreitung der Ränder, Parameter Check, usw.
Danke allen für's Testen!

-
Die Bereichsüberlaufabfragen (Iif(px1...)) fehlen ja bei deiner letzten Variante.
Das sollte jetzt in der neuen Version behoben sein.
Das ist sehr interessant, dass nach Optimierung der Code langsamer läuft!
Ich habe jetzt verschiedene Versionen erstellt, um den Vergleich interessanter zu machen.
Hier das Ergebnis:
Code
Alles anzeigenTest System: AMD Ryzen 5 PRO 3500U w/ Radeon Vega Mobile Gfx / Windows10 x64 1903 1) Atomic Cell World x64 (-gen gcc -Wc -Ofast).exe 45 fps 1) Atomic Cell World x86 (-gen gcc -Wc -Ofast).exe 41 fps 2) Atomic Cell World x64 (-gen gcc -Wc -O2).exe 26 fps 2) Atomic Cell World x86 (-gen gcc -Wc -O2).exe 41 fps 3) Atomic Cell World x64 (-gen gcc -O 3).exe 25 fps 3) Atomic Cell World x86 (-gen gcc -O 3).exe 40 fps 4) Atomic Cell World x64 (Standard).exe 9 fps 4) Atomic Cell World x86 (Standard).exe 10 fps Eine Minute Laufzeit und FPS ist der "Average" Wert.Im Anhang die neusten Versionen.
-
Und doch hast du immer noch eine Addition in der Schleife die nicht sein muss.
Schmeiß dein py doch direkt mit auf px1 und px2 drauf (außerhalb der Schleife - nicht mal im Schleifenkopf). Dann hast du im Loop nur noch pScrn[xx] = c
Ach ja, da war doch noch was.

Die Funktion sieht jetzt so aus
Code
Alles anzeigenSub _Circle(x As Short, y As Short, r As Short, c As Ulong) Dim As Short r2 = r * r, cx, cy, cyy Dim As Ulong py, px1, px2, xx For cy = -r to r cx = _Sqrt25(r2 - cy * cy) + 0.5 cyy = cy + y : cyy = Iif(cyy < 0, 0, Iif(cyy > iH - 1, iH - 1, cyy)) py = cyy * iW + x px1 = py - cx px2 = py + cx For xx = px1 To px2 'fill circle pScrn[xx] = c Next Next End SubZwar läuft der Code jetzt noch schneller (~47 FPS), aber mit der Darstellung stimmt was nicht.
Ja kann ich - blöderweise jedoch genau andersherum. Die alte Version macht bei mir ca 40 FPS. Die neue hingegen nur 30 FPS.
Auch wenn ich beide parallel nebeneinander laufen lasse hat die alte ~ 30 und die neue ~ 20.
Keine Ahnung woran das liegt.
Das ist komisch? Die Exe ist als x64 kompiliert und sollte theoretisch durch die Maßnahmen schneller laufen...
