Bild = Gui

  • Hai Leute...
    Also Ich würde gerne wissen wie man eine Gui macht die aussieht wie ein Notizzetel..
    1. Ich weis das ich dafür ein Transparents Bild eines Notizzetel brauche..
    2. In welchem Format muss dieses Bild sein(Bmp, Jpg usw..)?
    3. Wie sieht das ganze dann im Sciprt aus?
    4. Mit freundichen Grüßen
    5. CF* Gaming
    ;)

  • Ich find aber nichts!..
    Außerdem sind mehr als die hälfte der Posts hier schonmal gefargt worden!

  • hmm also ich würd das mit gdi+ zeichnen lassen
    also
    1. gui erstellen
    2. transparent machen
    3. bild zeichnen

    so hier n bsp

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <StructureConstants.au3>
    #include <WinAPI.au3>

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

    _GDIPlus_Startup()
    Global $Width = 400, $Height = 400
    $GUI = GUICreate("Ich bin durchsichtig", $Width, $Height, -1, -1, 0x80000000, BitOR(0x00000080, 0x00080000))
    GUISetState()

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

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($GUI)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($Width, $Height, $hGraphic)
    $backbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir &"/Test.png")

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

    $ScreenDc = _WinAPI_GetDC($GUI)
    $dc = _WinAPI_CreateCompatibleDC($ScreenDc)

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

    $tSize = DllStructCreate($tagSIZE)
    $pSize = DllStructGetPtr($tSize)
    DllStructSetData($tSize, "X", $Width)
    DllStructSetData($tSize, "Y", $Height)
    $tSource = DllStructCreate($tagPOINT)
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate($tagBLENDFUNCTION)
    $pBlend = DllStructGetPtr($tBlend)
    DllStructSetData($tBlend, "Alpha", 255)
    DllStructSetData($tBlend, "Format", 1)
    $tPoint = DllStructCreate($tagPOINT)
    $pPoint = DllStructGetPtr($tPoint)
    DllStructSetData($tPoint, "X", 0)
    DllStructSetData($tPoint, "Y", 0)

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

    _GDIPlus_GraphicsDrawImage($backbuffer, $hImage, 0, 0)

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

    $gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _WinAPI_SelectObject($dc, $gdibitmap)
    _WinAPI_UpdateLayeredWindow($GUI, $ScreenDc, 0, $pSize, $dc, $pSource, 0, $pBlend, 2)
    _WinAPI_DeleteObject($gdibitmap)

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

    Do
    Until GUIGetMsg() = -3

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

    _WinAPI_DeleteDC($dc)
    _WinAPI_ReleaseDC($GUI, $ScreenDc)
    _GDIPlus_GraphicsDispose($backbuffer)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()

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