SplashImage oder irgendwas für Transparente Bilder

  • Tach

    Ich versuche gerade eine Art Verfolger für die Maus zu basteln. Dafür würd ich gerne ein Bilchen welches ich in GIMP mit einem Alphakanal versehen habe erst mal nur anzeigen. Das mit der Position sollte nicht allzu schwer sein, ich will eigentlich nur mal wissen, ob und wie ich ein Bild mit Transparenz an gewissen Stellen anzeigen kann. Ich würde aus einfachheit auch gerne auf GDI+ verzichten, denn eigentlich ist das nur ein kleines Freizeitscript (wofür genau seht ihr dann noch).
    Ich hab von chip schonmal folgende Lösung für mein Problem bekommen: https://autoit.de/index.php?page=Thread&threadID=9231 aber irgendwie blick ich da nicht so richtig durch...gibt es evtl. eine einfachere Möglichkeit als ne transparente GUI? Halt so wie ein 2. Cursor (allerdings wird hier nichts angeklickt, es folgt nur der Maus in einem gewissen Abstand).
    Nur mal so als Vorbeugung will ich auch gleich mal sagen, das wird KEIN Spassscript, es wird was "seriöses"...es lässt sich per Tastenkombination beenden, führt im Hintergrund keine unnötigen Dinge aus und hindert den Benutzer nur bedingt am Arbeiten (nähmlich wenn er es WILL).

    Ich hoffe da hat jemand ne Lösung parrat ich habe leider bisher noch nix gefunden.

    c u

    Bild1: Ich beim debuggen

    Einmal editiert, zuletzt von General Kaboom (30. April 2012 um 14:59)

  • Es gibt ein sehr schönes Script von UEZ im Forum. In dem Script wird ein String in seine einzelnen Buchstaben zerlegt, welche sich dann mit einer bestimmten Trägheit an die Maus ranhängen. Benutz mal die SuFu da wirst du es sicher finden, hab den Code grade nicht lokal gefunden.
    Natürlich findet man auch weitere. (Mit GDI+ ;))

    Das Prinziep wird dann sein das es ein GUI gibt (Durchsichtig/Transparent) mit der Größe des Bildschirms. Auf dieses GUI wird dann immer gezeichnet. Das gute daran ist, das man durch das Transparente durchklicken kann, also überall wo auf dem Bild nichts gezeichnet wurde kann man noch hinklicken.

    Als einzigstes Script was ich grade bei mir noch auf dem Rechner rumfliegen hab kann ich dir dashier anbieten (Als Beispiel mit GDI+)

    (Der Code wurde von name22 hier im Forum gepostet! Er ist NICHT von mir)

    Code von name22!!!
    [autoit]

    #include <GUIConstants.au3>
    #include <GDIPlus.au3>
    #include <WinAPI.au3>
    #include <Misc.au3>
    #include <WindowsConstants.au3>

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

    ; - Author: name22 (http://www.autoit.de)

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

    Opt("GUIOnEventMode", 1)
    OnAutoItExitRegister("_Close")

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

    $vUser32DLL = DllOpen("User32.dll")

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

    $iGUIWidth = @DesktopWidth
    $iGUIHeight = @DesktopHeight

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

    $tSize = DllStructCreate($tagSIZE)
    $pSize = DllStructGetPtr($tSize)
    DllStructSetData($tSize, "X", $iGUIWidth)
    DllStructSetData($tSize, "Y", $iGUIHeight)
    $tSource = DllStructCreate($tagPOINT)
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate($tagBLENDFUNCTION)
    $pBlend = DllStructGetPtr($tBlend)
    DllStructSetData($tBlend, "Alpha", 255)
    DllStructSetData($tBlend, "Format", 1)

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

    $hWnd = GUICreate("", $iGUIWidth, $iGUIHeight, 0, 0, BitOR($WS_POPUP, $WS_OVERLAPPED), BitOR($WS_EX_LAYERED, 0x0))
    GUISetState()

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

    $hDC_Window = _WinAPI_GetDC($hWnd)
    $hDC_Buffer = _WinAPI_CreateCompatibleDC($hDC_Window)
    $hBitmap_Buffer = _WinAPI_CreateCompatibleBitmap($hDC_Window, $iGUIWidth, $iGUIHeight)
    _WinAPI_SelectObject($hDC_Buffer, $hBitmap_Buffer)

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

    _GDIPlus_Startup()

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

    $hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDC_Buffer)
    _GDIPlus_GraphicsSetSmoothingMode($hGraphics, 2)

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

    $hPen_Draw = _GDIPlus_PenCreate(0xAA000000, 15)
    _GDIPlus_PenSetLineCap($hPen_Draw, 0x02, 0x02, 2)

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

    GUISetOnEvent($GUI_EVENT_CLOSE, "_Close", $hWnd)
    HotKeySet("{DELETE}", "_Erase")
    HotKeySet("{ESC}", "_Close")

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

    $aMousePos = MouseGetPos()
    $aMousePos_Old = MouseGetPos()

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

    While Sleep(15)
    $aMousePos = MouseGetPos()
    Switch True
    Case _IsPressed("11", $vUser32DLL)
    Switch True
    Case $aMousePos[0] <> $aMousePos_Old[0] Or $aMousePos[1] <> $aMousePos_Old[1]
    _GDIPlus_GraphicsDrawLine($hGraphics, $aMousePos_Old[0], $aMousePos_Old[1], $aMousePos[0], $aMousePos[1], $hPen_Draw)
    EndSwitch
    EndSwitch

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

    $aMousePos_Old = $aMousePos

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

    _WinAPI_UpdateLayeredWindow($hWnd, $hDC_Window, 0, $pSize, $hDC_Buffer, $pSource, 0, $pBlend, 2)
    WEnd

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

    Func _Erase()
    _GDIPlus_GraphicsClear($hGraphics, 0x00000000)
    EndFunc

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

    Func _Close()
    _WinAPI_ReleaseDC($hWnd, $hDC_Window)
    _WinAPI_DeleteDC($hDC_Buffer)
    _WinAPI_DeleteObject($hBitmap_Buffer)

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

    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_PenDispose($hPen_Draw)
    _GDIPlus_Shutdown()

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

    DllClose($vUser32DLL)
    Exit
    EndFunc

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

    #region "GDIP.au3 Functions"
    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _GDIPlus_PenSetLineCap
    ; Description ...: Sets the cap styles for the start, end, and dashes in a line drawn with the pen
    ; Syntax.........: _GDIPlus_PenSetLineCap($hPen, $iStartCap, $iEndCap, $iDashCap)
    ; Parameters ....: $hPen - Pointer to a Pen object
    ; $iStartCap - Line cap style for the start cap:
    ; |0x00 - Line ends at the last point. The end is squared off
    ; |0x01 - Square cap. The center of the square is the last point in the line. The height
    ; +and width of the square are the line width.
    ; |0x02 - Circular cap. The center of the circle is the last point in the line. The diameter
    ; +of the circle is the line width.
    ; |0x03 - Triangular cap. The base of the triangle is the last point in the line. The base
    ; +of the triangle is the line width.
    ; |0x10 - Line ends are not anchored.
    ; |0x11 - Line ends are anchored with a square. The center of the square is the last point in
    ; +the line. The height and width of the square are the line width.
    ; |0x12 - Line ends are anchored with a circle. The center of the circle is at the last point
    ; +in the line. The circle is wider than the line.
    ; |0x13 - Line ends are anchored with a diamond (a square turned at 45 degrees). The center of the diamond is at
    ; +the last point in the line. The diamond is wider than the line.
    ; |0x14 - Line ends are anchored with arrowheads. The arrowhead point is located at the last
    ; +point in the line. The arrowhead is wider than the line.
    ; |0xff - Line ends are made from a CustomLineCap object
    ; $iEndCap - Line cap style for the end cap (same values as $iStartCap)
    ; $iDashCap - Start and end caps for a dashed line:
    ; |0 - A square cap that squares off both ends of each dash
    ; |2 - A circular cap that rounds off both ends of each dash
    ; |3 - A triangular cap that points both ends of each dash
    ; Return values .: Success - True
    ; Failure - False and either:
    ; |@error and @extended are set if DllCall failed
    ; |$GDIP_STATUS contains a non zero value specifying the error code
    ; Remarks .......: None
    ; Related .......: _GDIPlus_PenSetDashCap, _GDIPlus_PenSetEndCap, _GDIPlus_PenSetStartCap
    ; Link ..........; @@MsdnLink@@ GdipSetPenLineCap197819
    ; Example .......; No
    ; ===============================================================================================================================
    Func _GDIPlus_PenSetLineCap($hPen, $iStartCap, $iEndCap, $iDashCap)
    Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetPenLineCap197819", "hwnd", $hPen, "int", $iStartCap, "int", $iEndCap, "int", $iDashCap)

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

    If @error Then Return SetError(@error, @extended, False)
    $GDIP_STATUS = $aResult[0]
    Return $aResult[0] = 0
    EndFunc ;==>_GDIPlus_PenSetLineCap
    #endregion "GDIP.au3 Functions"

    [/autoit]

    mfg BB

    "IF YOU'RE GOING TO KILL IT
    OPEN SOURCE IT!"

    by Phillip Torrone

    Zitat von Shoutbox

    [Heute, 11:16] Andy: ....böseböseböseböse....da erinnere ich mich daran, dass man den Puschelschwanz eines KaRnickels auch "Blume" nennt....ob da eins zum anderen passt? :rofl: :rofl: :rofl: :rofl:

    https://autoit.de/index.php?page…leIt#post251138

    Neon Snake

  • Schau dir aucj einmal https://autoit.de/index.php?page=Thread&amp;threadID=30900 an,

    mfg autoBert

    Hmm :S ...das ist glaub ich nicht so ganz das was ich gesucht habe, ODER ich kappiers einfach nicht. Für mich sieht der Kreis jedenfalls nicht transparent aus wenn man ihn bewegt, kommt der Hintergrund mit :huh: oder mach ich da was falsch. Sorry, dass ich erst jetzt Rückmeldung gebe, aber ich bin im Moment recht im Stress (2 Projektarbeiten aus der Schule und ein Musikprojekt). Ich werds natürlich weiterhin versuchen, wird aber eher so ein "Mir ist langweilig, was nun?"-Projektchen sein. In dem Sinne schliesse ich das Thema ab, danke für eure Hilfe trotzdem. ;)

    Bild1: Ich beim debuggen