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

  • [Beendet] µitLight April - Mitte Juni

    • UEZ
    • 2. April 2010 um 21:58
    Zitat von BugFix


    Cheat Engine

    Und eine Cheat-Engine für Captchas? Also doch Reverse Engineering!

    Gruß,
    UEZ

  • Religion (Umfrage)

    • UEZ
    • 2. April 2010 um 21:55

    Man kann ja an einen "Schöpfer" glauben, ohne einer Religionsgemeinschaft anzugehören!

    Meine persönliche Meinung zu Religion ist, dass Religion die größte Lüge an der Menschheit ist, wobei Religion in den Wurzeln nichts Schlechtes ist! Religion wurde von den Menschen erschaffen!

    Gruß,
    UEZ

  • [Beendet] µitLight April - Mitte Juni

    • UEZ
    • 2. April 2010 um 21:38
    Zitat von MatthiasG.

    UEZ:

    Zu 3.: Testen mit Cheat-Engine

    Zu 5.: Augenmaß, wenn das Bild klar ist und die Buchstaben z.B. nicht verzerrt o.ä. ist, gibt es Möglichkeiten. Ich werde natürlich nicht einen Bot schreiben. Dazu fehlt mir auch die Zeit ;)

    Zu 3: Was ist eine Cheat-Engine genau? Reverse Engineering?
    Zu 5: naja, dann denke ich, dass das Ganze keinen Sinn macht, wenn man nicht algorithmisch prüfen kann, ob der Captcha gut ist oder nicht! Ob ein Captcha gut ist nur "aus dem Bauch" zu entscheiden, ist zu sehr subjektiv!

    Gruß,
    UEZ

  • [Beendet] µitLight April - Mitte Juni

    • UEZ
    • 2. April 2010 um 15:34
    Zitat von MatthiasG.

    ...
    3. Sicherheit gegnüber Cheat-Engine
    ...
    5. Botsicher
    ...

    Wie wird gemessen, ob ein Captcha gut ist?

    Gruß,
    UEZ

  • GDI+ Backbuffer will nicht :D

    • UEZ
    • 1. April 2010 um 18:40

    Im Prinzip hast du das Kopieren vom Backbuffer in das sichtbare Fenster vergessen!

    Spoiler anzeigen
    [autoit]


    #include <WindowsConstants.au3>
    #include <GDIPlus.au3>
    Opt("GUIOnEventMode",2)
    OnAutoItExitRegister("_Exit")
    Global $GuiWidth = 400, $GuiHeight = 400
    Global $Charcoords[4] = [-200,100,200,200]
    Global $Speed = 1
    _GDIPlus_Startup()
    Global $Red = _GDIPlus_BrushCreateSolid(0xFFFF0000)
    Global $White = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
    $Gui1 = GUICreate("GDI+ Erste Schritte",$GuiWidth,$GuiHeight)
    $Grapic1 = _GDIPlus_GraphicsCreateFromHWND($Gui1)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($GuiWidth, $GuiHeight, $Grapic1) ; Bitmap-Objekt mit bezug auf unsere Grafik erstellen
    $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap) ; Grafik-Kontext holen.
    GUISetOnEvent(-3,"_Exit")
    GUiSetState()
    While 1 * Sleep(10)
    _Erneuern()
    WEnd

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

    Func _Exit()
    _GDIPlus_BrushDispose($Red)
    _GDIPlus_BrushDispose($White)
    _GDIPlus_GraphicsDispose($hBackbuffer)
    _GDIPlus_GraphicsDispose($Grapic1)
    _GDIPlus_Shutdown()
    Exit
    EndFunc
    Func _Erneuern()
    $Charcoords[0] = $Speed + $Charcoords[0]
    If $Charcoords[0] > $GuiWidth Then $Charcoords[0] = -200
    _GDIPlus_GraphicsClear($hBackbuffer,0xFFF0F0F0)
    _GDIPlus_GraphicsFillRect($hBackbuffer,$Charcoords[0],$Charcoords[1],$Charcoords[2],$Charcoords[3])
    _GDIPlus_GraphicsDrawImageRect($Grapic1, $hBitmap, 0, 0, $GuiWidth, $GuiHeight) ;backbuffer in das sichtbare Fenster kopieren!
    EndFunc

    [/autoit]


    Gruß,

    UEZ

  • [Beendet] µitLight März

    • UEZ
    • 31. März 2010 um 23:56

    Hier der Atkin's Code in einer nicht optimierten Version:

    Spoiler anzeigen
    [autoit]


    Func Atkin_Prim_Calc($limes) ;using Atkin's algorithm
    $limes += 1
    Local $prime[$limes]
    Local $i, $k, $n, $nn, $w, $x, $xx, $y, $yy, $prime_numbers
    $w = Sqrt($limes)
    For $x = 1 To $w
    $xx = $x * $x ;x^2
    For $y = 1 To $w

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

    $yy = $y * $y ;y^2
    $n = $xx + $xx + $xx + $xx + $yy ;4 * x^2 + y^2
    If ($n < $limes) And (Mod($n, 12) = 1 Or Mod($n, 12) = 5) Then
    If $prime[$n] Then
    $prime[$n] = 0
    else
    $prime[$n] = 1
    EndIf
    EndIf

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

    $n = $xx + $xx + $xx + $yy ;3 * x^2 + y^2
    If $n < $limes And Mod($n, 12) = 7 Then
    If $prime[$n] Then
    $prime[$n] = 0
    else
    $prime[$n] = 1
    EndIf
    EndIf

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

    $n = $xx + $xx + $xx - $yy ;4 * x^2 - y^2
    If $x > $y And $n < $limes And Mod($n, 12) = 11 Then
    If $prime[$n] Then
    $prime[$n] = 0
    else
    $prime[$n] = 1
    EndIf
    EndIf

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

    Next
    Next

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

    For $n = 5 To $w Step 2 ; Only odd numbers can be prime, no point in testing even numbers
    If $prime[$n] Then
    $nn = $n * $n
    $k = 1
    While $k * $nn < $limes
    $prime[$k * $nn] = 0
    $k += 1
    WEnd
    EndIf
    Next

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

    For $n = 3 To $limes - 1 Step 2
    If $prime[$n] Then $prime_numbers &= $n & " "
    Next
    Return "2 " & $prime_numbers
    EndFunc

    [/autoit]

    Der ist für AutoIt leider langsam!

    Gruß,
    UEZ

  • Breakpoint 2010 in Bingen am Rhein vom 2.-5. April

    • UEZ
    • 29. März 2010 um 17:16

    Hier ein Zeitplan über die Veranstaltung: http://breakpoint.untergrund.net/timetable.php

    Ich plane Samstag oder Sonntag abends dort hin!

    Der Eintritt kostet leider 40€ pro Tag oder 55€ für alle 4Tage - ein bissl teuer! :huh:

    Gruß,
    UEZ

  • Breakpoint 2010 in Bingen am Rhein vom 2.-5. April

    • UEZ
    • 28. März 2010 um 21:12

    Da die Veranstaltung vom 2. - 5. April geht, frage ich mich, an welchem Tag man am besten dort hin sollte!

    Ich möchte auf jeden Fall dort hin . :D

    Gruß,
    UEZ

  • [Beendet] µitLight März

    • UEZ
    • 27. März 2010 um 23:40

    Ich dachte, dass wir den schnellsten Algorithmus zur Bestimmung von 100000 Primzahlen suchen, aber im 1. Post steht "Wer die höchste Primzahl nach 10 Minuten gefunden hat, hat gewonnen.".

    Hier meine Version zur Bestimmung der 100000 Primzahlen:

    Spoiler anzeigen
    [autoit]


    #include <Memory.au3>

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

    Local $until = 1299709
    Local $start = TimerInit()
    ;~ Local $pz = Eratosthenes_Calc($until)
    Local $pz = Eratosthenes_Calc_ASM($until) ;bytecode variant
    Local $stop = TimerDiff($start)
    Local $rowl = Ceiling(($until ^ 0.5) ^ 0.5)
    Local $aTemp = StringSplit(StringMid($pz, 1, StringLen($pz) - 1), " ")

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

    #region GUI ini
    Local $iMemo, $hGUI, $w, $h
    Local $font_size = 9
    Local $display = 0 ;display all prime numbers
    If $display Then
    $w = StringLen($until) * $rowl * $font_size
    If $w < 400 Then
    $w = 400
    ElseIf $w > @DesktopWidth * 0.95 Then
    $w = @DesktopWidth * 0.95
    EndIf
    $h = @DesktopHeight * 0.9
    Else
    $w = 400
    $h = 150
    EndIf
    #endregion GUI ini

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

    #region GUI
    $hGUI = GUICreate("Prime Numbers Calculator by UEZ 2010", $w, $h, 0, 0)
    $iMemo = GUICtrlCreateEdit("", 2, 2, $w - 4, $h - 6, 0x00200000 + 0x00100000 + 0x0800)
    GUICtrlSetLimit(-1, 0x7FFFFFFF)
    GUICtrlSetFont($iMemo, $font_size, 400, 0, "Courier New")
    GUICtrlSetBkColor($iMemo, 0xFFFFFF)

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

    MemoWrite("Sieving prime numbers till " & $until & ": " & @CRLF)
    MemoWrite("Found " & $aTemp[0] & " prime numbers!" & @CRLF)
    MemoWrite("Benchmark: " & Round($stop / 1000, 4) & " seconds to sieve prime numbers." & @CRLF)
    If $display Then
    MemoWrite(@CRLF & "Numbers:" & @CRLF)
    For $z = 1 To $aTemp[0]
    MemoWrite(StringFormat("%" & StringLen($until) + 1 & "s", $aTemp[$z] & " "))
    If Mod($z, $rowl) = 0 Then MemoWrite(@CRLF)
    Next
    EndIf

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

    MemoWrite(@CRLF)
    #endregion GUI
    GUISetState()
    MouseClick("left", 100, 85, 1, 1)

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

    While GUIGetMsg() <> -3
    WEnd

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

    Exit

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

    Func Eratosthenes_Calc($l) ;
    Local $p[$l + 1], $i, $j, $z, $n
    For $z = 0x3 To $l Step 0x2
    $p[$z] = 0x1
    Next
    For $i = 0x3 To Sqrt($l) Step 0x2
    If $p[$i] And Mod($p[$i], 0x2) Then
    For $j = $i * $i To $l Step $i
    $p[$j] = 0
    Next
    $n &= $i & " "
    EndIf
    Next
    If Not Mod($i, 0x2) Then $i += 0x1
    For $z = $i To $l Step 0x2
    If $p[$z] Then $n &= $z & " "
    Next
    Return "2 " & $n
    EndFunc ;==>Eratosthenes_Calc

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

    ;this is nearly the same code as the AutoIt code above but in ASM ;)
    Func Eratosthenes_Calc_ASM($limit); thanks to Andy for helping me to get the ASM code runnning properly :)
    #region bytecode
    Local $bytecode = "0x558B6C2408C7450C020000008B5D006BDB04B80800000089C1C1C90241894C050883C00839D876EF89EF83C70883C70101DF" & _
    "BB030000008B4D04B8080000008B74050839CB7F3383FE00750883C00883C302EBEB53505189D90FAFDB3B5D007F1489D86BC00483E804" & _
    "C74405080000000001CBEBE759585BEBD28B75006BF604B80800000089C1C1C902418B5C050883FB00750983C00839F076EA5DC3E802000000" & _
    "EBF05052535189D8BB0A00000031C931D2F7F3665280C10109C075F366580C30AAE2F9C6072083C701595B5A58C3"
    #cs
    :00000000 55 push ebp
    :00000001 8B6C2408 mov ebp, dword ptr [esp+08]
    :00000005 C7450C02000000 mov [ebp+0C], 00000002
    :0000000C 8B5D00 mov ebx, dword ptr [ebp+00]
    :0000000F 6BDB04 imul ebx, 00000004
    :00000012 B808000000 mov eax, 00000008
    :00000017 89C1 mov ecx, eax
    :00000019 C1C902 ror ecx, 02
    :0000001C 41 inc ecx
    :0000001D 894C0508 mov dword ptr [ebp+eax+08], ecx
    :00000021 83C008 add eax, 00000008
    :00000024 39D8 cmp eax, ebx
    :00000026 76EF jbe 00000017
    :00000028 89EF mov edi, ebp
    :0000002A 83C708 add edi, 00000008
    :0000002D 83C701 add edi, 00000001
    :00000030 01DF add edi, ebx
    :00000032 BB03000000 mov ebx, 00000003
    :00000037 8B4D04 mov ecx, dword ptr [ebp+04]
    :0000003A B808000000 mov eax, 00000008
    :0000003F 8B740508 mov esi, dword ptr [ebp+eax+08]
    :00000043 39CB cmp ebx, ecx
    :00000045 7F33 jg 0000007A
    :00000047 83FE00 cmp esi, 00000000
    :0000004A 7508 jne 00000054
    :0000004C 83C008 add eax, 00000008
    :0000004F 83C302 add ebx, 00000002
    :00000052 EBEB jmp 0000003F
    :00000054 53 push ebx
    :00000055 50 push eax
    :00000056 51 push ecx
    :00000057 89D9 mov ecx, ebx
    :00000059 0FAFDB imul ebx, ebx
    :0000005C 3B5D00 cmp ebx, dword ptr [ebp+00]
    :0000005F 7F14 jg 00000075
    :00000061 89D8 mov eax, ebx
    :00000063 6BC004 imul eax, 00000004
    :00000066 83E804 sub eax, 00000004
    :00000069 C744050800000000 mov [ebp+eax+08], 00000000
    :00000071 01CB add ebx, ecx
    :00000073 EBE7 jmp 0000005C
    :00000075 59 pop ecx
    :00000076 58 pop eax
    :00000077 5B pop ebx
    :00000078 EBD2 jmp 0000004C
    :0000007A 8B7500 mov esi, dword ptr [ebp+00]
    :0000007D 6BF604 imul esi, 00000004
    :00000080 B808000000 mov eax, 00000008
    :00000085 89C1 mov ecx, eax
    :00000087 C1C902 ror ecx, 02
    :0000008A 41 inc ecx
    :0000008B 8B5C0508 mov ebx, dword ptr [ebp+eax+08]
    :0000008F 83FB00 cmp ebx, 00000000
    :00000092 7509 jne 0000009D
    :00000094 83C008 add eax, 00000008
    :00000097 39F0 cmp eax, esi
    :00000099 76EA jbe 00000085
    :0000009B 5D pop ebp
    :0000009C C3 ret

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

    :0000009D E802000000 call 000000A4
    :000000A2 EBF0 jmp 00000094

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

    :000000A4 50 push eax
    :000000A5 52 push edx
    :000000A6 53 push ebx
    :000000A7 51 push ecx
    :000000A8 89D8 mov eax, ebx
    :000000AA BB0A000000 mov ebx, 0000000A
    :000000AF 31C9 xor ecx, ecx
    :000000B1 31D2 xor edx, edx
    :000000B3 F7F3 div ebx
    :000000B5 6652 push dx
    :000000B7 80C101 add cl, 01
    :000000BA 09C0 or eax, eax
    :000000BC 75F3 jne 000000B1
    :000000BE 6658 pop ax
    :000000C0 0C30 or al, 30
    :000000C2 AA stosb
    :000000C3 E2F9 loop 000000BE
    :000000C5 C60720 mov byte ptr [edi], 20
    :000000C8 83C701 add edi, 00000001
    :000000CB 59 pop ecx
    :000000CC 5B pop ebx
    :000000CD 5A pop edx
    :000000CE 58 pop eax
    :000000CF C3 ret
    #ce
    #endregion

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

    Local $limes = Floor(Sqrt($limit))
    Local $bin_len = Ceiling(StringLen($bytecode) * 0.5)
    Local $pRemoteCode = _MemVirtualAlloc(0, $bin_len, $MEM_COMMIT, $PAGE_EXECUTE_READWRITE)
    Local $tCodeBuffer = DllStructCreate("byte[" & $bin_len & "]", $pRemoteCode)
    DllStructSetData($tCodeBuffer, 1, $bytecode)
    Local $tStruct = DllStructCreate("uint limit;uint limes;uint sieve[" & $limit + 1 & "];char prime[" & $limit & "]")
    DllStructSetData($tstruct, "limit", $limit)
    DllStructSetData($tstruct, "limes", $limes)
    Local $ret = DllCall("user32.dll", "int", "CallWindowProcW", "ptr", $pRemoteCode, "ptr", DllStructGetPtr($tStruct), "int", 0, "int", 0, "int", 0)
    Local $p = "2 3 5" & DllStructGetData($tStruct, "prime")
    _MemVirtualFree($pRemoteCode, $bin_len, $MEM_DECOMMIT)
    $tStruct = ""
    $tCodeBuffer = ""
    Return $p
    EndFunc ;==>Eratosthenes_Calc_ASM

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

    Func MemoWrite($sMessage = "")
    GUICtrlSetData($iMemo, $sMessage, 1)
    EndFunc ;==>MemoWrite

    [/autoit]

    Ich habe mal auch meine ASM Version dazu gepackt in der Bytecode Version (mein aller erster ASM Code überhaupt!)!

    Vielen Dank an Andy für seine Hilfe und Unterstützung! Ohne seine Hilfe wäre wohl nie eine lauffähige Version entstanden!

    Ich habe die Umwandlung von den Zahlen nach String in ASM noch nicht implementiert, so dass der Zeitgewinn in ASM durch das Auslesen des Structs wieder zunichte gemacht wird!

    Auf meinem Schlepptop benötigt der AutoIt Code ca. 4.00 und der ASM Code ca. 0,07 Sekunden für die 100000 Primzahlen!

    CPU: Intel(R) Pentium(R) Dual CPU T3200 @ 2.00GHz

    Gruß,
    UEZ

  • GDI+ Rotating Cubes

    • UEZ
    • 27. März 2010 um 22:25
    Zitat von progandy


    Eine Lösung hätte ich eventuell: http://danbystrom.se/2009/01/12/thu…lection-in-gdi/ (Punkt 3)

    Vielen Dank!

    Werde ich mir anschauen und versuchen zu verstehen!

    Gruß,
    UEZ

  • GDI+ Rotating Cubes

    • UEZ
    • 27. März 2010 um 22:14
    Zitat von progandy

    _GDIPlus_DrawImagePoints kann nur Parallelogramme erstellen und keine Trapeze, daher geht eine richtige 3D-Darstellung wohl nicht. Eventuel funktioniert es mit Matrizen besser.

    Ich weiß und genau dort liegt der Hase begraben! Ob und wie das mit Matrizen funktionert, weiß ich noch nicht.

    Mal schauen...

    Gruß,
    UEZ

  • JaYT-DwiMP3-P (YT-Downloader) Version 0.8.7.1

    • UEZ
    • 27. März 2010 um 18:49

    Das Problem mit dem Fenster tritt auch unter WinXP SP3 auf!

    • starte dein Programm
    • klicke auf das Maximieren Icon (3. von rechts) -> nun sollte die GUI maximiert sein
    • mache ein Doppeltklick auf die Titel Leiste neben dem "Hilfe" Text
    • nun sollte die GUI mit dem Bild verkleinert sein und die andere GUI noch maximiert
    • klickst du wieder auf das 3. Icon (minimieren), wird auch die 2. GUI verkleinert

    Nützliches Tool für meine Tochter! Sie wird jetzt bei YouTube einiges umwandeln... :thumbup:

    Gruß,
    UEZ

  • GDI+ Bitmap Effekte

    • UEZ
    • 27. März 2010 um 00:49

    Cool! :thumbup:

    Wenn jetzt noch ein "Undo" möglich wäre, könnte man sich das Laden immer ersparen, um die Effekte auszuprobieren!

    Bei einer PNG schmiert das Skript ab!

    Gruß,
    UEZ

  • JaYT-DwiMP3-P (YT-Downloader) Version 0.8.7.1

    • UEZ
    • 26. März 2010 um 20:18

    Hallo AutoBert,

    wie funktioniert dein Tool? Wie kann ich den YouTube Link einfügen?

    Folgenden Dinge sind mir noch aufgefallen:

    • Datei -> öffen -> Abbruch löscht das aktuelle Bild
    • wenn ich das Fenster maximiere und per Doppeltklick auf die Windows Titelleiste verkleinere, wird nur die Haupt GUI verkleinert (siehe Bild) -> getestet auf Vista x32 und Win7 x64 (VM)


    Gruß,
    UEZ

    Dateien

    Bug.png 16,24 kB – 0 Downloads
  • Au3 Script auf AutoIt Fremden PC compilen

    • UEZ
    • 25. März 2010 um 18:19

    Du kannst auch "manuell" ein AU3 Code kompilieren!

    Dazu benötigst du folgende Dateien:

    • AutoIt3Wrapper.exe
    • Aut2exe.exe / Aut2exe_x64.exe
    • AutoItSC.bin / AutoItSC_x64.bin
    • upx.exe (optional)

    Kompilieren kannst du wie folgt in einer CMD: AutoIt3Wrapper.exe /in [script.au3]

    Ich hoffe, dass hilft dir!

    Gruß,
    UEZ

  • Apfelmaennchen in FASM-Assembler Update incl. FLUG!

    • UEZ
    • 25. März 2010 um 17:41

    Hier mein Feedback zu Apfelmaennchen_fasm_bytecode:

    • nach dem 4. Zoomen bleibt das Fenster schwarz
    • das Fenster bleibt beim Flug fast nur schwarz (nur am Anfang sieht man die Umrisse) und der Flug dauert nur wenige Sekunden
    • wenn ich Zoom backwards aufrufe, wird das Bild nur schwarz
    • die Version im Zip File im 1. Post (nicht Bytecode) läuft unter Win7 x64 überhaupt nicht mehr


    Gruß,
    UEZ

  • Star Wars Intro NEU

    • UEZ
    • 24. März 2010 um 21:19

    Die Idee ging mir schon lange durch den Kopf, weil ich für AUTOITEROIDS das Outro so machen wollte, nur das Füllen von perspektivisch korrekten Flächen ist leider nur über Umwege anscheinend möglich. :thumbup:

    Klasse gemacht - läuft sauber auf meinem Vista x32 Notebook bei einer Auflösung von 1920x1200!

    Da bin ich wohl nicht der einzig GDI+ verspielte "Freak"! ^^

    Gruß,
    UEZ

  • GDI+ Rotating Cubes

    • UEZ
    • 24. März 2010 um 16:25

    Kleines Update!

    Der Würfel "Rotating Cube 2 + Textures" hat jetzt ein pseudo Lichteffekt, d.h. wenn sich eine Seite nach hinten dreht, wird die Seite (das Bild) dunkeler! 8)

    Downloads wie immer im ersten Beitrag !

    Gruß,
    UEZ

  • Fensterinhalt mit GDI+ vergrößert in anderem Fenster darstellen ?

    • UEZ
    • 24. März 2010 um 09:08

    Meinst du so was:

    Spoiler anzeigen
    [autoit]


    ;fast hack by UEZ
    #include <GuiConstantsEx.au3>
    #include <GDIPlus.au3>
    #include <ScreenCapture.au3>

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

    Opt('MustDeclareVars', 1)

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

    _Main()

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

    Func _Main()
    Local $hGUI1, $hGUI2, $hGUI3, $hImage, $hGraphic1, $hGraphic2, $hGraphic3, $sCLSID
    Local $bitmap1, $bitmap2, $bitmap3, $image1, $image2, $image3
    Local $tData, $tParams, $pParams, $pData

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

    ; Capture top left corner of the screen
    _ScreenCapture_Capture (@MyDocumentsDir & "\GDIPlus_Image.jpg", 0, 0, 400, 300)

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

    ; Create a GUI for the original image
    $hGUI1 = GUICreate("Original", 400, 300, 0, 0)
    GUISetState()

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

    ; Create a GUI for the zoomed image
    $hGUI2 = GUICreate("Scaled Up", 800, 600, 0, 350)
    GUISetState()

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

    ; Create a GUI for the scaled down image
    $hGUI3 = GUICreate("Scaled Down", 200, 150, 820, 400)
    GUISetState()

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

    ; Initialize GDI+ library and load image
    _GDIPlus_Startup ()
    $hImage = _GDIPlus_ImageLoadFromFile (@MyDocumentsDir & "\GDIPlus_Image.jpg")

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

    $sCLSID = _GDIPlus_EncodersGetCLSID ("JPG")

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

    ; Draw original image
    $hGraphic1 = _GDIPlus_GraphicsCreateFromHWND ($hGUI1)
    $bitmap1 = _GDIPlus_BitmapCreateFromGraphics(400, 300, $hGraphic1)
    $image1 = _GDIPlus_ImageGetGraphicsContext($bitmap1)
    _GDIPlus_GraphicsDrawImageRect($image1, $hImage, 0, 0, 400, 300)
    _GDIPlus_GraphicsDrawImageRect($hGraphic1, $bitmap1, 0, 0, 400, 300)
    _GDIPlus_ImageSaveToFileEx($bitmap1, @ScriptDir & "\GDIPlus_Image1.jpg", $sCLSID)
    _WinAPI_DeleteObject($bitmap1)
    _GDIPlus_GraphicsDispose($image1)

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

    ; Draw 2x scaled up image and save with lower jpg quality
    $hGraphic2 = _GDIPlus_GraphicsCreateFromHWND ($hGUI2)
    $bitmap2 = _GDIPlus_BitmapCreateFromGraphics(800, 600, $hGraphic2)
    $image2 = _GDIPlus_ImageGetGraphicsContext($bitmap2)
    _GDIPlus_GraphicsDrawImageRectRect ($image2, $hImage, 0, 0, 400, 300, 0, 0, 800, 600)
    _GDIPlus_GraphicsDrawImageRect($hGraphic2, $bitmap2, 0, 0, 800, 600)
    $tParams = _GDIPlus_ParamInit (1)
    $tData = DllStructCreate("int Quality")
    DllStructSetData($tData, "Quality", 10) ;quality 0-100
    $pData = DllStructGetPtr($tData)
    _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData)
    $pParams = DllStructGetPtr($tParams)
    _GDIPlus_ImageSaveToFileEx($bitmap2, @ScriptDir & "\GDIPlus_Image2.jpg", $sCLSID, $pParams)
    _WinAPI_DeleteObject($bitmap2)
    _GDIPlus_GraphicsDispose($image2)
    $tData = 0

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

    ; Draw 2x scaled down image
    $hGraphic3 = _GDIPlus_GraphicsCreateFromHWND ($hGUI3)
    $bitmap3 = _GDIPlus_BitmapCreateFromGraphics(200, 150, $hGraphic3)
    $image3 = _GDIPlus_ImageGetGraphicsContext($bitmap3)
    _GDIPlus_GraphicsDrawImageRectRect ($image3, $hImage, 0, 0, 400, 300, 0, 0, 200, 150)
    _GDIPlus_GraphicsDrawImageRect($hGraphic3, $bitmap3, 0, 0, 200, 150)
    _GDIPlus_ImageSaveToFileEx($bitmap3, @ScriptDir & "\GDIPlus_Image3.jpg", $sCLSID)
    _WinAPI_DeleteObject($bitmap3)
    _GDIPlus_GraphicsDispose($image3)

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

    ; Release resources
    _GDIPlus_GraphicsDispose ($hGraphic1)
    _GDIPlus_GraphicsDispose ($hGraphic2)
    _GDIPlus_GraphicsDispose ($hGraphic3)
    _GDIPlus_ImageDispose ($hImage)
    _GDIPlus_Shutdown ()

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

    ; Clean up screen shot file
    FileDelete(@MyDocumentsDir & "\GDIPlus_Image.jpg")

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

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

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

    Exit

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

    EndFunc ;==>_Main

    [/autoit]

    Gruß,
    UEZ

  • GDI+ Beispiel: Matrizen

    • UEZ
    • 23. März 2010 um 19:58

    Sieht sehr schön aus :thumbup:

    Nur die CPU Last ist sehr hoch.

    Mein Vorschlag

    [autoit]


    ...
    ;~ AdlibRegister("_Draw", 10)
    AdlibRegister("_Key", 50)

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

    While 1
    Sleep(30)
    _Draw()
    WEnd
    ...

    [/autoit]


    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™