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

  • GDI+ Bitmap "trapezoid" zeichnen / DrawImage_4Points

    • UEZ
    • 24. November 2010 um 10:24
    Zitat von Andy

    OK,
    dann hole ich mir den Pointer und $hBmp_buffer über CreateNewBitmap32($ix,$iy,$Ptr_buffer,$hBmp_buffer), welches dann

    [autoit]

    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iX, $iY, $hGraphics)

    [/autoit]

    ersetzt, und ihr könnt euch per

    [autoit]

    $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBmp_buffer)
    $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hImage)

    [/autoit]

    den $hBackbuffer holen? Ist das so ok?

    Danach könnte man z.B. eine Funktion _Rect_to_Trapezoid($aEckpunkteRect[],$aEckpunkte_Trapezoid,$ix,$iy,$ptr_buffer) aufrufen, welche direkt in den Backbuffer schreibt.

    Btw, in CreateNewBitmap32() werden nur AutoIt-Funktionen verwendet.

    Nächste Frage:
    Durch bestimmte Prozessorbefehle (MMX/SSE), die ab den P3/P4 implementiert wurden, kann die Grafikberechnung wesentlich beschleunigt werden. Kann ich vorraussetzen, dass nur Prozessoren neuer als P3 (also ab P4) eingesetzt werden? Immerhin hat diese schon 10 Jahre alte Technik in den neuesten Linuxkernel Einzug gehalten. Auch die "großen" Bildbe(ver)arbeitungs-Softwarepakete setzen in den neuesten Versionen nun endlich diese uralten Prozessor-Befehle ein. Heureka, die Software tappert 10 Jahre hinter der Hardware her...

    Alles anzeigen

    Wir sollten P4+ voraussetzen!

    Gruß,
    UEZ

  • Simple Image Slideshow v1.0 2011-04-30 Beta

    • UEZ
    • 23. November 2010 um 23:15

    Hier ein recht simples Skript zum Darstellen von Bildern als Slideshow mit nur einem Überblendeffekt!

    Spoiler anzeigen
    [autoit]


    #AutoIt3Wrapper_UseX64=n
    #AutoIt3Wrapper_Res_Description=Simple Image Slideshow Program
    #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
    #AutoIt3Wrapper_Res_LegalCopyright=UEZ 2010
    #AutoIt3Wrapper_Res_Language=1033
    #AutoIt3Wrapper_Res_Field=Coded by|UEZ
    #AutoIt3Wrapper_Res_Field=Build|2011-04-30 Beta
    #AutoIt3Wrapper_Res_Field=Compile date|%longdate% %time%
    #AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer%
    #AutoIt3Wrapper_UseUpx=y
    #AutoIt3Wrapper_UPX_Parameters=--ultra-brute
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Parameters=/sf /sv /om /cs=0 /cn=0
    #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_Obfuscated.au3"
    ;~ #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

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

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

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

    Opt("GUIOnEventMode", 1)
    Opt("MustDeclareVars", 1)

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

    Global $c, $i, $k, $l, $chk, $end, $fn
    Global $hGUI[3], $graphic0, $graphic1, $graphic2, $hGraphic[2], $hImage, $hBrush1, $hBrush2, $hFamily, $hFont, $hFormat, $tLayout, $aInfo
    Global Const $SC_DRAGMOVE = 0xF012, $fsize = 8, $fh = 15
    Global Const $ratio = 16 / 10
    Global Const $height = Floor(@DesktopHeight * 0.9 / 8) * 8, $width = Floor($height * $ratio / 8) * 8
    Global Const $bg_color = "F0F0F0"
    Global Const $title = "Simple Image Slideshow by UEZ"
    Global $imagedir = FileSelectFolder("Select folder with images", "", 4, @ScriptDir)
    If $imagedir = "" Then Exit MsgBox(16, "Error", "No folder selected!", 5)

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

    Global $aFiles = _FileListToArray($imagedir, "*.*", 1)
    If Not UBound($aFiles) Then Exit MsgBox(16, "Error", "No files found!", 5)

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

    $l = 1
    Do
    $chk = StringRegExp($aFiles[$l], "(?i:.*\.jpg|.*\.png|.*\.bmp|.*\.gif)", 3)
    If @error Then
    _ArrayDelete($aFiles, $l)
    $l -= 1
    EndIf
    $l += 1
    Until $l = UBound($aFiles)

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

    If UBound($aFiles) = 1 Then Exit MsgBox(16, "Error", "No images found!", 5)

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

    Global $audio = _FileListToArray(@ScriptDir, "*.mp3", 1)
    Global $play = False, $rand, $a
    $a = UBound($audio) - 1
    If Not @error Then
    If $a Then
    $rand = 1
    Else
    $rand = Random(1, $a, 1)
    EndIf
    $play = True
    SoundPlay($audio[$rand])
    EndIf

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

    Fader_Init($width, $height)

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

    GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN")
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit", $hGUI[2])
    WinActivate($hGUI[2])

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

    GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND")

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

    For $k = 1 To UBound($aFiles) - 1
    Fader($imagedir & "\" & $aFiles[$k])
    Next

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

    Sleep(3000)
    _Exit(True)

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

    Func WM_ERASEBKGND($hWnd, $msg, $wParam, $lParam)
    _WinAPI_RedrawWindow($hGUI[2], 0, 0, 0)
    Return 1
    EndFunc

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

    Func Fader($image, $delay = 12, $speed = 3, $sleep = 1500, $display_fn = True)
    Local $a, $d = Mod($c, 2), $iW, $iH, $f, $w, $h
    $hImage = _GDIPlus_ImageLoadFromFile($image)
    $iW = _GDIPlus_ImageGetWidth($hImage)
    $iH = _GDIPlus_ImageGetHeight($hImage)

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

    If $iW < $width + 1 And $iH < $height + 1 Then
    _GDIPlus_GraphicsDrawImageRect($hGraphic[$d], $hImage, $width / 2 - $iW / 2, $height / 2 - $iH / 2, $iW, $iH)
    Else
    If $iW > $iH Then
    $f = $iW / $width
    Else
    $f = $iH / $height
    EndIf
    $w = Int($iW / $f)
    $h = Int($iH / $f)
    _GDIPlus_GraphicsDrawImageRect($hGraphic[$d], $hImage, $width / 2 - $w / 2, $height / 2 - $h / 2, $w, $h)
    EndIf
    If $display_fn Then
    _GDIPlus_GraphicsFillRect($hGraphic[$d], 0, $height - $fh, $width, $fh, $hBrush2)
    $fn = $k & "/" & UBound($aFiles) - 1 & ": " & $image & " (" & $iW & "x" & $iH & ")"
    If StringLen($fn) > Floor($width / 5.5) Then $fn = StringLeft($fn, 30) & "..." & StringRight($fn, StringLen($fn) - StringInStr($fn, "\", 0, -1) + 30)
    _GDIPlus_GraphicsDrawStringEx($hGraphic[$d], $fn, $hFont, $tLayout, $hFormat, $hBrush1)
    EndIf
    For $a = 0 To 0xFF - $speed Step $speed
    WinSetTrans($hGUI[$d], "", $a)
    WinSetTrans($hGUI[Not $d], "", 0xFF - $speed - $a)
    Sleep($delay)
    Next
    _GDIPlus_GraphicsClear($hGraphic[Not $d], "0xFF" & $bg_color)
    $c += 1
    Sleep($sleep)
    EndFunc ;==>Fader

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

    Func Fader_Init($width, $height)
    $hGUI[2] = GUICreate($title, $width, $height, -1, -1, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_DLGMODALFRAME)
    $hGUI[0] = GUICreate($title, $width, $height, 0, 0, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_MDICHILD, $hGUI[2])
    $hGUI[1] = GUICreate($title, $width, $height, 0, 0, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_MDICHILD, $hGUI[2])
    GUISetBkColor("0x" & $bg_color, $hGUI[2])
    GUISetState(@SW_SHOW, $hGUI[2])
    GUISetState(@SW_SHOW, $hGUI[0])
    GUISetState(@SW_SHOW, $hGUI[1])
    WinSetTrans($hGUI[0], "", 0x00)
    WinSetTrans($hGUI[1], "", 0x00)
    _GDIPlus_Startup()
    $hGraphic[0] = _GDIPlus_GraphicsCreateFromHWND($hGUI[0])
    $hGraphic[1] = _GDIPlus_GraphicsCreateFromHWND($hGUI[1])
    _GDIPlus_GraphicsClear($hGraphic[0], "0xFF" & $bg_color)
    _GDIPlus_GraphicsClear($hGraphic[1], "0xFF" & $bg_color)
    $hBrush1 = _GDIPlus_BrushCreateSolid(0xFFF0F080)
    $hBrush2 = _GDIPlus_LineBrushCreate(0, 0, $width, $fh, 0xD0101020, 0x08D0D080, 0x03)
    $hFormat = _GDIPlus_StringFormatCreate()
    $hFamily = _GDIPlus_FontFamilyCreate("Arial")
    $hFont = _GDIPlus_FontCreate($hFamily, $fsize)
    $tLayout = _GDIPlus_RectFCreate(0, $height - $fh, 0, 0)
    EndFunc ;==>Fader_Init

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

    Func _Exit($end = False)
    GUIRegisterMsg($WM_LBUTTONDOWN, "")
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_BrushDispose($hBrush1)
    _GDIPlus_BrushDispose($hBrush2)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_GraphicsDispose($hGraphic[0])
    _GDIPlus_GraphicsDispose($hGraphic[1])
    GUIDelete($hGUI[0])
    GUIDelete($hGUI[1])
    GUIDelete($hGUI[2])
    _GDIPlus_Shutdown()
    If $play Then SoundPlay("")
    If $end Then Exit MsgBox(0, "Information", "End reached! Closing in 10 seconds!", 10)
    Exit
    EndFunc ;==>_Exit

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

    Func _GDIPlus_LineBrushCreate($nX1, $nY1, $nX2, $nY2, $iARGBClr1, $iARGBClr2, $iWrapMode = 0)
    Local $tPointF1, $pPointF1
    Local $tPointF2, $pPointF2
    Local $aResult
    $tPointF1 = DllStructCreate("float;float")
    $pPointF1 = DllStructGetPtr($tPointF1)
    $tPointF2 = DllStructCreate("float;float")
    $pPointF2 = DllStructGetPtr($tPointF2)
    DllStructSetData($tPointF1, 1, $nX1)
    DllStructSetData($tPointF1, 2, $nY1)
    DllStructSetData($tPointF2, 1, $nX2)
    DllStructSetData($tPointF2, 2, $nY2)
    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", $iARGBClr1, "uint", $iARGBClr2, "int", $iWrapMode, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Return $aResult[6]
    EndFunc ;==>_GDIPlus_LineBrushCreate

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

    Func _WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam)
    _SendMessage($hGUI[2], $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
    EndFunc ;==>_WM_LBUTTONDOWN

    [/autoit]

    Läuft sauber nur auf Vista+ Betriebssystemen!!! Sollte jetzt auch unter WinXP funzen!


    Gruß,
    UEZ

    Dateien

    Simple Image Slideshow.au3 6,73 kB – 616 Downloads
  • GDI+ Bitmap "trapezoid" zeichnen / DrawImage_4Points

    • UEZ
    • 23. November 2010 um 22:08

    Hi Andy,

    da ich und auch die anderen mit dem Backbuffer arbeiten,

    [autoit]


    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iX, $iY, $hGraphics)
    $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)

    [/autoit]


    wäre es klasse, wenn wir das Bild auch direkt in den Backbuffer ($hBackbuffer) schreiben könnten!

    Geht das?

    Gruß,
    UEZ

  • Visuelle Darstellung von wav Audiodateien

    • UEZ
    • 21. November 2010 um 23:12

    Suche mal den Bass.dll und eukalyptus!

    Hier ist was, was nur teilweise in die Richtung geht: Audio Visualization Collection

    Gruß,
    UEZ

  • [GDI+] Verwischen / Unscharf machen

    • UEZ
    • 21. November 2010 um 20:16

    Hier ein Beispiel von Authenticity (dem GDIp.au3 Ersteller):

    Spoiler anzeigen
    [autoit]


    #include <GDIplus.au3>

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

    Global Const $GDIP_BLUREFFECT = "{633C80A4-1843-482b-9EF2-BE2834C5FDD4}"
    Global Const $GDIP_SHARPENEFFECT = "{63CBF3EE-C526-402c-8F71-62C540BF5142}"
    Global Const $GDIP_COLORMATRIXEFFECT = "{718F2615-7933-40e3-A511-5F68FE14DD74}"
    Global Const $GDIP_COLORLUTEFFECT = "{A7CE72A9-0F7F-40d7-B3CC-D0C02D5C3212}"
    Global Const $GDIP_BRIGHTNESSCONTRASTEFFECT = "{D3A1DBE1-8EC4-4c17-9F4C-EA97AD1C343D}"
    Global Const $GDIP_HUESATURATIONLIGHTNESSEFFECT = "{8B2DD6C3-EB07-4d87-A5F0-7108E26A9C5F}"
    Global Const $GDIP_LEVELSEFFECT = "{99C354EC-2A31-4f3a-8C34-17A803B33A25}"
    Global Const $GDIP_TINTEFFECT = "{1077AF00-2848-4441-9489-44AD4C2D7A2C}"
    Global Const $GDIP_COLORBALANCEEFFECT = "{537E597D-251E-48da-9664-29CA496B70F8}"
    Global Const $GDIP_REDEYECORRECTIONEFFECT = "{74D29D05-69A4-4266-9549-3CC52836B632}"
    Global Const $GDIP_COLORCURVEEFFECT = "{DD6A0022-58E4-4a67-9D9B-D48EB881A53D}"

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

    _GDIPlus11_Startup()
    If @error Then Exit MsgBox(0x10, "Error", "GDIPlus v1.1 is not installed")

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

    ;~ _GDIPlus_Startup()

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

    Local $hGUI, $hGraphics, $hImage, $hBlurredImage, $hEffect, $file
    $file = FileOpenDialog("Select Image", "", "Images (*.jpg;*.png;*.bmp;*.gif)")
    If @error Then Exit
    $hImage = _GDIPlus_ImageLoadFromFile($file)

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

    $hGUI = GUICreate("GDI+ v1.1 Demo Blur", _GDIPlus_ImageGetWidth($hImage), _GDIPlus_ImageGetHeight($hImage))
    GUISetState()
    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    $hEffect = _GDIPlus_EffectCreate($GDIP_BLUREFFECT)
    $hBlurredImage = _GDIPlus_BitmapCreateWithEffect($hImage, $hEffect)

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

    _GDIPlus_GraphicsDrawImage($hGraphics, $hBlurredImage, 0, 0)

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

    Do
    Until GUIGetMsg() = -3

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

    _GDIPlus_BitmapDispose($hBlurredImage)
    _GDIPlus_EffectDispose($hEffect)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_GraphicsDispose($hGraphics)

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

    _GDIPlus11_Shutdown()
    ;~ _GDIPlus_Shutdown()

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

    Func _GDIPlus_BitmapApplyEffect($hBitmap, $hEffect, $pROI = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapApplyEffect", "hwnd", $hBitmap, "hwnd", $hEffect, "ptr", $pROI, "int", 0, "ptr*", 0, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
    EndFunc

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

    Func _GDIPlus_BitmapCreateWithEffect($hBitmap, $hEffect, $pROI = 0, $pOutRect = 0)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapCreateApplyEffect", "ptr*", $hBitmap, "int", 1, "hwnd", $hEffect, "ptr", $pROI, "ptr", $pOutRect, "int*", 0, "int", 0, "ptr*", 0, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Return SetError($aResult[0], 0, $aResult[6])
    EndFunc

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

    Func _GDIPlus_EffectCreate($sEffectGUID)
    Local $iI, $tGUID, $pGUID, $tElem, $aElem[4], $aResult

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

    $tGUID = _WinAPI_GUIDFromString($sEffectGUID)
    $pGUID = DllStructGetPtr($tGUID)

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

    $tElem = DllStructCreate("int[4]", $pGUID)
    For $iI = 1 To 4
    $aElem[$iI-1] = DllStructGetData($tElem, 1, $iI)
    Next

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

    $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateEffect", "int", $aElem[0], "int", $aElem[1], "int", $aElem[2], "int", $aElem[3], "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Return SetError($aResult[0], 0, $aResult[5])
    EndFunc

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

    Func _GDIPlus_EffectDispose($hEffect)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipDeleteEffect", "hwnd", $hEffect)

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

    If @error Then Return SetError(@error, @extended, 0)
    Return SetError($aResult[0], 0, $aResult[0] = 0)
    EndFunc

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

    Func _GDIPlus11_Startup()
    Local $pInput, $tInput, $pToken, $tToken, $aResult, $os

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

    $giGDIPRef += 1
    If $giGDIPRef > 1 Then Return True

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

    If @OSVersion = "WIN_VISTA" Then
    $ghGDIPDll = DllOpen(@WindowsDir & "\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.6000.16386_none_8df21b8362744ace\gdiplus.dll")
    ElseIf @OSVersion = "WIN_7" Then
    $ghGDIPDll = DllOpen(@SystemDir & "\gdiplus.dll")
    Else
    Return SetError(1)
    EndIf
    ;~ _WinAPI_Check("_GDIPlus_Startup (GDIPlus.dll not found)", @error, False)

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

    $tInput = DllStructCreate($tagGDIPSTARTUPINPUT)
    $pInput = DllStructGetPtr($tInput)
    $tToken = DllStructCreate("int Data")
    $pToken = DllStructGetPtr($tToken)
    DllStructSetData($tInput, "Version", 1)
    $aResult = DllCall($ghGDIPDll, "int", "GdiplusStartup", "ptr", $pToken, "ptr", $pInput, "ptr", 0)
    If @error Then Return SetError(@error, @extended, False)
    $giGDIPToken = DllStructGetData($tToken, "Data")
    Return $aResult[0] = 0
    EndFunc

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

    Func _GDIPlus11_Shutdown()
    If $ghGDIPDll = 0 Then Return SetError(-1, -1, False)

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

    $giGDIPRef -= 1
    If $giGDIPRef = 0 Then
    DllCall($ghGDIPDll, "none", "GdiplusShutdown", "ptr", $giGDIPToken)
    DllClose($ghGDIPDll)
    $ghGDIPDll = 0
    EndIf
    Return True
    EndFunc

    [/autoit]

    Solle ab Vista+ laufen!

    Gruß,
    UEZ

  • Gui in dem Bilder angezeit werden

    • UEZ
    • 21. November 2010 um 19:57

    Ich weiß nicht, ob du das hier meinst:

    Spoiler anzeigen
    [autoit]


    ; #DANKE# ====================================================================================================================
    ;
    ; Ersteinmal Vielen Dank an ....: UEZ
    ; Author (Hauptprogramm)........: UEZ
    ; Author (Function).............: UEZ
    ; Weiterentwickelt von .........: GHF
    ; Natürlich mit Hilfe von.......: UEZ und den AutoIt Forum Mitgliedern
    ;
    ; #DANKE# ====================================================================================================================
    #include <Array.au3>
    #include <GDIPlus.au3>
    #include <GuiComboBoxEx.au3>
    #include <GuiImageList.au3>
    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <GuiConstantsEx.au3>
    #include <File.au3>
    #include <WindowsConstants.au3>
    #Include <WinAPIEx.au3>
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <StaticConstants.au3>
    $hGUI1 = GUICreate("Daten werden geladen ...", 400, 80)
    GUISetBkColor(0xFFFFFF)
    GuiCtrlCreateProgress(100, 20, 150, 20)
    GuiCtrlSetData(-1, 5)
    GuiCtrlSetData(-1, 10)
    GuiCtrlSetData(-1, 15)
    GuiCtrlSetData(-1, 20)
    GuiCtrlSetData(-1, 40)
    GuiCtrlSetData(-1, 60)
    GuiCtrlSetData(-1, 75)
    GuiCtrlSetData(-1, 80)
    GuiCtrlSetData(-1, 85)
    GuiCtrlSetData(-1, 96)
    GuiCtrlCreateLabel("Status:", 10, 22, 100)
    GUICtrlSetFont(-1, 11, 800, 0, "Arial")
    GUICtrlSetColor(-1, 0x000000)
    GUICtrlCreateLabel("26.10.2010"&@CRLF&"Version: 0.0.1", 240, 9, 150, -1, $ES_RIGHT)
    GUICtrlSetFont(-1, 10, 400, 4, "Arial")
    GuiCtrlCreateLabel("(Daten werden geladen bitte haben Sie etwas geduld)", 10, 55, 400, 30)
    GUICtrlSetFont(-1, 11, 800, 0, "Arial")
    GUICtrlSetColor(-1, 0x000000)
    GUISetState(@SW_SHOW)
    _GDIPlus_Startup()
    $image_path = (@ScriptDir & '\include01\')
    $image_pathover = (@ScriptDir & '\include02\')
    Global $hPic = -99
    Global $hPicover = -99
    $count = _FileListToArray($image_path, "*.gif", 1)
    $countover = _FileListToArray($image_pathover, "*.gif", 1)
    If Not IsArray($count) Then Exit MsgBox(16, "Fehler", "Fehlende Dateien in " & $image_path, 10)
    If Not IsArray($countover) Then Exit MsgBox(16, "Fehler", "Fehlende Dateien in " & $image_pathover, 10)
    $hGUI = GUICreate("Bild1 und Bild2 - Vorschau", 798, 655)
    GUISetBkColor(0xFFFFFF)
    $hComboover = _GUICtrlComboBoxEx_Create($hGUI, "", 640, 15, 70, 335, $CBS_DROPDOWNLIST)
    Dim $bitmap_from_file[$countover[0] + 1]
    _GDIPlus_Startup()
    $iCX = 48
    $iCY = 48
    $hImageover = _GUIImageList_Create(48, 48, 5, 1)
    For $i = 1 To $countover[0]
    _GUIImageList_AddBitmapEx($hImageover, $image_pathover & "\" & $countover[$i], $iCX, $iCY)
    Next
    _GUICtrlComboBoxEx_SetImageList($hComboover, $hImageover)
    For $i = 0 To $countover[0] - 1
    _GUICtrlComboBoxEx_AddString($hComboover, $image_pathover & "\" & $countover[$i], $i, $i)
    Next
    _GUICtrlComboBoxEx_SetItemHeight($hComboover, 0, 51)
    _GUICtrlComboBoxEx_SetCurSel($hComboover, 0)
    $bottonover = GUICtrlCreateButton("Bild1 anzeigen", 715, 14, 60, 56, $BS_MULTILINE)
    $hCombo = _GUICtrlComboBoxEx_Create($hGUI, "", 640, 76, 70, 335, $CBS_DROPDOWNLIST)
    Dim $bitmap_from_file[$count[0] + 1]
    _GDIPlus_Startup()
    $iCX = 48
    $iCY = 48
    $hImage = _GUIImageList_Create(48, 48, 5, 1)
    For $i = 1 To $count[0]
    _GUIImageList_AddBitmapEx($hImage, $image_path & "\" & $count[$i], $iCX, $iCY)
    Next
    _GUICtrlComboBoxEx_SetImageList($hCombo, $hImage)
    For $i = 0 To $count[0] - 1
    _GUICtrlComboBoxEx_AddString($hCombo, $image_path & "\" & $count[$i], $i, $i)
    Next
    _GUICtrlComboBoxEx_SetItemHeight($hCombo, 0, 51)
    _GUICtrlComboBoxEx_SetCurSel($hCombo, 0)
    $botton = GUICtrlCreateButton("Bild2 anzeigen", 715, 75, 60, 56, $BS_MULTILINE)
    $Textanzeigen1 = GUICtrlCreateButton("Text 1", 640, 350, 150, 25, $BS_CENTER)
    $Textanzeigen2 = GUICtrlCreateButton("Text 2", 640, 380, 150, 25, $BS_CENTER)
    $SaveButton = GUICtrlCreateButton("SAVE", 640, 410, 150, 25, $BS_CENTER)
    $Software1 = GUICtrlCreateButton(" Soft1 Starten", 640, 440, 150, 25, $BS_CENTER)
    $Info = GUICtrlCreateButton(" Info zur Software", 640, 470, 150, 25, $BS_CENTER)
    $Button1 = GUICtrlCreateButton(" ", 640, 500, 150, 25, $BS_CENTER)
    $Button2 = GUICtrlCreateButton(" ", 640, 530, 150, 25, $BS_CENTER)
    $Button3 = GUICtrlCreateButton(" ", 640, 560, 150, 25, $BS_CENTER)
    GUICtrlCreateLabel("Version: 0.0.1", 640, 630, 100, -1, $ES_LEFT)
    GUICtrlSetFont(-1, 10, 400, 4, "Arial")
    GUISetState(@SW_HIDE, $hGUI1)
    GUISetState(@SW_SHOW, $hGUI)
    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $gui_event_close
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
    Exit
    Case $msg = $bottonover
    $iItemover = _GUICtrlComboBoxEx_GetCurSel($hComboover)+1
    $aItemover = _GUICtrlComboBoxEx_GetItem($hComboover,$iItemover)
    $hImageover = _GDIPlus_BitmapCreateFromFile ($aItemover[0])
    $iX = _GDIPlus_ImageGetWidth($hImageover)
    $iY = _GDIPlus_ImageGetHeight($hImageover)
    _GDIPlus_BitmapDispose($hImageover)
    $iRatio = $iX / $iY
    if $iRatio >= 1 Then
    $iX = 300
    $iY = 300
    Else
    $iY = 300
    $iX = 300
    EndIf
    if $hPicover <> -99 then GUICtrlDelete($hPicover)
    $hPicover = GUICtrlCreatePic($aItemover[0], 175, 110, $iX , $iY)
    Case $msg = $botton
    $iItem = _GUICtrlComboBoxEx_GetCurSel($hCombo)+1
    $aItem = _GUICtrlComboBoxEx_GetItem($hCombo,$iItem)
    $hImage = _GDIPlus_BitmapCreateFromFile ($aItem[0])
    $iX = _GDIPlus_ImageGetWidth($hImage)
    $iY = _GDIPlus_ImageGetHeight($hImage)
    _GDIPlus_BitmapDispose($hImage)
    $iRatio = $iX / $iY
    if $iRatio >= 1 Then
    $iX = 650
    $iY = 600
    Else
    $iY = 650
    $iX = 600
    EndIf

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

    if $hPic <> -99 then GUICtrlDelete($hPic)
    $hPic = GUICtrlCreatePic($aItem[0], 0, 20, $iX, $iY)
    Case $msg = $Info
    If $Info Then ContinueLoop MsgBox(64, "Info: Bitte Lesen", "Bedienungsanleitung:"&@CRLF&""&@CRLF&"1. Motiv auswählen"&@CRLF&"Motiv anzeigen Button anklicken"&@CRLF&" "&@CRLF&"2. Produkt auswählen"&@CRLF&"Produkt anzeigen Button anklicken"&@CRLF&" "&@CRLF&" "&@CRLF&" ")
    Exit
    Case $msg = $Software1
    ShellExecute("Soft1.exe")
    Case $msg = $SaveButton

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

    ;~ $himg2 = _GDIPlus_ImageLoadFromFile($aItem[0])
    ;~ $himg3 = _GDIPlus_ImageLoadFromFile($aItemover[0])
    $Save = FileSaveDialog("Speichere Bild", @ScriptDir, "JPG (*.JPG)")
    ;~ $ToBild2 = _GDIPlus_ImageGetGraphicsContext ($himg2)
    ;~ $iX = _GDIPlus_ImageGetWidth ($himg2)
    ;~ $iY = _GDIPlus_ImageGetHeight ($himg2)
    ;~ $iX2 = _GDIPlus_ImageGetWidth ($himg3)
    ;~ $iY2 = _GDIPlus_ImageGetHeight ($himg3)
    ;~ $a=_GDIPlus_GraphicsDrawImage ($ToBild2,$himg3, 400, 210)
    ;~ _GDIPlus_ImageSaveToFile($himg2, $Save & "")
    _GDIPlus_Save_to_Image($Save, $hGUI, 640, 655)
    If Not @error Then MsgBox(0, "Information", "Bild wurde gespeichert!")
    ;~ _GDIPlus_ImageDispose($himg2)
    ;~ _GDIPlus_ImageDispose($himg3)
    ;~ _GDIPlus_ImageDispose($himg3)
    EndSelect
    WEnd
    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GUIImageList_AddBitmapEx
    ; Description ...: Creates a bitmap from an image file (JPG, PNG, BMP, GIF, ICO, etc.) and adds it to the _GUIImageList control
    ; Syntax.........: _GUIImageList_AddBitmapEx($hWnd, $sFile, $iWidth, $iHeight)
    ; Parameters ....: $hWnd - file name where the icon should be extracted from (*.dll, *.ico, *.exe)
    ; $sFile - path to the bitmap that contains the image
    ; $iWidth - width of the _GUIImageList
    ; $iHeight - height of the _GUIImageList
    ; Return values .: Success - Returns 1
    ; Failure - @error
    ; Author ........: UEZ
    ; Version .......: 0.75 Build 2010-06-23 beta
    ; Remarks .......: <GDIPlus.au3> must be included and _GDIPlus_Startup() must be started to use GDI+ functions.
    ; Don't forget the _GDIPlus_Shutdown() when closing!
    ; ===============================================================================================================================
    Func _GUIImageList_AddBitmapEx($hWnd, $sFile, $iWidth = 48, $iHeight = 48, $iIndex = 0)
    If Not IsHWnd($hWnd) = 0 Or $sFile = "" Or Not FileExists($sFile) Or IsDeclared("ghGDIPDll") <> 1 Then Return SetError(1, 0, 0)

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

    Local $bitmap_from_file = _GDIPlus_BitmapCreateFromFile($sFile)
    If @error Then Return SetError(@error, @extended, 0)
    Local $ext = StringRight($sFile, 3)
    If $ext = "ico" Then
    Local $aRet = DllCall("shell32", "long", "ExtractAssociatedIcon", "int", 0, "str", $sFile, "word*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    Local $hIcon = $aRet[0]
    Local $hDC = _WinAPI_GetDC(0) ;thanks to Yashied
    Local $hBackDC = _WinAPI_CreateCompatibleDC($hDC)
    Local $hBitmap = _WinAPI_CreateSolidBitmap(0, _WinAPI_GetSysColor($COLOR_MENU), $iWidth, $iHeight)
    Local $hBackSv = _WinAPI_SelectObject($hBackDC, $hBitmap)
    _WinAPI_DrawIconEx($hBackDC, 0, 0, $hIcon, 0, 0, 0, 0, 3)
    _WinAPI_SelectObject($hBackDC, $hBackSv)
    _WinAPI_ReleaseDC(0, $hDC)
    _WinAPI_DeleteDC($hBackDC)
    _GUIImageList_Add($hWnd, $hBitmap)
    _WinAPI_DeleteObject($hBitmap)
    Else
    Local $iStride = 0, $iPixelFormat = 0x0026200A, $pScan0 = 0
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", $iStride, "int", $iPixelFormat, "ptr", $pScan0, "int*", 0)
    If @error Then Return SetError(@error, @extended, 0)

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

    Local $hClone = $aResult[6]
    Local $hGraphics = _GDIPlus_ImageGetGraphicsContext($hClone)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $bitmap_from_file, 0, 0, $iWidth, $iHeight)

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

    Local $hBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hClone)
    _GUIImageList_Add($hWnd, $hBmp)

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

    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_BitmapDispose($hClone)
    _WinAPI_DeleteObject($hBmp)
    EndIf
    _GDIPlus_BitmapDispose($bitmap_from_file)
    Return SetError(0, 0, 1)
    EndFunc

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

    ; #FUNCTION# =============================================================================
    ; Name...........: _GDIPlus_Save_to_Image
    ; Description ...: INTERNAL FUNCTION - save drawn image to file
    ; Syntax.........: _GraphGDIPlus_Reference_Pixel($file, $hWnd)
    ; Parameters ....: $file - filename
    ; $hWnd - handle to GUI
    ; Autor .........: ptrex, ProgAndy, UEZ
    ; =========================================================================================
    Func _GDIPlus_Save_to_Image($file, $hWnd, $w, $h, $CLSID = "JPG")
    Local $hDC, $memBmp, $memDC, $hImage, $size, $sCLSID, $err
    If $file <> "" Or $hWnd <> "" Then
    If $w < 1 And $h < 1 Then
    $size = WinGetClientSize($hWnd)
    $w = $size[0]
    $h = $size[1]
    EndIf
    $hDC = _WinAPI_GetDC($hWnd)
    $memDC = _WinAPI_CreateCompatibleDC($hDC)
    $memBmp = _WinAPI_CreateCompatibleBitmap($hDC, $w, $h)
    _WinAPI_SelectObject ($memDC, $memBmp)
    _WinAPI_BitBlt($memDC, 0, 0, $w, $h, $hDC, 0, 0, 0x00CC0020) ; 0x00CC0020 = $SRCCOPY
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP ($memBmp)
    $sCLSID = _GDIPlus_EncodersGetCLSID ($CLSID)
    ;~ _GDIPlus_ImageSaveToFile($hImage, $file)
    If Not _GDIPlus_ImageSaveToFileEx ($hImage, $file & "." & StringLower($CLSID), $sCLSID) Then $err = 1
    _GDIPlus_ImageDispose ($hImage)
    _WinAPI_ReleaseDC($hWnd, $hDC)
    _WinAPI_DeleteDC($memDC)
    _WinAPI_DeleteObject ($memBmp)
    If $err Then Return SetError(2, 0, 0)
    Return SetError(0, 0, 0)
    Else
    Return SetError(1, 0, 0)
    EndIf
    EndFunc

    [/autoit]

    Da du mit GUICtrlCreatePic() arbeitest, kann man das BIld nicht einfach abspeichern, zumindest kenne ich keine Möglichkeit. Ansonsten ist GDI+ eine Möglichkeit.

    Gruß,
    UEZ

  • GDI+ Bitmap "trapezoid" zeichnen / DrawImage_4Points

    • UEZ
    • 19. November 2010 um 17:57

    Da bin ich echt mal gespannt!


    Gruß,
    UEZ

  • Happy Birthday, Techmix

    • UEZ
    • 18. November 2010 um 23:28

    Auch von mir ein herzliches

    Code
    _  _               _ __     _ __     _  _  
     | || |    __ _     | '_ \   | '_ \   | || | 
     | __ |   / _` |    | .__/   | .__/    \_, | 
     |_||_|   \__,_|    |_|__    |_|__    _|__/  
    _|"""""| _|"""""| _|"""""| _|"""""| _| """"| 
    "`-0-0-' "`-0-0-' "`-0-0-' "`-0-0-' "`-0-0-'
       ___       _                _       _           _               _  _  
      | _ )     (_)       _ _    | |_    | |_      __| |    __ _     | || | 
      | _ \     | |      | '_|   |  _|   | ' \    / _` |   / _` |     \_, | 
      |___/    _|_|_    _|_|_    _\__|   |_||_|   \__,_|   \__,_|    _|__/  
    _|"""""| _|"""""| _|"""""| _|"""""| _|"""""| _|"""""| _|"""""| _| """"| 
    "`-0-0-' "`-0-0-' "`-0-0-' "`-0-0-' "`-0-0-' "`-0-0-' "`-0-0-' "`-0-0-'
    Alles anzeigen

    Gruß,
    UEZ

  • GDI+ Bitmap "trapezoid" zeichnen / DrawImage_4Points

    • UEZ
    • 18. November 2010 um 23:03

    Hier mal ein Versuch mit GIMP:


    Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist. Der Inhalt kann nicht angezeigt werden, da er nicht mehr verfügbar ist.

    Vielleicht hift's ja weiter!

    Gruß,
    UEZ

    Dateien

    mona-lisa_test.jpg 82,29 kB – 0 Downloads
  • GDI+ Bitmap "trapezoid" zeichnen / DrawImage_4Points

    • UEZ
    • 18. November 2010 um 22:43

    Wie füllt denn ein Malprogramm zu was? Ich kenne mich zu wenig mit Gimp aus.

    Kann jemand mal so ein Trapez zeichnen und es mit dem Bild füllen?

    Gruß,
    UEZ

  • AntiSpeed hat B-Day

    • UEZ
    • 16. November 2010 um 19:45
    Code
    ,ggg,        gg                                                
    dP""Y8b       88                                                
    Yb, `88       88                                                
     `"  88       88                                                
         88aaaaaaa88                                                
         88"""""""88    ,gggg,gg  gg,gggg,    gg,gggg,    gg     gg 
         88       88   dP"  "Y8I  I8P"  "Yb   I8P"  "Yb   I8     8I 
         88       88  i8'    ,8I  I8'    ,8i  I8'    ,8i  I8,   ,8I 
         88       Y8,,d8,   ,d8b,,I8 _  ,d8' ,I8 _  ,d8' ,d8b, ,d8I 
         88       `Y8P"Y8888P"`Y8PI8 YY88888PPI8 YY88888PP""Y88P"888
                                  I8          I8               ,d8I'
                                  I8          I8             ,dP'8I 
                                  I8          I8            ,8"  8I 
                                  I8          I8            I8   8I 
                                  I8          I8            `8, ,8I 
                                  I8          I8             `Y8P"  
    
    
     ,ggggggggggg,                                                                         
    dP"""88""""""Y8,                    I8    ,dPYb,             8I                        
    Yb,  88      `8b                    I8    IP'`Yb             8I                        
     `"  88      ,8P  gg             88888888 I8  8I             8I                        
         88aaaad8P"   ""                I8    I8  8'             8I                        
         88""""Y8ba   gg    ,gggggg,    I8    I8 dPgg,     ,gggg,8I    ,gggg,gg  gg     gg 
         88      `8b  88    dP""""8I    I8    I8dP" "8I   dP"  "Y8I   dP"  "Y8I  I8     8I 
         88      ,8P  88   ,8'    8I   ,I8,   I8P    I8  i8'    ,8I  i8'    ,8I  I8,   ,8I 
         88_____,d8'_,88,_,dP     Y8, ,d88b, ,d8     I8,,d8,   ,d8b,,d8,   ,d8b,,d8b, ,d8I 
        88888888P"  8P""Y88P      `Y8 8P""Y8 88P     `Y8P"Y8888P"`Y8P"Y8888P"`Y8P""Y88P"888
                                                                                      ,d8I'
                                                                                    ,dP'8I 
                                                                                   ,8"  8I 
                                                                                   I8   8I 
                                                                                   `8, ,8I 
                                                                                    `Y8P"
    Alles anzeigen


    Gruß,
    UEZ

  • PNG als Gui (Transparent)

    • UEZ
    • 16. November 2010 um 15:39

    Probiere das mal:

    Spoiler anzeigen
    [autoit]


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

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

    Global $hGUI, $hImage, $hGraphic, $hImage
    Global Const $SC_DRAGMOVE = 0xF012

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

    ; Create GUI
    $hGUI = GUICreate("Show PNG", 350, 550, -1, -1, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST)
    GUISetBkColor(0x01, $hGUI)
    GUISetState()
    _WinAPI_SetLayeredWindowAttributes($hGUI, 0x01, 0xFF, 3)

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

    ; Load PNG image
    _GDIPlus_StartUp()
    $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir& "\Trans.png")
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0)

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

    $Input1 = GUICtrlCreateInput("Input1", 156, 232, 121, 21)
    $Input2 = GUICtrlCreateInput("Input2", 156, 256, 121, 21)
    $Input3 = GUICtrlCreateInput("Input3", 156, 280, 121, 21)
    $Slider1 = GUICtrlCreateSlider(128, 312, 150, 45)
    $Button1 = GUICtrlCreateButton("Start", 208, 376, 75, 25)

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

    GUIRegisterMsg($WM_PAINT, "MY_WM_PAINT")

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    ExitLoop
    Case $Button1
    ExitLoop
    Case $GUI_EVENT_PRIMARYDOWN
    _SendMessage($hGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
    EndSwitch
    WEnd

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

    ; Clean up resources
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_ShutDown()
    Exit

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

    ; Draw PNG image
    Func MY_WM_PAINT($hWnd, $Msg, $wParam, $lParam)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0)
    _WinAPI_RedrawWindow($hGUI, 0, 0, 1)
    Return $GUI_RUNDEFMSG
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • _arrayadd

    • UEZ
    • 14. November 2010 um 22:23

    Hier eine Variante auf die Schnelle erstellt:

    [autoit]


    #include <Array.au3>

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

    Dim $aPing[1]
    $aPing[0] = "www.google.de"

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

    AdlibRegister("Ping_Result", 5000)

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

    HotKeySet("{Esc}", "_Exit")

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

    While Sleep(100)
    WEnd

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

    Func Ping_Result()
    _ArrayAdd($aPing, Ping($aPing[0]))
    EndFunc

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

    Func _Exit()
    AdlibUnRegister("Ping_Result")
    _ArrayDisplay($aPing)
    Exit
    EndFunc

    [/autoit]

    Gruß,
    UEZ

  • Xenobiologist wird heute 31 Jahre

    • UEZ
    • 13. November 2010 um 16:43

    Auch von mir nachträglich:

    PHP
    .-. .-.   .--.    ,---.    ,---.   .-.   .-.
     | | | |  / /\ \   | .-.\   | .-.\   \ \_/ )/
     | `-' | / /__\ \  | |-' )  | |-' )   \   (_)
     | .-. | |  __  |  | |--'   | |--'     ) (   
     | | |)| | |  |)|  | |      | |        | |   
     /(  (_) |_|  (_)  /(       /(        /(_|   
    (__)              (__)     (__)      (__)  
     ,---.   ,-. ,---.     _______  .-. .-.  ,'|"\     .--.   .-.   .-.
     | .-.\  |(| | .-.\   |__   __| | | | |  | |\ \   / /\ \   \ \_/ )/
     | |-' \ (_) | `-'/     )| |    | `-' |  | | \ \ / /__\ \   \   (_)
     | |--. \| | |   (     (_) |    | .-. |  | |  \ \|  __  |    ) (   
     | |`-' /| | | |\ \      | |    | | |)|  /(|`-' /| |  |)|    | |   
     /( `--' `-' |_| \)\     `-'    /(  (_) (__)`--' |_|  (_)   /(_|   
    (__)             (__)          (__)                        (__)
    Alles anzeigen

    Gruß,
    UEZ

  • AutoBert hat Geburtstag

    • UEZ
    • 13. November 2010 um 15:53

    Auch von mir ein

    PHP
    ,--,                                                 
          ,--.'|                                                 
       ,--,  | :               ,-.----.   ,-.----.               
    ,---.'|  : '               \    /  \  \    /  \              
    |   | : _' |               |   :    | |   :    |             
    :   : |.'  |    ,--.--.    |   | .\ : |   | .\ :       .--,  
    |   ' '  ; :   /       \   .   : |: | .   : |: |     /_ ./|  
    '   |  .'. |  .--.  .-. |  |   |  \ : |   |  \ :  , ' , ' :  
    |   | :  | '   \__\/: . .  |   : .  | |   : .  | /___/ \: |  
    '   : |  : ;   ," .--.; |  :     |`-' :     |`-'  .  \  ' |  
    |   | '  ,/   /  /  ,.  |  :   : :    :   : :      \  ;   :  
    ;   : ;--'   ;  :   .'   \ |   | :    |   | :       \  \  ;  
    |   ,/       |  ,     .-./ `---'.|    `---'.|        :  \  \ 
    '---'         `--`---'       `---`      `---`         \  ' ; 
                                                           `--`  
    
        ,---,.                          ___       ,---,                                           
      ,'  .'  \   ,--,                ,--.'|_   ,--.' |           ,---,                           
    ,---.' .' | ,--.'|      __  ,-.   |  | :,'  |  |  :         ,---.'|                           
    |   |  |: | |  |,     ,' ,'/ /|   :  : ' :  :  :  :         |   | :                           
    :   :  :  / `--'_     '  | |' | .;__,'  /   :  |  |,--.     |   | |    ,--.--.          .--,  
    :   |    ;  ,' ,'|    |  |   ,' |  |   |    |  :  '   |   ,--.__| |   /       \       /_ ./|  
    |   :     \ '  | |    '  :  /   :__,'| :    |  |   /' :  /   ,'   |  .--.  .-. |   , ' , ' :  
    |   |   . | |  | :    |  | '      '  : |__  '  :  | | | .   '  /  |   \__\/: . .  /___/ \: |  
    '   :  '; | '  : |__  ;  : |      |  | '.'| |  |  ' | : '   ; |:  |   ," .--.; |   .  \  ' |  
    |   |  | ;  |  | '.'| |  , ;      ;  :    ; |  :  :_:,' |   | '/  '  /  /  ,.  |    \  ;   :  
    |   :   /   ;  :    ;  ---'       |  ,   /  |  | ,'     |   :    :| ;  :   .'   \    \  \  ;  
    |   | ,'    |  ,   /               ---`-'   `--''        \   \  /   |  ,     .-./     :  \  \ 
    `----'       ---`-'                                       `----'     `--`---'          \  ' ; 
                                                                                            `--`  
                              _       
                             ( `.     
     ,.--.                    '. \    
    //    \                     \ \   
    \\    /   ,.----------.      \ \  
     `'--'   //            \      ' . 
     ,.--.   \\            /      | | 
    //    \   `'----------'       ' ' 
    \\     |                     / /  
     `'-) /                     / /   
       /.'                    .' /    
                             (_.'
    Alles anzeigen


    Gruß,
    UEZ

  • GDI+ Bitmap "trapezoid" zeichnen / DrawImage_4Points

    • UEZ
    • 13. November 2010 um 11:42

    Was soll ich da noch sagen? TOP :thumbup:

    "Die Pfade" scheinen richtig mächtig zu sein, wenn man weiß, wie sie funktionieren! :whistling:

    Die Direct2D / Direct3D Sachen sind ja auch krass und da ist bereits diese Funktion enthalten, aber der Kick ist es, dass in GDI+ zu implementieren! :D

    Die Symbiose von GDI+ und ASM würde den Turbo einschalten, aber muss man erst mal ASM können...

    Gruß,
    UEZ

  • _GetMinMaxNumber kleinsten, größten Wert aus Singlevariablen und/oder 1D-Arrays ermitteln

    • UEZ
    • 12. November 2010 um 21:59

    So was meine ich:

    Spoiler anzeigen
    [autoit]


    #include <Array.au3>

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

    $numbers = "40,3,-2.5,-10,1000,-20202.188, +50,-1.937462,3.14"
    ConsoleWrite("Fünftkleinste Zahl: " & nNumber($numbers, 5, 0) & @CRLF) ; fünftkleinste Zahl
    ConsoleWrite("Drittgrößte Zahl: " & nNumber($numbers, 3, 1) & @CRLF) ; drittgrößte Zahl

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

    ; #FUNCTION# =====================================================================================================================
    ; Name...........: nNumber
    ; Description ...: Returns the n biggest or smallest number
    ; Syntax.........: nNumber($numbers, $n, $dir = 0)
    ; Parameters ....: $numbers - the numbers either from a string or from an array
    ; $n - search for n biggest or smallest number where n is an integer
    ; $dir - 0 search for smallest number, 1 for biggest number
    ; Return values .: Success - Returns the appropriate number and set @error to 0
    ; Failure - Returns error code:
    ; 1 - Wrong delimiter in string! Valid is comma (,) only!
    ; 2 - No numbers found!
    ; 3 - n is not an integer
    ; 4 - n is not in boundary of amount of numbers
    ; Remarks .......: Needs the function CompSort() for sorting the internal array
    ; Author ........: UEZ
    ; Version .......: 0.90 Build 2010-11-11 Beta
    ; ================================================================================================================================
    Func nNumber($numbers, $n, $dir = 0)
    If IsArray($numbers) Then
    $num = _ArrayToString($numbers, ",")
    If @error Then Return SetError(1, 0, "Error! Wrong delimiter in string! Valide is comma (,) only!")
    $numbers = $num
    EndIf
    Local $aNum = StringRegExp($numbers, "(-\d+\.\d+|\d+\.\d+|\d+)", 3)
    If Not IsArray($aNum) Then Return SetError(2, 0, "Error! No numbers found!")
    If Not IsInt($n) Then Return SetError(3, 0, "Error! n is not an integer")
    If $n < 1 Or $n > UBound($aNum) - 1 Then Return SetError(4, 0, "Error! n is not in boundary of amount of numbers")
    CompSort($aNum)
    If Not $dir Then Return SetError(0, 0, $aNum[$n - 1]) ;n smallest number
    Return SetError(0, 0, $aNum[UBound($aNum) - $n]) ;n biggest number
    EndFunc

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

    ;Die Komplexität liegt je nach Ausgangssituation zwischen O(n^2) (Worst-Case) und O(n*log(n)) (Best-Case).
    ;Im Best-Case ist die Liste der zu sortierenden Elemente geordnet, sobald die Schrittlänge 1 beträgt.
    ;Im Worst-Case müssen alle benachbarten Elemente nochmals getauscht werden (mehrere Durchgänge mit Schrittlänge 1).
    ;In diesem Fall ist Combsort nicht schneller als Bubblesort.
    ;Speicherverbrauch: O(c)
    ;Shrink-Faktor: 1/(1-1/e^phi) = 1.247330950103979, phi = 1.61803398874994
    Func CompSort(ByRef $aArray)
    Local $gap = UBound($aArray)
    Local $swaps, $i, $tmp
    Do
    $gap = Int($gap / 1.247330950103979)
    If $gap < 1 Then $gap = 1
    $i = 0
    $swaps = 0
    Do
    If Number($aArray[$i]) > Number($aArray[$i + $gap]) Then
    $tmp= Number($aArray[$i])
    $aArray[$i] = Number($aArray[$i + $gap])
    $aArray[$i + $gap] = $tmp
    $swaps = 1
    EndIf
    $i += 1
    Until $i + $gap > UBound($aArray) - 1
    Until $gap = 1 And $swaps = 0
    EndFunc

    [/autoit]

    Der Sortieralg. ist nicht der Schnellste. ;)

    Gruß,
    UEZ

  • _GetMinMaxNumber kleinsten, größten Wert aus Singlevariablen und/oder 1D-Arrays ermitteln

    • UEZ
    • 12. November 2010 um 14:40

    Eigentlich meine ich, dass du ein String oder ein Array übergibst und du z.B. die 7 größte oder 4 kleinste Zahl haben willst .

    Gruß,
    UEZ

  • stringregexp StringBetween

    • UEZ
    • 12. November 2010 um 12:42

    Hier noch eine Variante:

    [autoit]


    StringRegExp($string, '"solltexttable">(.\d+)</span', 3)

    [/autoit]

    Gruß,
    UEZ

  • _GetMinMaxNumber kleinsten, größten Wert aus Singlevariablen und/oder 1D-Arrays ermitteln

    • UEZ
    • 12. November 2010 um 11:56

    Warum hast du nicht das Ganze allgemein gehalten, also z.B. für die n größte bzw. kleinste Zahl? ;)

    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™