1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. UEZ

Beiträge von UEZ

  • Softes scrollen von bildern in der GUI. - nicht möglich ?

    • UEZ
    • 9. Januar 2014 um 21:35

    Ich meinte sowas

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <GDIPlus.au3>
    AutoItSetOption("GUIOnEventMode", 1)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()
    Global Const $iW = 512, $iH = 384, $fPi = ACos(-1)
    Global Const $hGUI = GUICreate("", $iW, $iH)
    GUISetState()
    Global Const $hGfx = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    Global Const $hBmp = _GDIPlus_BitmapCreateFromScan0($iW, $iH)
    Global Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBmp)
    Global Const $hImage = _GDIPlus_ImageLoadFromFile("c:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg")

    [/autoit] [autoit][/autoit] [autoit]

    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    Global $fX, $fY, $fR = 128, $i, $j, $iFPS

    [/autoit] [autoit][/autoit] [autoit]

    AdlibRegister("FPS", 1000)
    Do
    $fX = Cos($i / 4 + $j) * $fR
    $fY = Sin($i / 8) * $fR
    _GDIPlus_GraphicsDrawImageRectRect($hCtxt, $hImage, 256 + $fX, 192 + $fY, $iW, $iH, 0, 0, $iW, $iH)
    _GDIPlus_GraphicsDrawString($hCtxt, "Scrolling", 25, 100, "Arial", 80)
    _GDIPlus_GraphicsDrawImageRect($hGfx, $hBmp, 0, 0, $iW, $iH)
    $i += 0.25
    $j += 0.001
    $iFPS += 1
    Until Not Sleep(10)

    [/autoit] [autoit][/autoit] [autoit]

    Func FPS()
    WinSetTitle($hGUI, "", $iFPS & " FPS")
    $iFPS = 0
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Exit()
    AdlibUnRegister("FPS")
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_GraphicsDispose($hGfx)
    _GDIPlus_BitmapDispose($hBmp)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()
    GUIDelete()
    Exit
    EndFunc

    [/autoit]

    Oder die schneller Variante:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <GDIPlus.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    AutoItSetOption("GUIOnEventMode", 1)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()
    Global Const $iW = 512, $iH = 384, $fPi = ACos(-1)
    Global Const $hGUI = GUICreate("", $iW, $iH)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $hBmp = _GDIPlus_BitmapCreateFromScan0($iW, $iH)
    Global Const $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp)
    _GDIPlus_BitmapDispose($hBmp)
    Global Const $hDC = _WinAPI_GetDC($hGUI)
    Global Const $hDC_Backbuffer = _WinAPI_CreateCompatibleDC($hDC)
    Global Const $DC_Obj = _WinAPI_SelectObject($hDC_Backbuffer, $hHBITMAP)
    Global Const $hCtxt = _GDIPlus_GraphicsCreateFromHDC($hDC_Backbuffer)
    Global Const $hImage = _GDIPlus_ImageLoadFromFile("c:\Program Files (x86)\AutoIt3\Examples\GUI\msoobe.jpg")

    [/autoit] [autoit][/autoit] [autoit]

    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    Global $fX, $fY, $fR = 128, $i, $j, $iFPS

    [/autoit] [autoit][/autoit] [autoit]

    AdlibRegister("FPS", 1000)

    [/autoit] [autoit][/autoit] [autoit]

    Do
    $fX = Cos($i / 4 + $j) * $fR
    $fY = Sin($i / 8) * $fR
    _GDIPlus_GraphicsDrawImageRectRect($hCtxt, $hImage, 256 + $fX, 192 + $fY, $iW, $iH, 0, 0, $iW, $iH)
    _GDIPlus_GraphicsDrawString($hCtxt, "Scrolling", 25, 100, "Arial", 80)
    _WinAPI_BitBlt($hDC, 0, 0, $iW, $iH, $hDC_Backbuffer, 0, 0, $SRCCOPY)
    $i += 0.15
    $j += 0.005
    $iFPS += 1
    Until Not Sleep(10)

    [/autoit] [autoit][/autoit] [autoit]

    Func FPS()
    WinSetTitle($hGUI, "", $iFPS & " FPS")
    $iFPS = 0
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Exit()
    AdlibUnRegister("FPS")
    _WinAPI_SelectObject($hDC_Backbuffer, $DC_Obj)
    _WinAPI_ReleaseDC($hGUI, $hDC)
    _WinAPI_DeleteObject($hHBITMAP)
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()
    GUIDelete()
    Exit
    EndFunc

    [/autoit]

    Benötigt 3.3.10.x Version!

    Gruß,
    UEZ

  • Suche (schnelle) Funktion zum Umrechnen ins Dual- oder Hexadezimalsystem

    • UEZ
    • 9. Januar 2014 um 00:20

    Man kann BugFix' Methode ein bisschen pimpen:

    [autoit]


    Func _DecToBin_6($Value); von BugFix
    Local $bin = '', $bs
    Do
    $bs = BitShift($Value, 1)
    $bin = $Value - $bs * 2 & $bin
    $Value = $bs
    Until Not $Value
    Return $bin
    EndFunc ;==>_DecToBin_7

    [/autoit]

    Ist zwar immer noch die Langsamste (auf meinem Rechner), aber ein paar µ Sekunden schneller.

    Gruß,
    UEZ

  • Softes scrollen von bildern in der GUI. - nicht möglich ?

    • UEZ
    • 8. Januar 2014 um 19:19

    Probiere es mal mit GDI+.

    Idee: kopiere nur den Bereich des großen Bildes, welches du in der "kleinen" GUI anzeigen möchtest -> _GDIPlus_GraphicsDrawImageRectRect()

    Ob's ruckelt oder nicht, habe ich nicht getestet.

    Gruß,
    UEZ

  • Bilder in GUI einfügen -> Compiled ohne Bilddatei im Ordner möglich?

    • UEZ
    • 7. Januar 2014 um 13:18

    Ja, du kann das Bild als Ressource einbinden -> http://www.autoitscript.com/forum/topic/51103-resources-udf oder direkt als Binärdatei / vom Internet laden -> http://www.autoitscript.com/forum/topic/13…ur-files-easily

    Gruß,
    UEZ

  • GUI wie bei Steam oder Spotify?

    • UEZ
    • 5. Januar 2014 um 11:29

    Es ist recht aufwendig mit GDI+ "schöne" GUIs/Controls zu zeichnen.

    Wie sieht es mit Skins aus? Schaue dir mal diese Links an:

    http://www.autoitscript.com/forum/topic/13…ully-functional
    http://www.autoitscript.com/forum/topic/90963-skincrafter-udf
    http://www.autoitscript.com/forum/topic/32…3-skin-your-gui
    http://www.autoitscript.com/forum/topic/12…h-skinsharp-dll
    http://www.autoitscript.com/forum/topic/150636-skin-udf

    Gruß,
    UEZ

  • Animierte prozedurale Landschaft aus impliziten Gleichungen

    • UEZ
    • 3. Januar 2014 um 23:41

    Ich habe mal versucht, das Skript ein bisschen zu beschleunigen.

    Spoiler anzeigen
    [autoit]


    #include <WindowsConstants.au3>
    #include <WinAPIGdi.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt("WinTitleMatchMode", 2)
    Global $nFrames = 60
    Global $nFPS = 30
    Global Const $iWidth = 400, $iHeight = $iWidth, $iStep = 4
    If $nFrames < $nFPS Then $nFrames = $nFPS
    Global $aBitmaps[$nFrames][4]
    For $i = 0 To $nFrames - 1
    $aBitmaps[$i][2] = _WinAPI_CreateCompatibleDC(0)
    $tBMI = DllStructCreate($tagBITMAPINFO)
    DllStructSetData($tBMI, 1, DllStructGetSize($tBMI) - 4)
    DllStructSetData($tBMI, 2, $iWidth)
    DllStructSetData($tBMI, 3, $iHeight)
    DllStructSetData($tBMI, 4, 1)
    DllStructSetData($tBMI, 5, 32)
    $aDIB = DllCall('gdi32.dll', 'ptr', 'CreateDIBSection', 'hwnd', 0, 'ptr', DllStructGetPtr($tBMI), 'uint', 0, 'ptr*', 0, 'ptr', 0, 'uint', 0)
    $aBitmaps[$i][1] = $aDIB[0]
    $aBitmaps[$i][0] = $aDIB[4]
    _WinAPI_SelectObject($aBitmaps[$i][2], $aBitmaps[$i][1])
    $aBitmaps[$i][3] = DllStructCreate("dword[" & $iWidth * $iHeight & "]", $aBitmaps[$i][0])
    Next
    Global $fPi = 4 * ATan(1)
    $hGUI = GUICreate("Animated Landscape", $iWidth, $iHeight)
    $hDC = _WinAPI_GetDC($hGUI)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    Global $f1, $f2, $f3, $f4, $f5, $f6, $f7, $f8, $f9, $f10, $f20

    [/autoit] [autoit][/autoit] [autoit]

    For $iFrame = 1 To $nFrames
    $SunX = -14 + ((39 / ($nFrames - 1)) * ($iFrame - 1))
    $SunY = -(27 / 380) * $SunX * $SunX + (297 / 380) * $SunX + (945 / 38)
    $fAmbientLight = ($SunY / 27)
    $iFrameTimer = TimerInit()
    $iSunRedSaturation = Int(0.111 * $iFrame * $iFrame - 6.667 * $iFrame + 100)
    For $fy = 0 To $iHeight Step $iStep
    $y = -15 + $fy * 0.125
    For $fx = 0 To $iWidth Step $iStep
    $x = -20 + $fx * 0.125
    $fDirectionalLight = Int((Abs($SunX - ($x + 6)) / 39) * 60)
    $f1 = 30 - ($x - $SunX) * ($x - $SunX) - ($y - $SunY) * $y - $SunY
    $f2 = $x * $x
    $f3 = Abs($x)
    $f4 = $fPi / 2
    $f5 = 2 * $fPi
    $f6 = 2 * $iSunRedSaturation
    $f7 = Mod($f3 - $f4, $f5)
    $f8 = Mod($f3 + $f4, $f5)
    $f9 = Int(87 * $fAmbientLight)
    $f10 = $x * 2
    $iColorARGB = RGB($f6, 200 - $iSunRedSaturation, 200 - $iSunRedSaturation)
    If $y > Sin($x) And $y > Cos($x) And $y < Tan($x) And $y < Sin($fPi * $x) + 7 And $x < 9 Then
    $iColorARGB = RGB($f6, 0, 0)
    ElseIf (($f7 - $fPi) * ($f7 - $fPi) + ($y - 8.5 + $f2 / 250) * ($y - 8.5 + $f2 / 250)) < 5 And $x < 8 Then
    $iColorARGB = RGB($f6, 87 + $f9 - $fDirectionalLight, 0)
    ElseIf (($f8 - $fPi) * ($f8 - $fPi) + ($y - 7.5 + $f2 / 280) * ($y - 7.5 + $f2 / 280)) < 5 And $x < 11 Then
    $iColorARGB = RGB($f6, 41 + Int(41 * $fAmbientLight) - $fDirectionalLight, 0)
    ElseIf $y <= ATan(10 - $x) Then
    $iColorARGB = RGB($f6, 87 + Int(87 * ($fAmbientLight)) - $fDirectionalLight, 0)
    ElseIf $y < ($iFrame / 75) * Sin($f10) * Sin($f10) + 0.5 And $y < $x - 9 Then
    $iColorARGB = RGB($f6, 0, 87 + $f9 - $fDirectionalLight)
    ElseIf Abs($f1) = $f1 Then
    $iColorARGB = RGB(0xFF, 0xFF - $f6, 0);0x00FFFF00
    EndIf
    DllStructSetData($aBitmaps[$iFrame - 1][3], 1, $iColorARGB, ($fy / $iStep) * $iHeight + ($fx / $iStep) + 1)
    Next
    Next
    WinSetTitle("Animated Landscape", "", "Animated Landscape Frame " & $iFrame & "/" & $nFrames & " (" & Round((TimerDiff($iFrameTimer) / 1000) * ($nFrames - $iFrame)) & "s remaining)")
    ;~ _WinAPI_BitBlt($hDC, 0, 0, $iWidth, $iHeight, $aBitmaps[$iFrame - 1][2], 0, 0, $srccopy)
    $f20 = $iHeight / $iStep
    _WinAPI_StretchBlt($hDC, 0, 0, $iWidth, $iHeight, $aBitmaps[$iFrame - 1][2], 0, $iHeight - ($f20), $iWidth / $iStep, $f20, $SRCCOPY)
    Next
    AdlibRegister("DrawScene", 1000 / $nFPS)
    $iFrame = 0
    $iAnimator = 1

    [/autoit] [autoit][/autoit] [autoit]

    While GUIGetMsg() <> -3
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func RGB($R, $G, $B)
    If $R < 0 Then
    $R = 0
    EndIf
    If $G < 0 Then
    $G = 0
    EndIf
    If $B < 0 Then
    $B = 0
    EndIf
    Return '0x' & Hex($r * 0x10000 + $g * 0x100 + $b, 6)
    EndFunc ;==>RGB

    [/autoit] [autoit][/autoit] [autoit]

    Func DrawScene()
    $iFrame += $iAnimator
    If $iFrame = $nFrames - 1 Or $iFrame = 0 Then
    $iAnimator *= -1
    EndIf
    ;~ _WinAPI_BitBlt($hDC, 0, 0, $iWidth, $iHeight, $aBitmaps[$iFrame][2], 0, 0, $srccopy)
    $f20 = $iHeight / $iStep
    _WinAPI_StretchBlt($hDC, 0, 0, $iWidth, $iHeight, $aBitmaps[$iFrame][2], 0, $iHeight - ($f20), $iWidth / $iStep, $f20, $SRCCOPY)
    EndFunc ;==>DrawScene

    [/autoit]

    Ich habe ein bisschen "getürkt". :D

    Ich habe es nicht mit der minx'schen Version gebencht, also keine Ahnung, ob das was gebracht hat. Theoretisch ja...

    Gruß,
    UEZ

  • Animierte prozedurale Landschaft aus impliziten Gleichungen

    • UEZ
    • 3. Januar 2014 um 19:50

    Wie hast du das GIF mit GDI+ erstellt?

    Apropos prozedurale Landschaft. Wer hat Lust das Ding hier nach AutoIt zu portieren?

    JavaScript:

    Spoiler anzeigen
    HTML
    <!DOCTYPE html>
    <html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    		<title>JS1k, 1k demo submission [816]</title>
    		<meta charset="utf-8">
    	</head>
    	<body>
    		<canvas height="400" width="900" id="c"></canvas>
    		<script>
    			var g, q = document,
    				t = Math,
    				r = [],
    				w = "#FFF",
    				W = 900,
    				c = 400,
    				p = i = 0,
    				l = 1,
    				b = f(9),
    				j = a;
    			f(9);
    			k = a;
    			h(w);
    			f(9);
    			u = a;
    			h("rgba(0,0,0,.05)");
    			f(10);
    			for (h(w); i++ < 200;) a.f(d(1E3), d(c), d(3), d(3));
    			f(15);
    			b = a.al(c, 120, 20, c, 120, W);
    			b.P = b.addColorStop;
    			b.P(.1, w);
    			G = "rgba(4,129,227,";
    			b.P(.11, G + ".3)");
    			b.P(1, G + "0)");
    			h(b);
    			a.f(0, 0, c * 4, c);
    			f(18);
    			for (h("#059"); p++ < W; a.ta(2, (p == 1) * c)) {
    				S = s;
    				p % 120 || s();
    				S = D;
    				D()
    			}
    			setInterval(function () {
    				j.ce(0, 0, W, c);
    				j.ga(k.cn, 0, 0);
    				k.ce(0, 0, W, c);
    				k.ga(j.cn, -1, 1);
    				u.f(0, 0, W, c);
    				u.ga(k.cn, 0, 0);
    				d(7) < .1 && k.f(d(1E3), 0, d(3), d(3));
    				j.f(0, 0, W, c);
    				for (i = 1; ++i < 6;) 
    					j.ga(b = r[i], t.abs(p % 2 - 1) * -(b.width - W), 0);
    				p += .001
    			}, 10);
    			function f(e) {
    				g = g ? q.createElement("canvas") : q.body.children.c;
    				g.width = e * 100;
    				g.height = c;
    				a = g.getContext("2d");
    				r.push(g);
    				for (b in a) a[(b[7] || b[0]) + (b[11] || b[2])] = a[b];
    				a.f = a.fillRect
    			}
    
    
    			function m(e, n, o) {
    				a.sv();
    				a.rt(o);
    				a.ta(0, -e);
    				a.sa(n, n);
    				l *= n;
    				if (l > .04) S();
    				a.rs();
    				l /= n
    			}
    
    
    			function s() {
    				if (d(1) < .04) {
    					m(0, .7, -.15);
    					m(0, .7, .15)
    				} else {
    					a.f(0, 0, 9, 9);
    					m(4, 1, d(6) < 3 ? .08 : -.08)
    				}
    			}
    
    
    			function D() {
    				a.f(0, 0, 2, 2);
    				d(1) > .02 && m(1, .98, d(.2) - .1)
    			}
    
    
    			function d(e) {
    				return t.random() * e
    			}
    
    
    			function h(e) {
    				a.fillStyle = e
    			}
    
    			j.cn.onclick = function (e) {
    				k.f(e.clientX, e.clientY, d(3), d(3))
    			};
    		</script>
    
    </body></html>
    Alles anzeigen

    Einfach als JavaScript.htm speichern und starten.

    Gruß,
    UEZ

  • AutoIt Versions-Archiv und Diskussionsthread (3.3.8.1 bis 3.3.10.2, Stand 30.12.13)

    • UEZ
    • 28. Dezember 2013 um 22:29

    Leider sieht es so aus, dass alle deine Skripe angepasst werden müssen. Du kannst dich ja direkt im engl. Forum äußern und den Devs deine Meinung sagen. Ich habe keine Lust den Durchlauferhitzer zu spielen.

    Minx hat es auch getan... :pinch:

    Gruß aus Berlin,
    UEZ

  • AutoIt Versions-Archiv und Diskussionsthread (3.3.8.1 bis 3.3.10.2, Stand 30.12.13)

    • UEZ
    • 26. Dezember 2013 um 21:48

    In der Hilfe steht bei mir die richtige Beschreibung:

    Code
    $tagBITMAPINFO
    This structure defines the dimensions and color information of a Windows-based device-independent bitmap (DIB).
    
    
    
    
    Global Const $tagBITMAPINFO = $tagBITMAPINFOHEADER & ";dword biRGBQuad[1]"
    
    
    
    
    Parameters
    $tagBITMAPINFOHEADER Contains information about dimensions of a bitmap. 
    biRGBQuad An array of tagRGBQUAD structures. The elements of the array that make up the color table. 
    
    
    Remarks
    This structure should not be used for declaration as the biRGBQuad field does not have the right dimension.
    It is provided just for documentation.
    
    
    Concatenation of a suitable sized array to $tagBITMAPINFOHEADER must be used.
    Take care of the right initialization of 'biSize' field.
    Alles anzeigen
    Code
    $tagBITMAPINFOHEADER
    This structure defines the dimensions information of a Windows-based device-independent bitmap (DIB).
    
    
    
    
    Global Const $tagBITMAPINFOHEADER = "struct; dword biSize;long biWidth;long biHeight;word biPlanes;word biBitCount;" & _
        "dword biCompression;dword biSizeImage;long biXPelsPerMeter;long biYPelsPerMeter;" & _
        "dword biClrUsed;dword biClrImportant; endstruct"
    
    
    
    
    Parameters
    biSize The number of bytes required by the structure, minus the size of the RGBQuad data 
    biWidth Specifies the width of the bitmap, in pixels 
    biHeight Specifies the height of the bitmap, in pixels 
    biPlanes Specifies the number of planes for the target device. This must be set to 1 
    biBitCount Specifies the number of bits-per-pixel 
    biCompression Specifies the type of compression for a compressed bottom-up bitmap 
    biSizeImage Specifies the size, in bytes, of the image 
    biXPelsPerMeter Specifies the horizontal resolution, in pixels-per-meter, of the target device for the bitmap 
    biYPelsPerMeter Specifies the vertical resolution, in pixels-per-meter, of the target device for the bitmap 
    biClrUsed Specifies the number of color indexes in the color table that are actually used by the bitmap 
    biClrImportant Specifies the number of color indexes that are required for displaying the bitmap 
    
    
    Remarks
    None.
    Alles anzeigen

    Aber ich habe vorgeschlagen, die Struct wieder zurückzunehmen.

    Edit: sieht nicht so aus, als möchte man die Struct ändern, da nun sie der MSDN entspricht und jetzt richtig ist.

    Gruß,
    UEZ

  • AutoIt Versions-Archiv und Diskussionsthread (3.3.8.1 bis 3.3.10.2, Stand 30.12.13)

    • UEZ
    • 26. Dezember 2013 um 21:02

    Ich für meinen Teil teste mit vielen meiner Skripte, ob sie mit den neuen Versionen (Betas) noch laufen. Wenn nicht, melde ich das im engl. Forum. Wenn es keine "script-breaking changes" gibt, sollten natürlich "alte" Funktionen noch "sauber" laufen.

    Apropos Sprache, ich war in der Schule noch nie gut in Englisch und ich werde auch nie Englisch wie z.B. die Engländer sprechen können, aber die Basis sollte jeder können, der hier in Deutschland zur Schule geht, zumal heute es auch dank den Online Übersetzern viel einfacher ist, sein Anliegen einigermaßen in Englisch zu schreiben.

    Gruß,
    UEZ

  • AutoIt Versions-Archiv und Diskussionsthread (3.3.8.1 bis 3.3.10.2, Stand 30.12.13)

    • UEZ
    • 26. Dezember 2013 um 15:09

    Genau deswegen gab es die lange Beta Phase, damit man seine Skripte testet und die Bugs melden kann. Wenn man erst zur "Stable" testet, dann kann genau sowas heraus kommen.

    Ich bin deiner Meinung, dass Jon unbedingt eine X-Mas version herausbringen wollte, zu früh für eine Stable Version war, aber ohne Input von den "Beta Testern", wird es immer noch Bugs geben.

    Gruß,
    UEZ

  • AutoIt Versions-Archiv und Diskussionsthread (3.3.8.1 bis 3.3.10.2, Stand 30.12.13)

    • UEZ
    • 26. Dezember 2013 um 12:58

    Einen Rollback wird es nicht geben, sondern 3.3.10.1, welches in den nächsten Tagen veröffentlicht wird.

    Ich hätte eher die Version 3.4.0.0 gewählt, da in dieser Version doch ziemlich viel verändert wurde und man seine Skripte i.d.R. anpassen muss, damit sie laufen.

    Falls sie nicht laufen sollten, sollte man dies melden, so dass man die Probleme beheben kann (Beta Phase), ansonsten kommt das raus, was gerade heraus gekommen ist.

    Gruß,
    UEZ

  • AutoIt Versions-Archiv und Diskussionsthread (3.3.8.1 bis 3.3.10.2, Stand 30.12.13)

    • UEZ
    • 25. Dezember 2013 um 18:53

    Hmm, bei mir funzt es normal! Ok, für BMP Dateien funzt es nicht!

    Gebe ich weiter!

    Gruß,
    UEZ

  • GDI+ How to Path

    • UEZ
    • 25. Dezember 2013 um 02:05

    Ein schönes Weihnachtsgeschenk an alle GDI+ Liebhaber! :love:


    Vielen Dank und schöne Weihnachten!

    Gruß,
    UEZ :thumbup:

  • "Duplizieren" Modus

    • UEZ
    • 21. Dezember 2013 um 00:41

    Das kann man bestimmt irgendwo in der Registry steuern. Frage doch mal Google...

    Gruß,
    UEZ

  • Eigener GDIPlus Button Style

    • UEZ
    • 20. Dezember 2013 um 23:11

    Ich habe doch keine Version gepostet! ?(

    Egal, hier die konvertierte Version mittels Wrapper und habe die Ternary Anweisung durch If/Then ersetzt:

    Spoiler anzeigen
    [autoit]


    Global Const $GDIP_PXF32ARGB = 0x0026200A
    Global Const $GDIP_SMOOTHINGMODE_DEFAULT = 0
    Global Const $GDIP_SMOOTHINGMODE_ANTIALIAS8X8 = 5
    Global Const $tagRECT = "struct;long Left;long Top;long Right;long Bottom;endstruct"
    Global Const $tagGDIPRECTF = "struct;float X;float Y;float Width;float Height;endstruct"
    Global Const $tagGDIPSTARTUPINPUT = "uint Version;ptr Callback;bool NoThread;bool NoCodecs"
    Global $tagREBARBANDINFO = "uint cbSize;uint fMask;uint fStyle;dword clrFore;dword clrBack;ptr lpText;uint cch;" & "int iImage;hwnd hwndChild;uint cxMinChild;uint cyMinChild;uint cx;handle hbmBack;uint wID;uint cyChild;uint cyMaxChild;" & "uint cyIntegral;uint cxIdeal;lparam lParam;uint cxHeader"
    If (@OSVersion <> "WIN_XP") Then $tagREBARBANDINFO &= ";" & $tagRECT & ";uint uChevronState"
    Global Const $HGDI_ERROR = Ptr(-1)
    Global Const $INVALID_HANDLE_VALUE = Ptr(-1)
    Global Const $KF_EXTENDED = 0x0100
    Global Const $KF_ALTDOWN = 0x2000
    Global Const $KF_UP = 0x8000
    Global Const $LLKHF_EXTENDED = BitShift($KF_EXTENDED, 8)
    Global Const $LLKHF_ALTDOWN = BitShift($KF_ALTDOWN, 8)
    Global Const $LLKHF_UP = BitShift($KF_UP, 8)
    Global Const $tagOSVERSIONINFO = 'struct;dword OSVersionInfoSize;dword MajorVersion;dword MinorVersion;dword BuildNumber;dword PlatformId;wchar CSDVersion[128];endstruct'
    Global Const $__WINVER = __WINVER()
    Func __WINVER()
    Local $tOSVI = DllStructCreate($tagOSVERSIONINFO)
    DllStructSetData($tOSVI, 1, DllStructGetSize($tOSVI))
    Local $Ret = DllCall('kernel32.dll', 'bool', 'GetVersionExW', 'struct*', $tOSVI)
    If @error Or Not $Ret[0] Then Return SetError(@error, @extended, 0)
    Return BitOR(BitShift(DllStructGetData($tOSVI, 2), -8), DllStructGetData($tOSVI, 3))
    EndFunc ;==>__WINVER
    Global $ghGDIPBrush = 0
    Global $ghGDIPDll = 0
    Global $ghGDIPPen = 0
    Global $giGDIPRef = 0
    Global $giGDIPToken = 0
    Global $gbGDIP_V1_0 = True
    Func _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight, $iPixelFormat = $GDIP_PXF32ARGB, $iStride = 0, $pScan0 = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", $iStride, "int", $iPixelFormat, "ptr", $pScan0, "handle*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)
    Return $aResult[6]
    EndFunc ;==>_GDIPlus_BitmapCreateFromScan0
    Func _GDIPlus_BitmapDispose($hBitmap)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipDisposeImage", "handle", $hBitmap)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_BitmapDispose
    Func _GDIPlus_BrushCreateSolid($iARGB = 0xFF000000)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateSolidFill", "int", $iARGB, "handle*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)
    Return $aResult[2]
    EndFunc ;==>_GDIPlus_BrushCreateSolid
    Func _GDIPlus_BrushDispose($hBrush)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeleteBrush", "handle", $hBrush)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_BrushDispose
    Func _GDIPlus_FontFamilyCreate($sFamily, $pCollection = 0)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateFontFamilyFromName", "wstr", $sFamily, "ptr", $pCollection, "handle*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)
    Return $aResult[3]
    EndFunc ;==>_GDIPlus_FontFamilyCreate
    Func _GDIPlus_FontFamilyDispose($hFamily)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeleteFontFamily", "handle", $hFamily)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_FontFamilyDispose
    Func _GDIPlus_GraphicsClear($hGraphics, $iARGB = 0xFF000000)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipGraphicsClear", "handle", $hGraphics, "dword", $iARGB)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_GraphicsClear
    Func _GDIPlus_GraphicsCreateFromHWND($hWnd)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateFromHWND", "hwnd", $hWnd, "handle*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)
    Return $aResult[2]
    EndFunc ;==>_GDIPlus_GraphicsCreateFromHWND
    Func _GDIPlus_GraphicsDispose($hGraphics)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeleteGraphics", "handle", $hGraphics)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_GraphicsDispose
    Func _GDIPlus_GraphicsDrawImage($hGraphics, $hImage, $nX, $nY)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawImage", "handle", $hGraphics, "handle", $hImage, "float", $nX, "float", $nY)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_GraphicsDrawImage
    Func _GDIPlus_GraphicsDrawPath($hGraphics, $hPath, $hPen = 0)
    __GDIPlus_PenDefCreate($hPen)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawPath", "handle", $hGraphics, "handle", $hPen, "handle", $hPath)
    __GDIPlus_PenDefDispose()
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_GraphicsDrawPath
    Func _GDIPlus_GraphicsFillPath($hGraphics, $hPath, $hBrush = 0)
    __GDIPlus_BrushDefCreate($hBrush)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipFillPath", "handle", $hGraphics, "handle", $hBrush, "handle", $hPath)
    __GDIPlus_BrushDefDispose()
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_GraphicsFillPath
    Func _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $iSmooth)
    If $iSmooth < $GDIP_SMOOTHINGMODE_DEFAULT Or $iSmooth > $GDIP_SMOOTHINGMODE_ANTIALIAS8X8 Then $iSmooth = $GDIP_SMOOTHINGMODE_DEFAULT
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetSmoothingMode", "handle", $hGraphics, "int", $iSmooth)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_GraphicsSetSmoothingMode
    Func _GDIPlus_ImageGetGraphicsContext($hImage)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetImageGraphicsContext", "handle", $hImage, "handle*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)
    Return $aResult[2]
    EndFunc ;==>_GDIPlus_ImageGetGraphicsContext
    Func _GDIPlus_LineBrushCreate($nX1, $nY1, $nX2, $nY2, $iARGBClr1, $iARGBClr2, $iWrapMode = 0)
    Local $tPointF1, $tPointF2, $aResult
    $tPointF1 = DllStructCreate("float;float")
    $tPointF2 = DllStructCreate("float;float")
    DllStructSetData($tPointF1, 1, $nX1)
    DllStructSetData($tPointF1, 2, $nY1)
    DllStructSetData($tPointF2, 1, $nX2)
    DllStructSetData($tPointF2, 2, $nY2)
    $aResult = DllCall($ghGDIPDll, "int", "GdipCreateLineBrush", "struct*", $tPointF1, "struct*", $tPointF2, "uint", $iARGBClr1, "uint", $iARGBClr2, "int", $iWrapMode, "handle*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)
    Return $aResult[6]
    EndFunc ;==>_GDIPlus_LineBrushCreate
    Func _GDIPlus_MatrixCreate()
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateMatrix", "handle*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)
    Return $aResult[1]
    EndFunc ;==>_GDIPlus_MatrixCreate
    Func _GDIPlus_MatrixDispose($hMatrix)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeleteMatrix", "handle", $hMatrix)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_MatrixDispose
    Func _GDIPlus_MatrixSetElements($hMatrix, $nM11 = 1, $nM12 = 0, $nM21 = 0, $nM22 = 1, $nDX = 0, $nDY = 0)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetMatrixElements", "handle", $hMatrix, "float", $nM11, "float", $nM12, "float", $nM21, "float", $nM22, "float", $nDX, "float", $nDY)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_MatrixSetElements
    Func _GDIPlus_MatrixTranslate($hMatrix, $fOffsetX, $fOffsetY, $bAppend = False)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipTranslateMatrix", "handle", $hMatrix, "float", $fOffsetX, "float", $fOffsetY, "int", $bAppend)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_MatrixTranslate
    Func _GDIPlus_PathAddArc($hPath, $nX, $nY, $nWidth, $nHeight, $fStartAngle, $fSweepAngle)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipAddPathArc", "handle", $hPath, "float", $nX, "float", $nY, "float", $nWidth, "float", $nHeight, "float", $fStartAngle, "float", $fSweepAngle)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_PathAddArc
    Func _GDIPlus_PathAddString($hPath, $sString, $tLayout, $hFamily, $iStyle = 0, $fSize = 8.5, $hFormat = 0)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipAddPathString", "handle", $hPath, "wstr", $sString, "int", -1, "handle", $hFamily, "int", $iStyle, "float", $fSize, "struct*", $tLayout, "handle", $hFormat)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_PathAddString
    Func _GDIPlus_PathBrushCreateFromPath($hPath)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreatePathGradientFromPath", "handle", $hPath, "handle*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)
    Return $aResult[2]
    EndFunc ;==>_GDIPlus_PathBrushCreateFromPath
    Func _GDIPlus_PathBrushSetCenterColor($hPathGradientBrush, $iARGB)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetPathGradientCenterColor", "handle", $hPathGradientBrush, "uint", $iARGB)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_PathBrushSetCenterColor
    Func _GDIPlus_PathBrushSetCenterPoint($hPathGradientBrush, $nX, $nY)
    Local $tPointF = DllStructCreate("float;float")
    DllStructSetData($tPointF, 1, $nX)
    DllStructSetData($tPointF, 2, $nY)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetPathGradientCenterPoint", "handle", $hPathGradientBrush, "struct*", $tPointF)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_PathBrushSetCenterPoint
    Func _GDIPlus_PathBrushSetFocusScales($hPathGradientBrush, $fScaleX, $fScaleY)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetPathGradientFocusScales", "handle", $hPathGradientBrush, "float", $fScaleX, "float", $fScaleY)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_PathBrushSetFocusScales
    Func _GDIPlus_PathBrushSetSigmaBlend($hPathGradientBrush, $fFocus, $fScale = 1)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetPathGradientSigmaBlend", "handle", $hPathGradientBrush, "float", $fFocus, "float", $fScale)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_PathBrushSetSigmaBlend
    Func _GDIPlus_PathBrushSetSurroundColor($hPathGradientBrush, $iARGB)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetPathGradientSurroundColorsWithCount", "handle", $hPathGradientBrush, "uint*", $iARGB, "int*", 1)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_PathBrushSetSurroundColor
    Func _GDIPlus_PathCreate($iFillMode = 0)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreatePath", "int", $iFillMode, "handle*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)
    Return $aResult[2]
    EndFunc ;==>_GDIPlus_PathCreate
    Func _GDIPlus_PathDispose($hPath)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeletePath", "handle", $hPath)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_PathDispose
    Func _GDIPlus_PathGetWorldBounds($hPath, $hMatrix = 0, $hPen = 0)
    Local $tRectF = DllStructCreate($tagGDIPRECTF)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetPathWorldBounds", "handle", $hPath, "struct*", $tRectF, "handle", $hMatrix, "handle", $hPen)
    If @error Then Return SetError(@error, @extended, -1)
    If $aResult[0] Then Return SetError(10, $aResult[0], -1)
    Local $aRectF[4]
    For $iI = 1 To 4
    $aRectF[$iI - 1] = DllStructGetData($tRectF, $iI)
    Next
    Return $aRectF
    EndFunc ;==>_GDIPlus_PathGetWorldBounds
    Func _GDIPlus_PathReset($hPath)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipResetPath", "handle", $hPath)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_PathReset
    Func _GDIPlus_PathTransform($hPath, $hMatrix)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipTransformPath", "handle", $hPath, "handle", $hMatrix)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_PathTransform
    Func _GDIPlus_PenCreate($iARGB = 0xFF000000, $fWidth = 1, $iUnit = 2)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreatePen1", "dword", $iARGB, "float", $fWidth, "int", $iUnit, "handle*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)
    Return $aResult[4]
    EndFunc ;==>_GDIPlus_PenCreate
    Func _GDIPlus_PenCreate2($hBrush, $fWidth = 1, $iUnit = 2)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreatePen2", "handle", $hBrush, "float", $fWidth, "int", $iUnit, "handle*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)
    Return $aResult[4]
    EndFunc ;==>_GDIPlus_PenCreate2
    Func _GDIPlus_PenDispose($hPen)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeletePen", "handle", $hPen)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_PenDispose
    Func _GDIPlus_RectFCreate($nX = 0, $nY = 0, $nWidth = 0, $nHeight = 0)
    Local $tRectF = DllStructCreate($tagGDIPRECTF)
    DllStructSetData($tRectF, "X", $nX)
    DllStructSetData($tRectF, "Y", $nY)
    DllStructSetData($tRectF, "Width", $nWidth)
    DllStructSetData($tRectF, "Height", $nHeight)
    Return $tRectF
    EndFunc ;==>_GDIPlus_RectFCreate
    Func _GDIPlus_Shutdown()
    If $ghGDIPDll = 0 Then Return SetError(-1, -1, False)
    $giGDIPRef -= 1
    If $giGDIPRef = 0 Then
    DllCall($ghGDIPDll, "none", "GdiplusShutdown", "ulong_ptr", $giGDIPToken)
    DllClose($ghGDIPDll)
    $ghGDIPDll = 0
    EndIf
    Return True
    EndFunc ;==>_GDIPlus_Shutdown
    Func _GDIPlus_Startup($sGDIPDLL = Default)
    $giGDIPRef += 1
    If $giGDIPRef > 1 Then Return True
    If $sGDIPDLL = Default Then
    If @OSBuild > 4999 And @OSBuild < 7600 Then
    $sGDIPDLL = @WindowsDir & "\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.6000.16386_none_8df21b8362744ace\gdiplus.dll"
    Else
    $sGDIPDLL = "gdiplus.dll"
    EndIf
    EndIf
    $ghGDIPDll = DllOpen($sGDIPDLL)
    If $ghGDIPDll = -1 Then
    $giGDIPRef = 0
    Return SetError(1, 2, False)
    EndIf
    Local $sVer = FileGetVersion($sGDIPDLL)
    $sVer = StringSplit($sVer, ".")
    If $sVer[1] > 5 Then $gbGDIP_V1_0 = False
    Local $tInput = DllStructCreate($tagGDIPSTARTUPINPUT)
    Local $tToken = DllStructCreate("ulong_ptr Data")
    DllStructSetData($tInput, "Version", 1)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdiplusStartup", "struct*", $tToken, "struct*", $tInput, "ptr", 0)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    $giGDIPToken = DllStructGetData($tToken, "Data")
    Return True
    EndFunc ;==>_GDIPlus_Startup
    Func _GDIPlus_StringFormatCreate($iFormat = 0, $iLangID = 0)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateStringFormat", "int", $iFormat, "word", $iLangID, "handle*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)
    Return $aResult[3]
    EndFunc ;==>_GDIPlus_StringFormatCreate
    Func _GDIPlus_StringFormatDispose($hFormat)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeleteStringFormat", "handle", $hFormat)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_StringFormatDispose
    Func _GDIPlus_StringFormatSetAlign($hStringFormat, $iFlag)
    Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetStringFormatAlign", "handle", $hStringFormat, "int", $iFlag)
    If @error Then Return SetError(@error, @extended, False)
    If $aResult[0] Then Return SetError(10, $aResult[0], False)
    Return True
    EndFunc ;==>_GDIPlus_StringFormatSetAlign
    Func __GDIPlus_BrushDefCreate(ByRef $hBrush)
    If $hBrush = 0 Then
    $ghGDIPBrush = _GDIPlus_BrushCreateSolid()
    $hBrush = $ghGDIPBrush
    EndIf
    EndFunc ;==>__GDIPlus_BrushDefCreate
    Func __GDIPlus_BrushDefDispose($icurError = @error, $icurExtended = @extended)
    If $ghGDIPBrush <> 0 Then
    _GDIPlus_BrushDispose($ghGDIPBrush)
    $ghGDIPBrush = 0
    EndIf
    Return SetError($icurError, $icurExtended)
    EndFunc ;==>__GDIPlus_BrushDefDispose
    Func __GDIPlus_PenDefCreate(ByRef $hPen)
    If $hPen = 0 Then
    $ghGDIPPen = _GDIPlus_PenCreate()
    $hPen = $ghGDIPPen
    EndIf
    EndFunc ;==>__GDIPlus_PenDefCreate
    Func __GDIPlus_PenDefDispose($icurError = @error, $icurExtended = @extended)
    If $ghGDIPPen <> 0 Then
    _GDIPlus_PenDispose($ghGDIPPen)
    $ghGDIPPen = 0
    EndIf
    Return SetError($icurError, $icurExtended)
    EndFunc ;==>__GDIPlus_PenDefDispose
    Global Const $GUI_EVENT_CLOSE = -3
    Global Const $GUI_RUNDEFMSG = 'GUI_RUNDEFMSG'
    Global Const $WS_SIZEBOX = 0x00040000
    Global Const $WM_PAINT = 0x000F
    Global Const $WM_ERASEBKGND = 0x0014
    Opt("MustDeclareVars", 1)
    Opt("GUIOnEventMode", 1)
    Global $iWidth = 610
    Global $iHeight = 200
    Global $hGui = GUICreate("GDI+ Path Tutorial", $iWidth, $iHeight)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    _GDIPlus_Startup()
    Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
    Global $hBitmap = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight)
    Global $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hContext, 2)
    _GDIPlus_GraphicsClear($hContext, 0xFFFFFFFF)
    GUIRegisterMsg($WM_PAINT, "WM_PAINT")
    GUIRegisterMsg($WM_ERASEBKGND, "WM_PAINT")
    GUISetState()
    _DrawButton("Button", 10, 30, 160, 100, 0xFFDD3030)
    _DrawButton("Text", 210, 30, 160, 100, 0xFF30AA30)
    _DrawButton("Abcdefg", 410, 30, 190, 100, 0xFF3040DD)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
    While Sleep(10)
    WEnd
    Func _DrawButton($sText, $fX, $fY, $fW, $fH, $iColor, $fRadius = 40)
    Local $hPath = _GDIPlus_PathCreate()
    _GDIPlus_PathAddArc($hPath, $fX, $fY, $fRadius, $fRadius, 180, 90)
    _GDIPlus_PathAddArc($hPath, $fX + $fW - $fRadius, $fY, $fRadius, $fRadius, 270, 90)
    _GDIPlus_PathAddArc($hPath, $fX + $fW - $fRadius, $fY + $fH - $fRadius, $fRadius, $fRadius, 0, 90)
    _GDIPlus_PathAddArc($hPath, $fX, $fY + $fH - $fRadius, $fRadius, $fRadius, 90, 90)
    Local $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix, 0, $fH * 0.1)
    _GDIPlus_PathTransform($hPath, $hMatrix)
    Local $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath)
    _GDIPlus_PathBrushSetCenterPoint($hBrush, $fX + $fW * 0.5, $fY)
    _GDIPlus_PathBrushSetCenterColor($hBrush, 0xFF000000)
    _GDIPlus_PathBrushSetSurroundColor($hBrush, 0x00000000)
    _GDIPlus_PathBrushSetSigmaBlend($hBrush, 1, 1)
    _GDIPlus_PathBrushSetFocusScales($hBrush, 0.85, 0.85)
    _GDIPlus_GraphicsFillPath($hContext, $hPath, $hBrush)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_MatrixTranslate($hMatrix, 0, -$fH * 0.2)
    _GDIPlus_PathTransform($hPath, $hMatrix)
    $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath)
    _GDIPlus_PathBrushSetCenterPoint($hBrush, $fX + $fW * 0.5, $fY)
    _GDIPlus_PathBrushSetCenterColor($hBrush, $iColor)
    Local $iR = Int(BitAND(BitShift($iColor, 16), 0xFF) * 0.3)
    Local $iG = Int(BitAND(BitShift($iColor, 8), 0xFF) * 0.3)
    Local $iB = Int(BitAND($iColor, 0xFF) * 0.3)
    Local $iColor2 = BitOR(BitShift($iR, -16), BitShift($iG, -8), $iB)
    _GDIPlus_PathBrushSetSurroundColor($hBrush, BitOR(0xFF000000, $iColor2))
    _GDIPlus_PathBrushSetSigmaBlend($hBrush, 1, 1)
    _GDIPlus_PathBrushSetFocusScales($hBrush, 0.97, 0.3)
    _GDIPlus_GraphicsFillPath($hContext, $hPath, $hBrush)
    _GDIPlus_BrushDispose($hBrush)
    $fRadius *= 0.6
    _GDIPlus_PathReset($hPath)
    _GDIPlus_PathAddArc($hPath, $fX + $fRadius * 0.2, $fY, $fRadius, $fRadius, 90, 180)
    _GDIPlus_PathAddArc($hPath, $fX + $fW - $fRadius * 1.2, $fY, $fRadius, $fRadius, 270, 180)
    $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath)
    _GDIPlus_PathBrushSetCenterPoint($hBrush, $fX + $fW * 0.5, $fY + $fRadius * 0.2)
    _GDIPlus_PathBrushSetCenterColor($hBrush, 0xDDFFFFFF)
    _GDIPlus_PathBrushSetSurroundColor($hBrush, 0x00000000)
    _GDIPlus_PathBrushSetFocusScales($hBrush, 0.8, 0.2)
    _GDIPlus_PathBrushSetSigmaBlend($hBrush, 1, 0.9)
    _GDIPlus_GraphicsFillPath($hContext, $hPath, $hBrush)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_PathReset($hPath)
    Local $hFamily = _GDIPlus_FontFamilyCreate("Arial")
    Local $hFormat = _GDIPlus_StringFormatCreate()
    _GDIPlus_StringFormatSetAlign($hFormat, 1)
    DllCall($ghGDIPDll, "int", "GdipSetStringFormatLineAlign", "handle", $hFormat, "int", 1)
    Local $tLayout = _GDIPlus_RectFCreate($fX, $fY, $fW, $fH)
    _GDIPlus_PathAddString($hPath, $sText, $tLayout, $hFamily, 0, 32, $hFormat)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    Local $aBounds = _GDIPlus_PathGetWorldBounds($hPath)
    _GDIPlus_MatrixSetElements($hMatrix)
    _GDIPlus_MatrixTranslate($hMatrix, -($aBounds[0] + $aBounds[2] / 2) + $fX + $fW / 2, -($aBounds[1] + $aBounds[3] / 2) + $fY + $fH * 0.48)
    _GDIPlus_MatrixDispose($hMatrix)
    $aBounds = _GDIPlus_PathGetWorldBounds($hPath)
    $hBrush = _GDIPlus_LineBrushCreate(0, $aBounds[1] - 4, 0, $aBounds[1] + $aBounds[3] + 4, BitOR(0x40000000, $iColor2), 0x40FFFFFF)
    Local $hPen = _GDIPlus_PenCreate2($hBrush, 4)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDrawPath($hContext, $hPath, $hPen)
    _GDIPlus_PenDispose($hPen)
    $hPen = _GDIPlus_PenCreate(BitOR(0x70000000, $iColor2), 2)
    _GDIPlus_GraphicsDrawPath($hContext, $hPath, $hPen)
    _GDIPlus_PenDispose($hPen)
    $hBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
    _GDIPlus_GraphicsFillPath($hContext, $hPath, $hBrush)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_PathDispose($hPath)
    EndFunc ;==>_DrawButton
    Func WM_PAINT($hWnd, $uMsgm, $wParam, $lParam)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
    Return $GUI_RUNDEFMSG
    EndFunc ;==>WM_PAINT
    Func _Exit()
    _GDIPlus_GraphicsDispose($hContext)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    Gruß,
    UEZ

  • Eigener GDIPlus Button Style

    • UEZ
    • 20. Dezember 2013 um 22:23

    Du kannst die Funktionen aus der Beta inkludieren, entweder manuell oder per Wrapper.

    [autoit]


    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/SO

    [/autoit]

    Du benötigst die SciTE Vollversion (separate Datei).

    Nach dem Kompilieren solltest du eine <Dein_Skript>_Obfuscated.au3 in dem gleichen Verzeichnis finden. In diesem Skript sind alle Variablen / Funktionen aus den Include Dateien integriert. Du kannst nun die entsprechenden Funktionen und Variablen in dein Skript kopieren, so dass dein Skript auch mit der aktuellen finalen Version läuft.


    Gruß,
    UEZ

  • Eigener GDIPlus Button Style

    • UEZ
    • 20. Dezember 2013 um 21:45

    "Probieren geht über studieren".

    Dazu kann ich nichts sagen, da ich deine Skripte nicht kenne, aber einige "Script Breaking Changes" gibt es schon.


    Die Beta ersetzt nicht die aktuelle Version, sondern sie wird parallel installiert und du kannst die Beta mit Alt+F5 aufrufen.

    Gruß,
    UEZ

  • Eigener GDIPlus Button Style

    • UEZ
    • 20. Dezember 2013 um 21:39

    Dann lade die Beta doch einfach herunter und installiere sie. Ansonsten warte bis die Finale Version veröffentlicht wird (bald ist Weihnachten ;) )

    Gruß,
    UEZ

  • Eigener GDIPlus Button Style

    • UEZ
    • 20. Dezember 2013 um 21:07

    Probiere es mal mit Alt+F5.

    Gruß,
    UEZ

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™