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. andygo

Beiträge von andygo

  • _GDIPlus_GraphicsDrawPicSlider()

    • andygo
    • 20. März 2011 um 11:26

    moin moin,

    habe hier auch nochmal ne weitere version: nun sind keine dateien erforderlich, das script kann direkt gestartet werden.
    die bildauswahl erfolgt dann einfach per klick auf die 2 mini-bilder:
    [Blockierte Grafik: http://www.andygo1.de/03-2011/20.03.2011--11_25_45--WCNy.jpg]

    Spoiler anzeigen
    [autoit]


    #include <GuiConstantsEx.au3>
    #include <GDIPlus.au3>
    #Include <Misc.au3>
    global $Width2 = 640, $Height2 = 360, $Width3 = 0, $Height3 = 0, $hClonea, $hCloneb, $hBitmapa, $hBitmapb
    $hGUI = GUICreate("Picture Slider", 660, 440)
    $d2 = GUICtrlCreateSlider(10, 412, 640, 20)
    GUICtrlSetLimit(-1, 639, 1)
    GUICtrlSetData(-1, 320)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit")
    GUISetbkColor(0xe0e0e0)
    GUISetState()
    Opt("GuiOnEventMode", 1)
    _GDIPlus_Startup ()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hgui)
    bkg("a", 0xff000000)
    bkg("b", 0xffff0000)
    GUICtrlCreateLabel("Bild 1:", 50, 20, 40, 15)
    GUICtrlCreateLabel("Bild 2:", 200, 20, 40, 15)
    $pica = GUICtrlCreatePic (@ScriptDir & "\tempa.jpg", 90, 10, 45, 30)
    GUICtrlSetOnEvent(-1, "_sela")
    $picb = GUICtrlCreatePic (@ScriptDir & "\tempb.jpg", 240, 10, 45, 30)
    GUICtrlSetOnEvent(-1, "_selb")
    _slider()
    $mylo = @WindowsDir & "\"
    func bkg($side, $col)
    $hBitmap1 = _WinAPI_CreateBitmap(640,360,1,32)
    $pen = _GDIPlus_BrushCreateSolid($col)
    if $side = "a" then
    $hBitmapa = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap1)
    $hGraphic1 = _GDIPlus_ImageGetGraphicsContext($hBitmapa)
    _GDIPlus_GraphicsFillRect($hGraphic1, 0, 0, 640, 360, $Pen)
    _GDIPlus_ImageSaveToFile($hBitmapa, @ScriptDir & "\temp"&$side&".jpg")
    Else
    $hBitmapb = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap1)
    $hGraphic1 = _GDIPlus_ImageGetGraphicsContext($hBitmapb)
    _GDIPlus_GraphicsFillRect($hGraphic1, 0, 0, 640, 360, $Pen)
    _GDIPlus_ImageSaveToFile($hBitmapb, @ScriptDir & "\temp"&$side&".jpg")
    endif
    _WinAPI_DeleteObject ($hBitmap1)
    _GDIPlus_BrushDispose($pen)
    endfunc

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

    func _slider()
    $hand = GUICtrlRead($d2)
    _GDIPlus_ImageDispose ($hClonea)
    _GDIPlus_ImageDispose ($hCloneb)
    $hClonea = _GDIPlus_BitmapCloneArea ($hbitmapa, 0, 0, $hand, 360)
    $hCloneb = _GDIPlus_BitmapCloneArea ($hbitmapb, $hand, 0, 640-$hand, 360)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hclonea, 10, 50, $hand, 360)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hcloneb, 10+$hand, 50, 640-$hand, 360)
    endfunc

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

    func _quit()
    _GDIPlus_GraphicsDispose ($hGraphic)
    _GDIPlus_ImageDispose ($hClonea)
    _GDIPlus_ImageDispose ($hCloneb)
    _GDIPlus_BitmapDispose ($hBitmapa)
    _GDIPlus_BitmapDispose ($hBitmapb)
    _GDIPlus_Shutdown ()
    Exit
    EndFunc

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

    While 1
    sleep(20)
    while _IsPressed(01)
    sleep(20)
    _slider()
    wend
    WEnd

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

    func resize($inp, $outp)
    $hBitmap1 = _WinAPI_CreateBitmap(640,360,1,32)
    $hImage = _GDIPlus_ImageLoadFromFile($inp)
    $hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap1)
    $hGraphic1 = _GDIPlus_ImageGetGraphicsContext($hImage1)
    _GDIPlus_GraphicsDrawImageRect($hGraphic1, $hImage, $Width3, $Height3, $Width2, $Height2)
    _GDIPlus_BitmapDispose($hImage)
    _GDIPlus_ImageSaveToFile($hImage1, $outp)
    _GDIPlus_BitmapDispose($hImage1)
    _WinAPI_DeleteObject ($hBitmap1)
    endfunc

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

    func _sela()
    _GDIPlus_BitmapDispose ($hBitmapa)
    _select($pica, "a", 0xff000000)
    $hBitmapa = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\tempa.jpg")
    _slider()
    endfunc
    func _selb()
    _GDIPlus_BitmapDispose ($hBitmapb)
    _select($picb, "b", 0xffff0000)
    $hBitmapb = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\tempb.jpg")
    _slider()
    endfunc
    func _select($pic, $temp, $rc)
    $cstm2pre = FileOpenDialog("Browse...", $mylo, "Images (*.jpg;*.png;*.gif;*.bmp;*.tif)", 1 + 2 + 4)
    $cstm22 = StringLeft ($cstm2pre, stringinstr ($cstm2pre, "|") - 1) & "\"
    $cstm2pre = StringTrimLeft ($cstm2pre, stringinstr ($cstm2pre, "|"))
    if stringinstr ($cstm2pre, "|", 0, 1, 1) > 0 then
    $user = $cstm22 & StringLeft ($cstm2pre, stringinstr ($cstm2pre, "|") - 1)
    Else
    $user = $cstm22 & $cstm2pre
    if stringleft ($user, 1) = "\" then $user = stringtrimleft ($user, 1)
    endif
    $mylo = StringLeft($user, StringInStr ($user, "\", 0, -1))
    if StringInStr("jpg|png|gif|bmp|tif", StringRight($user, 3)) = 0 then
    bkg($temp, $rc)
    else
    repic($user, 640, 360)
    resize($user, @ScriptDir & "\temp"&$temp&".jpg")
    endif
    GUICtrlSetImage($pic, @ScriptDir & "\temp"&$temp&".jpg")
    endfunc
    func repic($rp, $rp1, $rp2)
    $tp = _GDIPlus_BitmapCreateFromFile($rp)
    $Width = _GDIPlus_ImageGetWidth($tp)
    $Height = _GDIPlus_ImageGetHeight($tp)
    _GDIPlus_BitmapDispose ($tp)
    $i = $rp1
    $xa = $Width / $rp1
    while $Height / $xa > $rp2
    $i -= 1
    $xa = $Width / $i
    wend
    $Width2 = $Width
    $Height2 = $Height
    if $Width > $rp1 or $Height > $rp2 then
    $Width2 = int($Width / $xa)
    $Height2 = int($Height / $xa)
    endif
    if $rp2 = 99999 Then
    $width2 = $rp1
    $height2 = int(($rp1/$width)*$height)
    Else
    $Width3 = 0
    $Height3 = 0
    if int(($rp1 - $Width2) / 2) > 1 then $Width3 = int(($rp1 - $Width2) / 2)
    if int(($rp2 - $Height2) / 2) > 1 then $Height3 = int(($rp2 - $Height2) / 2)
    endif
    endfunc

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

    Edit: Habe das Script nochma aktualisiert. Bilder werden jetz maßstabsgetreu (also unverzerrt) skaliert und zentriert dargestellt.

  • _GDIPlus_GraphicsDrawPicSlider()

    • andygo
    • 20. März 2011 um 00:03

    hab es. boxen hat ja nicht so lang gedauert.

    Spoiler anzeigen
    [autoit]


    #include <GuiConstantsEx.au3>
    #include <GDIPlus.au3>
    #Include <Misc.au3>
    ;Ihr müsst folgende 2 werte auf existierende bilder anpassen:
    ;@ScriptDir & "\a.jpg"
    ;@ScriptDir & "\b.jpg"
    ;die funktion resize "zwingt" die bilder in die auflösung $width2 * $height2
    ;script = alphastatus, kann sicher noch verfeinert werden.
    global $Width2 = 300, $Height2 = 200, $hClonea, $hCloneb
    $hGUI = GUICreate("GDI+", 400, 300)
    $d2 = GUICtrlCreateSlider(50, 270, 300, 20)
    ;GUICtrlSetOnEvent(-1, "_slider")
    GUICtrlSetLimit(-1, 299, 1)
    GUICtrlSetData(-1, 1)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit")
    GUISetbkColor(0xe0e0e0)
    GUISetState()
    Opt("GuiOnEventMode", 1)
    _GDIPlus_Startup ()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hgui)
    resize(@ScriptDir & "\a.jpg", @ScriptDir & "\tempa.jpg")
    resize(@ScriptDir & "\b.jpg", @ScriptDir & "\tempb.jpg")
    $hBitmapa = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\tempa.jpg")
    $hBitmapb = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\tempb.jpg")
    _slider()

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

    func _slider()
    $hand = GUICtrlRead($d2)
    _GDIPlus_ImageDispose ($hClonea)
    _GDIPlus_ImageDispose ($hCloneb)
    $hClonea = _GDIPlus_BitmapCloneArea ($hbitmapa, 0, 0, $hand, 200)
    $hCloneb = _GDIPlus_BitmapCloneArea ($hbitmapb, $hand, 0, 300-$hand, 200)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hclonea, 50, 50, $hand, 200)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hcloneb, 50+$hand, 50, 300-$hand, 200)
    endfunc

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

    func _quit()
    _GDIPlus_GraphicsDispose ($hGraphic)
    _GDIPlus_ImageDispose ($hClonea)
    _GDIPlus_ImageDispose ($hCloneb)
    _WinAPI_DeleteObject ($hBitmapa)
    _WinAPI_DeleteObject ($hBitmapb)
    _GDIPlus_Shutdown ()
    Exit
    EndFunc

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

    While 1
    sleep(20)
    while _IsPressed(01)
    sleep(20)
    _slider()
    wend
    WEnd

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

    func resize($input, $output)
    $hBitmap1 = _WinAPI_CreateBitmap($Width2, $Height2, 1, 32)
    $hImage = _GDIPlus_ImageLoadFromFile($input)
    $hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap1)
    $hGraphic1 = _GDIPlus_ImageGetGraphicsContext($hImage1)
    _GDIPlus_GraphicsDrawImageRect($hGraphic1, $hImage, 0, 0, $Width2, $Height2)
    _GDIPlus_BitmapDispose($hImage)
    _GDIPlus_ImageSaveToFile($hImage1, $output)
    _GDIPlus_BitmapDispose($hImage1)
    _WinAPI_DeleteObject ($hBitmap1)
    endfunc

    [/autoit]

    bin mal gespannt was es für das script noch für ideen gibt :)

  • _GDIPlus_GraphicsDrawPicSlider()

    • andygo
    • 19. März 2011 um 22:58

    das lässt sich sicher mit gdi realisieren, hab da auch schon eine idee....
    mach ich nachher oder morgen mal. jetzt boxen guggen auf rtl

  • Screenshot von Web Seiten

    • andygo
    • 18. März 2011 um 12:40

    und gleich noch eine frage im anschluss: könnte man den code auch so verändern das wenn eine seite > 8192 ist, erst von 0 bis 8192 ge-screent wird, zwischengelagert, dann von 8192 bis ende (bzw. bis 16.384)... u.s.w. und dann die teile per gdi+ zusammenfügt zu einem bild?

  • Screenshot von Web Seiten

    • andygo
    • 18. März 2011 um 12:16
    Zitat von UEZ

    Hmmm, warum plötzlich die Beschränkung auf 8192? ?(

    Aber egal, jetzt weiß ich es ja :D

    Danke andygo!


    Habe den Code aktualisiert.


    Gruß,
    UEZ

    Alles anzeigen

    das einzige was mir daran gerade auffällt: 1024 * 8 = 8192

    nun, damit müsste sich ja auch das posting hier erledigt haben:
    http://www.autoitscript.com/forum/topic/12…pi-getdc-error/

  • Screenshot von Web Seiten

    • andygo
    • 18. März 2011 um 11:15

    hallo,

    habe win7 #64 und auch den ie9. verschiedene tests haben ergeben:

    [autoit]

    $wsBodyHeight+ 50

    [/autoit]

    dieser wert darf gesamt nicht mehr als

    [autoit]

    8192

    [/autoit]


    sein. zumindest ist es hier so wenn ich das festsetze das es klappt. beträgt der wert 8193 geht es schon nicht mehr.
    zwar wird die größe wie berechnet ausgegeben, auch das seitenverhältnis stimmt, aber eben nur weiss.....

  • Aus einer Ini-Datei eine bestimmte Zeile und davon auch nur bestimmte Teile auslesen

    • andygo
    • 17. März 2011 um 12:09

    hier mal ein stand-alone beispiel:

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <StaticConstants.au3>
    #include <INet.au3>

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

    $hGUI = GUICreate("boersennews.de", 400, 120)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit")
    $lab = GUICtrlCreateLabel("URL:", 10, 12, 60, 16)
    $url = GUICtrlCreateInput("", 70, 10, 260, 20)
    $get = GUICtrlCreateButton("get it", 340, 10, 50, 20)
    $titel = GUICtrlCreatelabel("", 21, 43, 360, 15, $SS_CENTER)
    $label1 = GUICtrlCreatelabel("", 171, 65, 60, 15, $SS_CENTER)
    $label2 = GUICtrlCreatelabel("", 171, 89, 60, 15, $SS_CENTER)
    GUICtrlSetOnEvent($get, "_check")
    GUISetState()
    Opt("GuiOnEventMode", 1)

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

    func _check()
    $link = GUICtrlRead($url)
    if StringInStr($link, "http://www.boersennews.de/markt/aktien") then
    GUICtrlSetData($label1, "lade...")
    $download = _INetGetSource($link)
    $titel1 = StringTrimLeft($download, StringInStr($download, "<title>")+6)
    $titel1 = StringLeft($titel1, StringInStr($titel1, "</title>")-17)
    $titel1 = StringReplace(StringTrimLeft($titel1, StringInStr($titel1, "aktie - ")+7), "aktienkurs", "")
    $download = StringTrimLeft($download, StringInStr($download, "<tr class=""details"">")+19)
    $download = StringTrimLeft($download, StringInStr($download, "<span>")+5)
    $download1 = StringReplace(StringReplace(StringLeft($download, StringInStr($download, "<")-1), @lf, ""), " ", "")
    $download1 = StringReplace($download1, "euro;", " €")
    $download = StringTrimLeft($download, StringInStr($download, "bg"">")+3)
    $download2 = StringReplace(StringReplace(StringLeft($download, StringInStr($download, "<")-1), @lf, ""), " ", "")
    $download2 = StringReplace($download2, "%", " %")
    GUICtrlSetData($label1, "")
    if StringInStr($download1, ",") and StringInStr($download2, ",") then
    GUICtrlSetData($titel, $titel1)
    GUICtrlSetData($label1, $download1)
    GUICtrlSetData($label2, $download2)
    if StringInStr($download2, "-") Then
    GUICtrlSetBkColor($label1, 0xff0000)
    GUICtrlSetBkColor($label2, 0xff0000)
    else
    GUICtrlSetBkColor($label1, 0x00ff00)
    GUICtrlSetBkColor($label2, 0x00ff00)
    endif
    Else
    msgbox(16, "Fehler", "Ungültige URL")
    endif
    Else
    msgbox(16, "Fehler", "Ungültige URL")
    endif
    GUICtrlSetData($url, "")
    endfunc

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

    func _quit()
    if msgbox(68,"boersennews.de","Wirklich beenden?") = 6 then Exit
    EndFunc

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

    While 1
    sleep(20)
    WEnd

    [/autoit]

    $download1 entspricht dem kurs, $download2 der veränderung. diese beiden kannst du auch ohne gui in eine ini schreiben.

  • Ungewollte Transparenz bei GUICtrlSetImage

    • andygo
    • 12. März 2011 um 16:45

    so hier bitteschön, beispiel mit ie:

    Spoiler anzeigen
    [autoit]


    $bild1 = @ScriptDir & "\smile1.png"; komplette pfadangabe wie z.b. @ScriptDir & "\bild1.bmp"
    $bild2 = @ScriptDir & "\smile2.png"
    $bild3 = @ScriptDir & "\smile3.png"
    $bild4 = @ScriptDir & "\smile4.png"
    #include <GUIConstantsEx.au3>
    #include <ComboConstants.au3>
    #include <WindowsConstants.au3>
    #include <IE.au3>
    #include <GDIPlus.au3>
    Opt("GuiOnEventMode", 1)
    $gui = GuiCreate("test", 305, 176, -1, -1)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_quit")
    $oIEp = _IECreateEmbedded ()
    $c21 = GUICtrlCreateObj($oIEp, 81, 5, 143, 80)
    $oIEp.navigate("about:blank")
    $actsel = GUICtrlCreatecombo(" ", 70, 152, 165, 20, $CBS_DROPDOWNLIST+$WS_VSCROLL)
    GUICtrlSetData(-1, $bild1&"|"&$bild2&"|"&$bild3&"|"&$bild4, " ")
    GUISetState()
    $temp = ""

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

    func repic($rp, $rp1, $rp2)
    $temp = $rp
    _GDIPlus_Startup()
    $hImage = _GDIPlus_ImageLoadFromFile($rp)
    $Width = _GDIPlus_ImageGetWidth($hImage)
    $Height = _GDIPlus_ImageGetHeight($hImage)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()
    $i = $rp1
    $xa = $Width / $rp1
    while $Height / $xa > $rp2
    $i -= 1
    $xa = $Width / $i
    wend
    $Width2 = $Width
    $Height2 = $Height
    if $Width > $rp1 or $Height > $rp2 then
    $Width2 = int($Width / $xa)
    $Height2 = int($Height / $xa)
    endif
    $Width3 = 0
    $Height3 = 0
    if int(($rp1 - $Width2) / 2) > 1 then $Width3 = int(($rp1 - $Width2) / 2)
    if int(($rp2 - $Height2) / 2) > 1 then $Height3 = int(($rp2 - $Height2) / 2)
    $oIEp.document.write("<body oncontextmenu='return false' scroll='no' style='border:0;margin-top:"&$Height3&"px; margin-left:"&$Width3&"px'><img src =" & $rp & " width="&$Width2&" height="&$Height2&" alt=''></body>")
    $oIEp.refresh
    endfunc

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

    While 1
    sleep(20)
    if GUICtrlRead($actsel) <> $temp then repic(GUICtrlRead($actsel), 144, 81)
    wend

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

    func _quit()
    Exit
    endfunc

    [/autoit]
  • Ungewollte Transparenz bei GUICtrlSetImage

    • andygo
    • 12. März 2011 um 15:47
    Zitat von veronesi

    Eingebetteter IE? Tönt interessant.
    Ich habe nur mal was mit einem eingebetteten IE und Texten gemacht, weil man dann HTML Tags und somit ein ansprechendes Design gestalten konnte!

    Du hast nicht zufällig ein Beispiel mit einem Bild?
    Mit GDI+ kenne ich mich (noch) nicht aus. Hätte das viele Vorteile?
    Oder wäre ich (da ich GDI+ nicht kenne) mit dem IE besser bedient?

    Edit: für mich muss es vor allem schnell sein und die Transparenz muss funktionieren. Kriege ich das mit dem IE hin?

    ich versuch mal ein stand-alone-beispiel zu scripten. melde mich gleich nochmal

  • Ungewollte Transparenz bei GUICtrlSetImage

    • andygo
    • 12. März 2011 um 15:10
    Zitat von veronesi

    Hallo!
    Entschuldigt, dass ich diesen Thread wieder ausgrabe, aber ich habe ein ähnliches Problem.
    Ich zeige auf der GUI kurz nacheinander mehrere transparente Bilder.
    Das klappt auch wunderbar. Aber bei manchen Bildern sieht man im Hintergrund an gewissen Stellen das letzte und ggfs vorletzte Bild!!

    Bisher habe ich es immer so gemacht, dass ich VOR dem eigentlichen Bild kurz ein vollständig schwarzes Bild setze. Das ist zwar schneller, als wenn man das Bild löscht und neu erstellt, aber am liebsten hätte ich es noch schneller, damit es weniger "blinkt"!

    Habe ich da was übersehen?
    Grüße Veronesi

    hallo veronesi, ich habe mittlerweile eine ganz andere technik das betreffende bild darzustellen. mit nem eingebetteten ie. geht wunderbar.

    alternativ dazu (und auch flicker-frei ist gdi+. kleines gdi+ beispiel (bildwechsel iphoneslider):

    Spoiler anzeigen
    [autoit]


    #include <GuiConstantsEx.au3>
    #include <GDIPlus.au3>
    $hGUI = GUICreate("GDI+", 200, 150)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit")
    GUISetbkColor(0xe0e0e0)
    GUISetState()
    Opt("GuiOnEventMode", 1)
    local $s1, $state = 0, $slide0 = 1, $slide1 = 1
    _slider(0, 0)

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

    func _slider($slide0 = 1, $slide1 = 1)
    if $slide0 = 1 or $slide0 = 2 then GUICtrlDelete($s1)
    _GDIPlus_Startup ()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hgui)
    $hBitmap = _GDIPlus_BitmapCreateFromFile ( @ScriptDir & "\slid2.bmp")
    if $state = 0 then
    $hClone = _GDIPlus_BitmapCloneArea ($hbitmap, 36, 0, 63, 18)
    else
    $hClone = _GDIPlus_BitmapCloneArea ($hbitmap, 0, 0, 63, 18)
    endif
    $i = 0
    if $slide0 = 1 then
    Do
    _GDIPlus_ImageDispose ($hClone)
    if $state = 0 then
    $hClone = _GDIPlus_BitmapCloneArea ($hbitmap, 36-$i, 0, 63, 18)
    Else
    $hClone = _GDIPlus_BitmapCloneArea ($hbitmap, $i, 0, 63, 18)
    endif
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hclone, 50, 50, 63, 18 )
    sleep($slide1)
    $i += 2
    Until $i >= 37
    endif
    _GDIPlus_ImageSaveToFile($hclone, @ScriptDir & "\sb.bmp")
    $s1 = GUICtrlCreatePic(@ScriptDir & "\sb.bmp", 50, 50, 63, 18 )
    GUICtrlSetOnEvent($s1, "_slider"); only for guioneventmode 1
    if $slide0 = 1 and $state = 0 then
    $state = 1
    Elseif $slide0 = 1 and $state = 1 then
    $state = 0
    endif
    _GDIPlus_GraphicsDispose ($hGraphic)
    _GDIPlus_ImageDispose ($hClone)
    _WinAPI_DeleteObject ($hBitmap)
    _GDIPlus_Shutdown ()
    endfunc

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

    func _quit()
    Exit
    EndFunc

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

    While 1
    sleep(20)
    WEnd

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

    Dateien

    slid2.bmp 5,45 kB – 339 Downloads
  • AutoIt Windows Screenshooter v1.84 Build 2019-08-18

    • andygo
    • 1. März 2011 um 14:42

    also es scheint mit dem dwm (dwm.exe) zu tun zuhaben, bzw. mit der dwmapi.dll, bin über mehrere msdn einträge hierauf aufmerksam geworden:

    http://www.autoitscript.com/forum/topic/10…post__p__756102

    aber ob und wie man damit den fehler des blackscreen beseitigt ist mir fern. brauche jetzt auch erstmal eine pause, mir qualmt der schädel 8)

  • AutoIt Windows Screenshooter v1.84 Build 2019-08-18

    • andygo
    • 1. März 2011 um 12:06
    Zitat von UEZ

    Genau das will ich nicht, dass das Fenster sichtbar ist. ;) Bei sichtbarem Fenster ist auch nur ein Teil der Seite sichtbar... Unter WinXP funzt auch der Screenshot von sichtbaren Fenstern...

    Gruß,
    UEZ

    die frage ist nur: warum können mit aero off-pixel erfasst werden und ohne nicht? und wie kann das gelöst werden?
    bin auch schon etwas am googlen.

  • AutoIt Windows Screenshooter v1.84 Build 2019-08-18

    • andygo
    • 1. März 2011 um 11:35
    Zitat von UEZ


    Ach ja, das Erstellen von Screenshots von Web Seiten funktioniert nur mit eingeschaltetem Aero! Warum das so ist, keine Ahnung. ?(

    Gruß,
    UEZ

    habe eben mal paar modifikationen der funktion getestet. kommentiere mal das winmove aus, dann wird zumindest der bereich erfasst der auf dem bildschirm sichtbar ist. es scheint so, als könne windows ohne aero keine im nirvana exisitierenden fensterdaten (pixel) erfassen.

  • While schleife verlassen

    • andygo
    • 1. März 2011 um 09:53

    ich würd es mal so versuchen: statt

    sleep($intervall)

    [autoit]


    for $i = 1 to $intervall step 250
    sleep(250)
    Next

    [/autoit]

    so würdest du den status pro sekunde 4 mal abfragen...

  • Bild ohne "Flackern" bewegen

    • andygo
    • 20. Februar 2011 um 15:59
    Zitat von Nakroma

    Selbst wenn ich hundertmal draufdrücke passier nix

    also wenn du willst das sich das bild bei jedem klick weiterbewegt versuch es mal so:

    [autoit]

    Func right(byref $left)
    $left = $left + 10
    ControlMove("human", "stand", $Pic11, $left, $top)
    EndFunc

    [/autoit]

    halt den funktionsaufruf dann so: right($left)

  • Bild ohne "Flackern" bewegen

    • andygo
    • 20. Februar 2011 um 15:47

    ist ja klar du machst ja nur ein mal +10.

  • Bild ohne "Flackern" bewegen

    • andygo
    • 20. Februar 2011 um 15:33
    Zitat von Nakroma

    Klappt nicht, Bild bewegt sich überhaupt nicht

    eigentlich sollte das so aussehen:

    http://rutube.ru/tracks/4124493…e92a9e9d3c590bd

  • Bild ohne "Flackern" bewegen

    • andygo
    • 20. Februar 2011 um 15:10

    probier mal das beispiel hier. musst nur die bilderangaben so ändern das es halt existierende bilder sind:

    [autoit]

    $egg = GUICreate("Easteregg", 242, 127, -1, -1)
    $egg2 = GUICtrlCreatePic (@ScriptDir & "\a.jpg", 65, 130, 112, 74)
    $egg3 = GUICtrlCreatePic (@ScriptDir & "\a1.jpg", 65, 214, 112, 74)
    $egg4 = GUICtrlCreatePic (@ScriptDir & "\a2.jpg", 65, 298, 112, 74)
    $c50 = GUICtrlCreatelabel ("Easteregg", 1, 127)
    GuiSetState(@sw_show, $egg)
    $ipegg = 130
    Do
    ControlMove ("Easteregg", "Easteregg", $egg2, 65, $ipegg)
    ControlMove ("Easteregg", "Easteregg", $egg3, 65, $ipegg + 84)
    ControlMove ("Easteregg", "Easteregg", $egg4, 65, $ipegg + 168)
    sleep(20)
    $ipegg -= 1
    Until $ipegg <= -243

    [/autoit]
  • Problem mit Download-Status Anzeige

    • andygo
    • 13. Februar 2011 um 19:37

    hier mal ein beispiel wie ich es in einem meiner scirpte verwende:

    Spoiler anzeigen
    [autoit]


    #include <StaticConstants.au3>
    #include <EditConstants.au3>
    #include <ComboConstants.au3>
    #include <GuiConstants.au3>
    #include <WindowsConstants.au3>
    $update = 0
    while $update = 0
    $url = InputBox ( "Download", "URL eingeben" & @CRLF & "Bsp. http://www.site.com/game.exe" )
    $fn = $url
    while StringInStr($fn, "/") > 0
    $fn = StringTrimLeft($fn, StringInStr($fn, "/"))
    wend
    $download = InetGetSize ($url, 1)
    $Form1 = GUICreate("Download", 300, 120)
    $Button1 = GUICtrlCreateButton("Cancel", 100, 84, 100, 25, $WS_GROUP)
    $Progress1 = GUICtrlCreateProgress(20, 30, 260, 25)
    $label1 = GUICtrlCreatelabel($fn, 21, 13, 260, 15)
    $label2 = GUICtrlCreatelabel("0 KB von " & int($download/1024) & " KB", 21, 59, 260, 15 )
    GUISetState(@SW_SHOW)
    Opt("GuiOnEventMode", 0)
    if $download > 0 then
    $update = InetGet ($url, @ScriptDir & "\"&$fn, 1, 1)
    local $sofar, $diff2
    GUICtrlSetData($button1,"Cancel")
    do
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $Button1
    GUICtrlSetData($button1,".")
    EndSwitch
    $sofar=InetGetInfo($update, 0)
    sleep(50)
    $diff2=InetGetInfo($update, 0)
    GUICtrlSetData($Progress1, int(($sofar/$download)*100))
    GUICtrlSetData($label2, int($sofar/1024) & " KB von " & int($download/1024) & " KB (" & round(($diff2-$sofar)/51.2, 1) & " KB/s)")
    if InetGetInfo($update, 2) then GUICtrlSetData($button1,".")
    until GUICtrlRead ($button1) = "."
    if InetGetInfo($update, 2) and InetGetInfo($update, 3) then
    InetClose($update)
    GUIDelete($form1)
    Else
    GUIDelete($form1)
    InetClose($update)
    if msgbox (21,"Download","Download fehlgeschlagen!") = 4 then $update = 0
    endif
    Else
    GUIDelete($form1)
    if msgbox (21,"Download","Download fehlgeschlagen!") = 2 then $update = -1
    endif
    Opt("GuiOnEventMode", 1)
    wend

    [/autoit]
  • _IsPressed() Problem

    • andygo
    • 3. Februar 2011 um 10:56

    prima, dann kann das thema ja als "gelöst" markiert werden :thumbup:

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™