[Projekt] Linkout v1.0.0

  • Hallo!

    Endlich ist mein neustes AutoIt-Projekt fertig: Linkout

    Zitat


    Linkout lädt für Dich jede beliebige Bilddatei von deinem Computer ins Internet, wahlweise auf einen FTP-Server, oder einen kostenlosen Image-Hoster deiner Wahl.

    Des weiteren kannst du mit Linkout auch direkt Bildschirmfotos (sog. Screenshots), Daten aus der Zwischenablage, Bilder deiner Webcam oder Dateien aus dem Internet auswählen - Linkout konvertiert sie, und lädt diese mit nur einem einzigen Klick ins Internet, damit du sie z.B. über Messenger verschicken, oder in Foren und Communities mit einem einfachen Link zeigen kannst.


    Download
    http://www.linkout.de/


    Screenshots

    [Blockierte Grafik: http://pennywise.e-ee.de/Webcam/linkout_20110116_184814193.jpg]


    Source

    Spoiler anzeigen
    [autoit]


    #cs
    Linkout v1.0.0
    programmed by Daniel Jäger
    linkout.de
    #ce

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

    ; Includes (Constants)
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    #include <WindowsConstants.au3>
    #include <WebcamConstants.au3>
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstants.au3>
    #include <Constants.au3>

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

    ; Includes (Functions)
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    #include <ScreenCapture.au3>
    #include <ClipBoard.au3>
    #include <GDIPlus.au3>
    #include <String.au3>
    #include <FTPEx.au3>
    #include <Misc.au3>

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

    ; Globals
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    Global Const $app_name = "Linkout"
    Global Const $app_version = "1.0.0"

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

    Global $window
    Global $windowb = False

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

    Global $webcam_timer = -1

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

    Global $dll_avi
    Global $dll_user
    Global $cap

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

    Global $w = 800
    Global $h = 600

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

    Global $ws = 800
    Global $hs = $ws / (@DesktopWidth / @DesktopHeight)

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

    ; Initialisation & HotKeys & Options
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    AutoItSetOption("TrayMenuMode", 1)

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

    HotKeySet("{PRINTSCREEN}", "File_Snapshot")
    HotKeySet("!{PRINTSCREEN}", "File_SnapshotWin")

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

    _GDIPlus_Startup()

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

    ; GUI (Webcam)
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    $gui_webcam = GUICreate($app_name & " - (Quelle: Webcam)", $w, $h / 2 + 70)

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

    $button_webcam_snap = GUICtrlCreateButton("Foto aufnehmen", 0, $h / 2, $w / 4, 50)
    $button_webcam_wait = GUICtrlCreateButton("Selbstauslöser", $w / 4, $h / 2, $w / 4, 50, $BS_MULTILINE)
    $button_webcam_upload = GUICtrlCreateButton("Hochladen", $w / 2, $h / 2, $w / 2, 50)

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

    Global $webcam_preview
    Webcam_ResetPreview()

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

    $w_quelle = GUICtrlCreateMenu("Linkout")
    $w_quelle_webcam = GUICtrlCreateMenuItem("Webcam", $w_quelle)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $w_quelle_file = GUICtrlCreateMenuItem("Datei", $w_quelle)
    GUICtrlCreateMenuItem("", $w_quelle)
    $w_exit = GUICtrlCreateMenuItem("Beenden", $w_quelle)

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

    $w_settings = GUICtrlCreateMenu("Einstellungen")
    $w_settings_timer = GUICtrlCreateMenuItem("Selbstauslöser...", $w_settings)
    $w_settings_auf = GUICtrlCreateMenuItem("Webcam-Auflösung...", $w_settings)
    $w_settings_cam = GUICtrlCreateMenuItem("Webcam-Einstellungen...", $w_settings)
    GUICtrlCreateMenuItem("", $w_settings)
    $w_settings_upload = GUICtrlCreateMenu("Upload-Methode", $w_settings)
    $w_settings_upload_ftp = GUICtrlCreateMenuItem("FTP-Server", $w_settings_upload, 0, True)
    GUICheck("webcam", "upload", "ftp")
    $w_settings_upload_imageshack = GUICtrlCreateMenuItem("ImageShack.us", $w_settings_upload, 1, True)
    GUICheck("webcam", "upload", "imageshack")
    $w_settings_link = GUICtrlCreateMenu("Link-Ausgabe", $w_settings)
    $w_settings_link_text = GUICtrlCreateMenuItem("Normaler Text", $w_settings_link, 0, True)
    GUICheck("webcam", "link", "plain")
    $w_settings_link_bb = GUICtrlCreateMenuItem("BB-Code", $w_settings_link, 1, True)
    GUICheck("webcam", "link", "bb")
    $w_settings_link_html = GUICtrlCreateMenuItem("HTML-Code", $w_settings_link, 2, True)
    GUICheck("webcam", "link", "html")
    GUICtrlCreateMenuItem("", $w_settings)
    $w_settings_ftp = GUICtrlCreateMenuItem("FTP-Einstellungen...", $w_settings)

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

    $w_help = GUICtrlCreateMenu("Hilfe")
    $w_help_about = GUICtrlCreateMenuItem("Über "&$app_name, $w_help)

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

    ; GUI (File)
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    $gui_file = GUICreate($app_name & " - (Quellen: Dateien, Screenshots)", $ws, $hs + 70, -1, -1, Default, $WS_EX_ACCEPTFILES)

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

    $button_file_select = GUICtrlCreateButton("Lokale Datei auswählen...", 0, $hs, $ws / 5, 50)
    $button_file_load = GUICtrlCreateButton("Von Link downloaden...", $ws / 5, $hs, $ws / 5, 50)
    $button_file_clip = GUICtrlCreateButton("Aus Zwischenablage (Strg+V)", ($ws / 5) * 2, $hs, $ws / 5, 50)
    $button_file_edit = GUICtrlCreateButton("Bild bearbeiten", ($ws / 5) * 3, $hs, $ws / 5, 50)
    $button_file_upload = GUICtrlCreateButton("Hochladen", ($ws / 5) * 4, $hs, $ws / 5, 50)

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

    Global $dropper = GUICtrlCreateLabel("", 0, 0, $ws, $hs)
    GUICtrlSetState(-1, $GUI_DROPACCEPTED)
    GUICtrlSetState(-1, $GUI_DISABLE)

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

    Global $file_preview
    File_ResetPreview()

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

    $f_quelle = GUICtrlCreateMenu("Linkout")
    $f_quelle_webcam = GUICtrlCreateMenuItem("Webcam", $f_quelle)
    $f_quelle_file = GUICtrlCreateMenuItem("Datei", $f_quelle)
    GUICtrlSetState(-1, $GUI_DISABLE)
    GUICtrlCreateMenuItem("", $f_quelle)
    $f_exit = GUICtrlCreateMenuItem("Beenden", $f_quelle)

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

    $f_settings = GUICtrlCreateMenu("Einstellungen")
    $f_settings_image = GUICtrlCreateMenuItem("Screenshot-Qualität...", $f_settings)
    GUICtrlCreateMenuItem("", $f_settings)
    $f_settings_upload = GUICtrlCreateMenu("Upload-Methode", $f_settings)
    $f_settings_upload_ftp = GUICtrlCreateMenuItem("FTP-Server", $f_settings_upload, 0, True)
    GUICheck("file", "upload", "ftp")
    $f_settings_upload_imageshack = GUICtrlCreateMenuItem("ImageShack.us", $f_settings_upload, 1, True)
    GUICheck("file", "upload", "imageshack")
    $f_settings_link = GUICtrlCreateMenu("Link-Ausgabe", $f_settings)
    $f_settings_link_text = GUICtrlCreateMenuItem("Normaler Text", $f_settings_link, 0, True)
    GUICheck("file", "link", "plain")
    $f_settings_link_bb = GUICtrlCreateMenuItem("BB-Code", $f_settings_link, 1, True)
    GUICheck("file", "link", "bb")
    $f_settings_link_html = GUICtrlCreateMenuItem("HTML-Code", $f_settings_link, 2, True)
    GUICheck("file", "link", "html")
    GUICtrlCreateMenuItem("", $f_settings)
    $f_settings_ftp = GUICtrlCreateMenuItem("FTP-Einstellungen...", $f_settings)
    $f_help = GUICtrlCreateMenu("Hilfe")
    $f_help_about = GUICtrlCreateMenuItem("Über "&$app_name, $f_help)

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

    ; GUI (FTP-Settings)
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    $gui_ftp = GUICreate("FTP-Einstellungen", 310, 195)

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

    GUICtrlCreateLabel("Host:", 10, 13)
    $input_ftp_host = GUICtrlCreateInput("", 80, 10, 140)
    GUICtrlCreateLabel("Port:", 225, 13)
    $input_ftp_port = GUICtrlCreateInput("", 252, 10, 28, -1, $ES_NUMBER)
    GUICtrlCreateLabel("Username:", 10, 43)
    $input_ftp_user = GUICtrlCreateInput("", 80, 40, 200)
    GUICtrlCreateLabel("Passwort:", 10, 73)
    $input_ftp_pass = GUICtrlCreateInput("", 80, 70, 200, -1, $ES_PASSWORD)
    GUICtrlCreateLabel("Pfad:", 10, 103)
    $input_ftp_path = GUICtrlCreateInput("", 80, 100, 200)
    $button_ftp_path = GUICtrlCreateButton("?", 285, 100, 20, 22)
    GUICtrlCreateLabel("Adresse:", 10, 133)
    $input_ftp_link = GUICtrlCreateInput("", 80, 130, 200)
    $button_ftp_link = GUICtrlCreateButton("?", 285, 130, 20, 22)

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

    $button_ftp_save = GUICtrlCreateButton("Speichern", 80, 160, 98)
    $button_ftp_abort = GUICtrlCreateButton("Abbrechen", 184, 160, 98)

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

    ; GUI (Screenshot-Quality)
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    $gui_image = GUICreate("Screenshot-Qualität", 310, 110)

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

    GUICtrlCreateLabel("Screenshot-Qualität: (höhere Qualität = größere Dateien)", 10, 13)
    $slider_image = GUICtrlCreateSlider(10, 35, 290, 30)

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

    $button_image_save = GUICtrlCreateButton("Speichern", 100, 75, 98)
    $button_image_abort = GUICtrlCreateButton("Abbrechen", 202, 75, 98)

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

    ; GUI (Selfshot-Timer)
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    $gui_timer = GUICreate("Selbstauslöser", 250, 80)

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

    GUICtrlCreateLabel("Selbstauslöser:", 10, 13)
    $input_timer = GUICtrlCreateInput("5", 90, 10, 50, -1, $ES_NUMBER)
    $stepper_image = GUICtrlCreateUpdown($input_timer)
    GUICtrlCreateLabel("Sekunden", 150, 13)

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

    $button_timer_save = GUICtrlCreateButton("Speichern", 20, 45, 100)
    $button_timer_abort = GUICtrlCreateButton("Abbrechen", 125, 45, 100)

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

    ; Main-Loop
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    GUIGetCurrentWindow()

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

    While 1
    Switch GUIGetMsg()
    Case $w_help_about, $f_help_about
    getInfo($app_name&" v"&$app_version&@CRLF&"programmiert von Daniel Jäger - w3-media.org")
    Case $f_quelle_webcam
    setConfig("main", "quelle", "webcam")
    GUIChangeWindow($gui_webcam)
    Case $w_quelle_file
    setConfig("main", "quelle", "file")
    GUIChangeWindow($gui_file)
    Case $w_settings_cam
    DllCall($dll_user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DLG_VIDEOSOURCE, "int", 0, "int", 0)
    Case $w_settings_auf
    DllCall($dll_user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DLG_VIDEOFORMAT, "int", 0, "int", 0)
    Case $w_settings_ftp, $f_settings_ftp
    Upload_FTP_LoadSettings()
    GUIShowSettings($gui_ftp)
    Case $button_ftp_save
    Upload_FTP_SaveSettings()
    GUIHideSettings($gui_ftp)
    Case $button_ftp_abort
    GUIHideSettings($gui_ftp)
    Case $f_settings_image
    GUICtrlSetData($slider_image, getConfig("file", "quality"))
    GUIShowSettings($gui_image)
    Case $button_image_save
    setConfig("file", "quality", GUICtrlRead($slider_image))
    GUIHideSettings($gui_image)
    Case $button_image_abort
    GUIHideSettings($gui_image)
    Case $w_settings_timer
    GUICtrlSetData($input_timer, getConfig("webcam", "timer"))
    GUIShowSettings($gui_timer)
    Case $button_timer_save
    setConfig("webcam", "timer", GUICtrlRead($input_timer))
    GUIHideSettings($gui_timer)
    Case $button_timer_abort
    GUIHideSettings($gui_timer)
    Case $button_ftp_path
    getInfo("Der Pfad zum Speicherort der hochgeladenen Bilder, getrennt durch Slashs."&@CRLF&"Zum Beispiel: html/bilder/linkout")
    Case $button_ftp_link
    getInfo("Der Link zum Speicherort der Bilder."&@CRLF&"Zum Beispiel: http://mein.server.de/bilder/linkout/")
    Case $button_webcam_snap
    Webcam_Snapshot()
    Case $button_webcam_wait
    If (GUICtrlRead($button_webcam_wait) = "Selbstauslöser") Then
    $webcam_timer = getConfig("webcam", "timer")
    GUISetTimerButton($webcam_timer)
    $realtimer = TimerInit()
    Else
    $webcam_timer = -1
    GUICtrlSetData($button_webcam_wait, "Selbstauslöser")
    EndIf
    Case $button_webcam_upload
    GUICtrlSetState($button_webcam_upload, $GUI_DISABLE)
    Webcam_Upload()
    GUICtrlSetState($button_webcam_upload, $GUI_ENABLE)
    Case $button_file_select
    File_Select()
    Case $button_file_load
    File_Load()
    Case $button_file_clip
    File_Clip()
    Case $button_file_upload
    GUICtrlSetState($button_file_upload, $GUI_DISABLE)
    File_Upload()
    GUICtrlSetState($button_file_upload, $GUI_ENABLE)
    Case $button_file_edit
    File_Edit()
    Case $f_settings_upload_ftp
    setConfig("file", "upload", "ftp")
    Case $f_settings_upload_imageshack
    setConfig("file", "upload", "imageshack")
    Case $f_settings_link_bb
    setConfig("file", "link", "bb")
    Case $f_settings_link_html
    setConfig("file", "link", "html")
    Case $f_settings_link_text
    setConfig("file", "link", "plain")
    Case $w_settings_link_bb
    setConfig("webcam", "link", "bb")
    Case $w_settings_link_html
    setConfig("webcam", "link", "html")
    Case $w_settings_link_text
    setConfig("webcam", "link", "plain")
    Case $w_settings_upload_ftp
    setConfig("webcam", "upload", "ftp")
    Case $w_settings_upload_imageshack
    setConfig("webcam", "upload", "imageshack")
    Case $GUI_EVENT_DROPPED
    File_Dropped()
    Case $GUI_EVENT_CLOSE, $w_exit, $f_exit
    If ($windowb = $gui_ftp) Then
    GUIHideSettings($gui_ftp)
    ElseIf ($windowb = $gui_image) Then
    GUIHideSettings($gui_image)
    Else
    GUISetState(@SW_DISABLE, $window)
    Webcam_Close()
    _GDIPlus_Shutdown()
    Exit
    EndIf
    EndSwitch
    If ($window = $gui_file And _IsPressed("11") And _IsPressed("56")) Then
    While _IsPressed("11") And _IsPressed("56")
    wend
    File_Clip()
    EndIf
    If ($webcam_timer <> -1) Then
    If (TimerDiff($realtimer) >= 1000) Then
    $webcam_timer -= 1
    $realtimer = TimerInit()
    GUISetTimerButton($webcam_timer)
    EndIf
    If ($webcam_timer = 0) Then
    Webcam_Snapshot()
    $webcam_timer = -1
    EndIf
    EndIf
    WEnd

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

    ; Webcam-Functions
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    Func Webcam_Init()
    $dll_avi = DllOpen("avicap32.dll")
    $dll_user = DllOpen("user32.dll")
    $cap = DllCall($dll_avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD, $WS_VISIBLE), "int", 0, "int", 0, "int", $w / 2, "int", $h / 2, "hwnd", $gui_webcam, "int", 1)
    DllCall($dll_user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 0, "int", 0)
    DllCall($dll_user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_SCALE, "int", 1, "int", 0)
    DllCall($dll_user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_OVERLAY, "int", 1, "int", 0)
    DllCall($dll_user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEW, "int", 1, "int", 0)
    DllCall($dll_user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEWRATE, "int", 1, "int", 0)
    EndFunc

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

    Func Webcam_Close()
    If ($window = $gui_webcam) Then
    DllCall($dll_user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_END, "int", 0, "int", 0)
    DllCall($dll_user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_DISCONNECT, "int", 0, "int", 0)
    DllClose($dll_user)
    EndIf
    EndFunc

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

    Func Webcam_Snapshot()
    $filename = @ScriptDir & "/data/webcam.bmp"
    DllCall($dll_user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_GRAB_FRAME_NOSTOP, "int", 0, "int", 0)
    DllCall($dll_user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SAVEDIBA, "int", 0, "str", $filename)
    Webcam_ResetPreview()
    EndFunc

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

    Func Webcam_Upload()
    $newname = getFilename()
    $bitmap = _GDIPlus_BitmapCreateFromFile("data/webcam.bmp")
    _GDIPlus_ImageSaveToFile($bitmap, "data/uploads/"&$newname)
    _GDIPlus_BitmapDispose($bitmap)
    Upload_Complete(Upload_Method("data/uploads/"&$newname, getConfig("webcam", "upload")), getConfig("webcam", "link"))
    EndFunc

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

    Func Webcam_ResetPreview()
    GUICtrlDelete($webcam_preview)
    $webcam_preview = GUICtrlCreatePic("data/webcam.bmp", $w / 2, 0, $w / 2, $h / 2)
    EndFunc

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

    ; File-Functions
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    Func File_Edit()
    GUICtrlDelete($file_preview)
    GUICtrlCreateLabel("Bild wird bearbeitet...", $ws/2-30, $hs/2-35)
    GUISetState(@SW_DISABLE)
    RunWait("mspaint.exe temp.jpg", @ScriptDir & "/data")
    GUISetState(@SW_ENABLE)
    WinActivate($app_name)
    File_ResetPreview()
    EndFunc

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

    Func File_Dropped()
    $drop = _GDIPlus_ImageLoadFromFile(@GUI_DragFile)
    _GDIPlus_ImageSaveToFile($drop, "data/temp.jpg")
    _GDIPlus_ImageDispose($drop)
    File_ResetPreview()
    EndFunc

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

    Func File_Select()
    $dialog = FileOpenDialog($app_name, @DesktopDir, "Bilder (*.jpg;*.png;*.gif;*.bmp;*.jpeg)", 3)
    If (@error) Then
    Return
    EndIf
    $sel = _GDIPlus_ImageLoadFromFile($dialog)
    _GDIPlus_ImageSaveToFile($sel, @ScriptDir & "/data/temp.jpg")
    _GDIPlus_ImageDispose($sel)
    File_ResetPreview()
    EndFunc

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

    Func File_Load()
    $url = InputBox($app_name, "Bitte eine URL eingeben:", "", "", 300, 125)
    If (@error) Then
    Return
    EndIf
    $download = InetGet($url, "data/temp.tmp", 0, 1)
    $size = InetGetSize($url)
    getProgress(False)
    Do
    ProgressSet(InetGetInfo($download, 0) / $size * 100)
    Sleep(250)
    Until InetGetInfo($download, 2)
    ProgressOff()
    $tmp = _GDIPlus_ImageLoadFromFile("data/temp.tmp")
    _GDIPlus_ImageSaveToFile($tmp, "data/temp.jpg")
    _GDIPlus_ImageDispose($tmp)
    File_ResetPreview()
    EndFunc

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

    Func File_Snapshot()
    If ($window <> $gui_file) Then
    Return
    EndIf
    _ScreenCapture_SetJPGQuality(getConfig("file", "quality"))
    _ScreenCapture_Capture(@ScriptDir&"\data\temp.jpg", 0, 0, -1, -1, False)
    File_TakeScreen()
    EndFunc

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

    Func File_SnapshotWin()
    If ($window <> $gui_file) Then
    Return
    EndIf
    $list = WinList()
    _ScreenCapture_SetJPGQuality(getConfig("file", "quality"))
    _ScreenCapture_CaptureWnd(@ScriptDir&"\data\temp.jpg", WinGetHandle("[ACTIVE]"), 0, 0, -1, -1, False)
    File_TakeScreen()
    EndFunc

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

    Func File_TakeScreen()
    File_ResetPreview()
    If (Not WinActive($app_name)) Then
    getTray("Screenshot wurde erstellt.")
    EndIf
    EndFunc

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

    Func File_Clip()
    $clip = ClipGet()
    If (@error = 2) Then
    _ClipBoard_GetData(8)
    $data = "0x424d000000000000000036000000" & StringTrimLeft(_ClipBoard_GetData(8), 2)
    $fhandle = FileOpen("data/temp.tmp", 18)
    FileWrite($fhandle, $data)
    FileClose($fhandle)
    $bitmap = _GDIPlus_ImageLoadFromFile("data/temp.tmp")
    _GDIPlus_ImageSaveToFile($bitmap, "data/temp.jpg")
    _GDIPlus_ImageDispose($bitmap)
    Else
    If (Not FileExists($clip)) Then
    Return
    Else
    $clipfile = _GDIPlus_ImageLoadFromFile($clip)
    _GDIPlus_ImageSaveToFile($clipfile, "data/temp.jpg")
    _GDIPlus_ImageDispose($clipfile)
    EndIf
    EndIf
    File_ResetPreview()
    EndFunc

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

    Func File_ResetPreview()
    $newfile = @ScriptDir&"\data\temp.jpg"
    $new = _GDIPlus_ImageLoadFromFile($newfile)
    $width = _GDIPlus_ImageGetWidth($new)
    $height = _GDIPlus_ImageGetHeight($new)
    _GDIPlus_ImageDispose($new)
    If ($width > $ws Or $height > $hs) Then
    $faktor_w = 100 / $width * $ws / 100
    $faktor_h = 100 / $height * $hs / 100
    If ($faktor_w < $faktor_h) Then
    $faktor = $faktor_w
    Else
    $faktor = $faktor_h
    EndIf
    $nwidth = $width * $faktor
    $nheight = $height * $faktor
    Else
    $nwidth = $width
    $nheight = $height
    EndIf
    $left = ($ws - $nwidth) / 2
    $top = ($hs - $nheight) / 2
    GUICtrlDelete($file_preview)
    $file_preview = GUICtrlCreatePic($newfile, $left, $top, $nwidth, $nheight)
    GUICtrlSetData($dropper, "")
    EndFunc

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

    Func File_Upload()
    $newname = getFilename()
    FileCopy(@ScriptDir & "\data\temp.jpg", "data/uploads/"&$newname)
    Upload_Complete(Upload_Method("data/uploads/"&$newname, getConfig("file", "upload")), getConfig("file", "link"))
    EndFunc

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

    ; Upload-Functions
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    Func Upload_Method($file, $method)
    Switch $method
    Case "imageshack"
    Return Upload_Imageshack($file)
    Case "ftp"
    Return Upload_FTP($file)
    EndSwitch
    EndFunc

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

    Func Upload_Imageshack($file)
    $curl = Run("data/curl.exe --form fileupload=@"&$file&" imageshack.us/upload_api.php", @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    getProgress()
    Do
    $line = StderrRead($curl)
    If ($line <> "") Then
    $s = StringSplit($line, " ", 2)
    If (UBound($s) > 1) Then
    ProgressSet($s[1])
    EndIf
    EndIf
    Until @error
    ProgressOff()
    $line = StdoutRead($curl)
    $str = _StringBetween($line, "<image_link>", "</image_link>")
    Return $str[0]
    EndFunc

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

    Func Upload_FTP($file)
    $con = _FTP_Open("Linkout_"&Random(1000, 9999, 1))
    $ftp = _FTP_Connect($con, getConfig("ftp", "host"), getConfig("ftp", "user"), _StringEncrypt(0, getConfig("ftp", "pass"), "r!6+Gv?3Hb.a-2Uk="))
    If (@error) Then
    getError("Ein Fehler bei der FTP-Verbindung wurde festgestellt.")
    Return False
    EndIf
    $path = StringSplit(getConfig("ftp", "path"), "/")
    $link = getConfig("ftp", "link")
    For $i = 1 To $path[0]
    _FTP_DirSetCurrent($ftp, $path[$i])
    Next
    $filename = StringSplit($file, "/")
    If (FileGetSize($file) < 150 * 1024) Then
    _FTP_FilePut($ftp, $file, $filename[$filename[0]])
    Else
    getProgress()
    _FTP_ProgressUpload($ftp, $file, $filename[$filename[0]], "Upload_FTP_Progress")
    ProgressOff()
    EndIf
    _FTP_Close($con)
    Return $link&$filename[$filename[0]]
    EndFunc

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

    Func Upload_FTP_Progress($percent)
    ProgressSet($percent)
    Return 1
    EndFunc

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

    Func Upload_Complete($filename, $tags)
    If ($filename = False) Then
    Return
    EndIf
    Switch $tags
    Case "html"
    $code = '<img src="'&$filename&'" alt="" />'
    Case "bb"
    $code = ''
    Case "plain"
    $code = $filename
    EndSwitch
    getTray("Das Bild wurde erfolgreich hochgeladen, und der Link in die Zwischenablage kopiert.")
    ClipPut($code)
    EndFunc

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

    ; FTP-Setting-Functions
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    Func Upload_FTP_SaveSettings()
    $data_pass = _StringEncrypt(1, GUICtrlRead($input_ftp_pass), "r!6+Gv?3Hb.a-2Uk=")
    $data_path = GUICtrlRead($input_ftp_path)
    $data_link = GUICtrlRead($input_ftp_link)
    If (StringRight($data_link, 1) <> "/") Then
    $data_link &= "/"
    EndIf
    If (StringLeft($data_path, 1) = "/") Then
    $data_path = StringTrimLeft($data_path, 1)
    EndIf
    If (StringRight($data_path, 1) = "/") Then
    $data_path = StringTrimRight($data_path, 1)
    EndIf
    setConfig("ftp", "host", GUICtrlRead($input_ftp_host))
    setConfig("ftp", "port", GUICtrlRead($input_ftp_port))
    setConfig("ftp", "user", GUICtrlRead($input_ftp_user))
    setConfig("ftp", "link", $data_link)
    setConfig("ftp", "path", $data_path)
    setConfig("ftp", "pass", $data_pass)
    EndFunc

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

    Func Upload_FTP_LoadSettings()
    GUICtrlSetData($input_ftp_host, getConfig("ftp", "host"))
    GUICtrlSetData($input_ftp_link, getConfig("ftp", "link"))
    GUICtrlSetData($input_ftp_path, getConfig("ftp", "path"))
    GUICtrlSetData($input_ftp_port, getConfig("ftp", "port"))
    GUICtrlSetData($input_ftp_user, getConfig("ftp", "user"))
    GUICtrlSetData($input_ftp_pass, "********")
    EndFunc

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

    ; GUI-Functions
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    Func GUISetTimerButton($secs)
    If ($secs <> 0) Then
    $word = "Sekunde"
    If ($secs <> 1) Then
    $word &= "n"
    EndIf
    GUICtrlSetData($button_webcam_wait, $webcam_timer & " " & $word & @CRLF & "(Abbrechen)")
    Else
    GUICtrlSetData($button_webcam_wait, "Selbstauslöser")
    EndIf
    EndFunc

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

    Func GUICheck($section, $name, $value)
    If (getConfig($section, $name) = $value) Then
    GUICtrlSetState(-1, $GUI_CHECKED)
    EndIf
    EndFunc

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

    Func GUIHideSettings($hide)
    GUISetState(@SW_ENABLE, $window)
    GUISetState(@SW_HIDE, $hide)
    $windowb = False
    GUISwitch($window)
    EndFunc

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

    Func GUIShowSettings($show)
    $windowb = $show
    GUISetState(@SW_DISABLE, $window)
    GUISetState(@SW_SHOW, $show)
    EndFunc

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

    Func GUIChangeWindow($new)
    If ($new = $gui_webcam) Then
    Webcam_Init()
    Else
    Webcam_Close()
    EndIf
    GUISetState(@SW_HIDE, $window)
    $window = $new
    GUISetState(@SW_SHOW, $window)
    EndFunc

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

    Func GUIGetCurrentWindow()
    If (getConfig("main", "quelle") = "file") Then
    GUIChangeWindow($gui_file)
    Else
    GUIChangeWindow($gui_webcam)
    EndIf
    EndFunc

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

    ; Notification-Functions
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    Func getError($text)
    MsgBox(16+8192, $app_name, $text)
    EndFunc

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

    Func getInfo($text)
    MsgBox(64+8192, $app_name, $text)
    EndFunc

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

    Func getTray($text)
    TrayTip($app_name, $text, 3)
    EndFunc

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

    ; Misc-Functions
    ; ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

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

    Func getProgress($up = True)
    If ($up) Then
    $m = "Bild wird hochgeladen."
    Else
    $m = "Bild wird runtergeladen."
    EndIf
    ProgressOn($app_name, "", $m)
    EndFunc

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

    Func getConfig($section, $key)
    Return IniRead("data/config.ini", $section, $key, "")
    EndFunc

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

    Func setConfig($section, $key, $value)
    IniWrite("data/config.ini", $section, $key, $value)
    EndFunc

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

    Func getFilename()
    Return "linkout_"&@YEAR&@MON&@MDAY&"_"&@HOUR&@MIN&@SEC&@MSEC&".jpg"
    EndFunc

    [/autoit]

    2 Mal editiert, zuletzt von Pennywise (16. Januar 2011 um 19:01)

  • hallo,

    sowas habe ich auch schon mal gemacht, reduziert auf curl.exe als einziges fileinclude.
    (die restlichen fileincludes kann ich zusenden, die haben aber keinen funktion sondern nur optik)

    Spoiler anzeigen
    [autoit]

    #RequireAdmin
    #include <StaticConstants.au3>
    #include <EditConstants.au3>
    #include <ComboConstants.au3>
    #include <GuiConstants.au3>
    #include <WindowsConstants.au3>
    #include <Timers.au3>
    #Include <Misc.au3>
    #include <Constants.au3>
    #Include <ScreenCapture.au3>
    #include <GDIPlus.au3>
    #include <file.au3>
    #include <IE.au3>
    Break(0)
    Opt("TrayAutoPause",0)
    Opt("WinTitleMatchMode", 2)
    FileInstall("dvbs-de.lng", @TempDir & "\dvbs-de.lng", 1)
    FileInstall("dvbs-en.lng", @TempDir & "\dvbs-en.lng", 1)
    if StringInStr("0409 0809 0c09 1009 1409 1809 1c09 2009 2409 2809 2c09 3009 3409", @OSLang) then
    $language = "english"
    else
    $language = "deutsch"
    endif
    Dim $interface
    _FileReadToArray(@TempDir & "\dvbs-"&StringLeft($language, 2)&".lng",$interface)
    SplashTextOn("LiveSnap", @CRLF & $interface[1], 250, 80)
    FileInstall("a2.jpg", @TempDir & "\a2.jpg", 1)
    FileInstall("oben.jpg", @TempDir & "\oben.jpg", 1)
    FileInstall("unten.jpg", @TempDir & "\unten.jpg", 1)
    FileInstall("links.jpg", @TempDir & "\links.jpg", 1)
    FileInstall("rechts.jpg", @TempDir & "\rechts.jpg", 1)
    FileInstall("dummy", @TempDir & "\_curlrc", 1)
    FileInstall("curl.exe", @TempDir & "\curl.exe", 1)
    $datei2 = @TempDir & "\09876.jpg"
    Opt ("TrayIconHide", 1)
    Opt("GuiOnEventMode", 1)
    Global $s_right, $s_down, $newcurl, $waiting, $chars, $show, $ip, $i, $opt4, $Height2, $GUI_2, $s_left, $s_top, $s_width, $s_height, $Width2, $opt3
    $maingui = GuiCreate("LiveSnap compact", 305, 135)
    GUISetbkColor(0xe0e0e0)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit")
    $snip = GuiCtrlCreateButton("", 38, 4, 80, 20)
    GUICtrlSetData($snip, "Desktop")
    GUICtrlSetOnEvent($snip, "_snip")
    $shack = GuiCtrlCreateButton("", 38, 30, 80, 20)
    GUICtrlSetData($shack, $interface[9])
    GUICtrlSetOnEvent($shack, "_shack")
    $c09 = GuiCtrlCreateLabel($interface[29], 217, 116, 90, 14, $SS_CENTER);bereit anzeige
    GUICtrlSetColor(-1, 0x008000)
    $c08 = GUICtrlCreatelabel ("", 3, 115, 213, 17, $SS_CENTER);url anzeige
    GUICtrlSetOnEvent(-1, "_directurl")
    $c210 = GUICtrlCreatePic (@TempDir & "\oben.jpg", 154, 2, 149, 3)
    $c211 = GUICtrlCreatePic (@TempDir & "\unten.jpg", 154, 85, 149, 3)
    $c212 = GUICtrlCreatePic (@TempDir & "\links.jpg", 154, 5, 3, 81)
    $c213 = GUICtrlCreatePic (@TempDir & "\rechts.jpg", 300, 5, 3, 81)
    $oIEp = _IECreateEmbedded ()
    $c21 = GUICtrlCreateObj($oIEp, 157, 5, 143, 80)
    $oIEp.navigate("about:blank")
    repic(@TempDir & "\a2.jpg", 144, 81, 1)
    $c23 = GuiCtrlCreateinput("", 55, 60, 30, 17, $ES_NUMBER)
    GUICtrlSetLimit (-1, 4)
    GUICtrlSetTip ( $c23, $interface[192])
    $c24 = GUICtrlCreateCombo ($interface[34], 125, 90, 176, 17, $CBS_DROPDOWNLIST)
    GUICtrlSetData(-1,"|HTML")
    $cl2 = GUICtrlCreateCombo ("abload.de", 2, 90, 120, 10, $CBS_DROPDOWNLIST)
    GUICtrlSetData(-1,"imagebanana.com|imageshack.us|img-teufel.de|directupload.net|pic-upload.de")
    $dialog = @WindowsDir & "\"
    SplashOff()
    GuiSetState(@sw_show, $maingui)
    $hi = WinGetHandle ("[ACTIVE]")
    $fastx = _WinAPI_GetSystemMetrics(78)
    $fasty = _WinAPI_GetSystemMetrics(79)
    func repic($rp, $rp1, $rp2, $rp3)
    _GDIPlus_Startup()
    $hImage = _GDIPlus_ImageLoadFromFile($rp)
    $Width = _GDIPlus_ImageGetWidth($hImage)
    $Height = _GDIPlus_ImageGetHeight($hImage)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()
    $i = $rp1
    $xa = $Width / $rp1
    $tip = ""
    if $Width <> $rp1 and $Height <> $rp2 then $tip = $Width&" * "&$Height&" Pixel"
    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)
    if $rp3 = 1 then $oIEp.document.write("<body oncontextmenu='return false' scroll='no' style='border:0;margin-top:"&$Height3&"px; margin-left:"&$Width3&"px;background-image:url("&@TempDir & "\a2.jpg)'><img src =" & $rp & " width="&$Width2&" height="&$Height2&" alt='"&$tip&"'></body>")
    $oIEp.refresh
    endif
    endfunc
    While 1
    sleep(20)

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

    If stringinstr (GUICtrlRead($snip), "Cancel") > 0 Then
    GUICtrlSetData($snip, "Desktop")
    if $waiting = 0 Then
    _dis()
    WinSetState ($hi, "", @SW_ENABLE )
    _area($snip, "Cancel")
    GUIDelete($GUI_2)
    $timestamp = @MDAY & "." & @MON & "." & @YEAR & "--" & @HOUR & "-" & @MIN & "-" & @SEC
    $time2 = StringReplace (StringReplace ($timestamp, "--", " "), "-", ":")
    if $s_width > 5 and $s_height > 5 then
    $hBitmap = _ScreenCapture_Capture($datei2, $s_left, $s_top, $s_right, $s_down, false)
    repic($datei2, 144, 81, 1)
    endif
    GUICtrlSetState ($snip, $GUI_ENABLE)
    If FileExists($datei2) Then
    If FileExists($datei2) Then
    _wmark(int(GUICtrlRead($c23)))
    GUICtrlSetState ($snip, $GUI_ENABLE)
    _d2()
    If FileExists (@TempDir & "\curl.txt") Then
    _load($snip)
    else
    _lableer()
    endif
    endif
    Else
    GUICtrlSetState ($snip, $GUI_DISABLE)
    repic(@TempDir & "\a2.jpg", 144, 81, 1)
    _lableer()
    EndIf
    GUICtrlSetColor($c09, 0x008000)
    GUICtrlSetData ($c09, $interface[29])
    _en()
    $waiting = 0
    WinActivate ($hi, $interface[29])
    EndIf
    GUICtrlSetData($snip, "Desktop")
    endif

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

    If stringinstr (GUICtrlRead($shack), "Cancel") > 0 Then
    if $waiting = 0 Then
    $typ = "..jpg"
    $fehler = 0
    $quest = 0
    _dis()
    $datei4pre = FileOpenDialog("Browse...", $dialog, "Images (*.jpg;*.png;*.gif;*.bmp;*.tif)", 1 + 2 + 4)
    $4c2 = StringLeft ($datei4pre, stringinstr ($datei4pre, "|") - 1) & "\"
    $datei4pre = StringTrimLeft ($datei4pre, stringinstr ($datei4pre, "|"))
    $datei4 = $4c2 & $datei4pre
    if stringleft ($datei4, 1) = "\" then $datei4 = stringtrimleft ($datei4, 1)
    GUICtrlSetData($shack, "Cancel")
    $dialog = StringLeft($datei4, StringInStr ($datei4, "\", 0, -1))
    $typ4 = StringRight ($datei4, 3)
    $4log = $datei4
    If @error Then
    $fehler = 0
    elseif $typ4 <> "bmp" AND $typ4 <> "tif" AND $typ4 <> "jpg" AND $typ4 <> "png" AND $typ4 <> "gif" AND $typ4 <> "" then
    MsgBox(16,$interface[18], $interface[68])
    $fehler=1
    elseif StringLen ($datei4) > 0 then
    GUICtrlSetData ($c08, $datei4)
    if (StringLen ($datei4) - StringInStr ($datei4, "\", 0, -1)) > 20 OR StringInStr ($datei4, " ") > 0 then
    FileCopy ($datei4, @TempDir & "\ptmp." & $typ4, 1)
    $datei4 = @TempDir & "\ptmp." & $typ4
    endif
    if StringLen (GUICtrlRead($c08)) = 0 then
    MsgBox(16,$interface[18], $interface[69])
    $datei4 = ""
    $fehler=1
    endif
    else
    $fehler=1
    EndIf
    if $fehler=0 then
    FileDelete (@TempDir & "\curl.txt")
    $timestamp = @MDAY & "." & @MON & "." & @YEAR & "--" & @HOUR & "-" & @MIN & "-" & @SEC
    $time2 = StringReplace (StringReplace ($timestamp, "--", " "), "-", ":")
    if $typ4 = "gif" then
    $datei5 = $datei2
    $datei2 = $datei4
    _curl($datei2)
    repic($datei2, 144, 81, 1)
    else
    FileCopy ($datei4, $datei2, 1)
    repic($datei2, 144, 81, 1)
    $typ4 = "jpg"
    If FileExists($datei2) Then
    _wmark(int(GUICtrlRead($c23)))
    endif
    endif
    GUICtrlSetState ($shack, $GUI_ENABLE)
    If FileExists($datei2) Then
    GUICtrlSetState ($shack, $GUI_ENABLE)
    $typ = ".jpg"
    _d2()
    If FileExists (@TempDir & "\curl.txt") Then
    _load($shack)
    else
    _lableer()
    endif
    endif
    if $typ4 = "gif" then
    $datei2 = $datei5
    _curl($datei2)
    endif
    GUICtrlSetColor($c09, 0x008000)
    GUICtrlSetData ($c09, $interface[29])
    else
    $dialog = @WindowsDir & "\"
    _lableer()
    WinActivate ($hi, $interface[29])
    EndIf
    $typ = StringRight ($datei2, 4)
    _en()
    $typ4 = ""
    $waiting = 0
    $4log = 0
    WinActivate ($hi, $interface[29])
    EndIf
    GUICtrlSetData($shack, $interface[9])
    EndIf
    WEnd

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

    Func _Quit()
    if msgbox(68,"LiveSnap",$interface[22]) = 6 then Exit
    EndFunc

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

    Func _snip()
    _tv($snip, "Desktop")
    EndFunc

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

    Func _shack()
    _tv($shack, $interface[9])
    EndFunc

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

    Func _tv($tv1, $tv2)
    Switch GUICtrlRead($tv1)
    Case $tv2
    $ip = 0
    if $tv1 = $snip or $tv1 = $shack then
    if int(guictrlread($c23)) > 2500 then msgbox(16,$interface[18], $interface[79])
    if int(guictrlread($c23)) <= 2500 and $waiting = 0 Then GUICtrlSetData($tv1, "Cancel")
    Else
    if $waiting = 0 Then GUICtrlSetData($tv1, "Cancel")
    endif
    Case else
    _exx()
    GUICtrlSetData($tv1, $tv2)
    EndSwitch
    EndFunc

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

    func _exx()
    $ip = -1
    $waiting = 0
    GUICtrlSetData ($c08, "")
    repic(@TempDir & "\a2.jpg", 144, 81, 1)
    FileDelete (@TempDir & "\curl.txt")
    GUICtrlSetData ($c09, $interface[86])
    _en()
    endfunc

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

    Func _curl($curl)
    Switch $opt3
    Case "imageshack.us"
    $newcurl = '-F fileupload=@"' & $curl & '" -H Expect: -o curl.txt --location-trusted --url "http://ufo.imageshack.us/"'
    Case "abload.de"
    $newcurl = '-F img0=@"' & $curl & '" -H Expect: -o curl.txt --url "http://www.abload.de/upload.php"'
    case "andygo1.de"
    $newcurl = '-F andygo=@"' & $curl & '" -H Expect: -o curl.txt --url "http://www.andygo1.de/upload.php"'
    Case "imagebanana.com"
    $newcurl = '-F upload[]=@"' & $curl & '" -F send=Hochladen! -H Expect: -o curl.txt --location-trusted --url "http://www.imagebanana.com/"'
    Case "pic-upload.de"
    $newcurl = '-F file=@"' & $curl & '" -F Submit=" Bild Hochladen" -H Expect: -o curl.txt --url "http://www.pic-upload.de/index.php?to=upload"'
    Case "directupload.net"
    $newcurl = '-F bilddatei=@"' & $curl & '" -H Expect: -o curl.txt --url "http://www.directupload.net/index.php?mode=upload"'
    Case "img-teufel.de"
    $newcurl = '-F upload_image=@"' & $curl & '" -H Expect: -o curl.txt --url "http://www.img-teufel.de/upload.html"'
    case "OFFLINE - MODUS"
    ;ok
    Case Else
    Exit MsgBox(16, $interface[18], $interface[97])
    EndSwitch
    EndFunc

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

    Func _wmark($wm4)
    if int(GUICtrlRead($c23)) > 0 then
    repic($datei2, int(GUICtrlRead($c23)), 99999, 0)
    _GDIPlus_Startup()
    $hBitmap1 = _WinAPI_CreateBitmap($Width2, $Height2, 1, 32)
    $hImage = _GDIPlus_ImageLoadFromFile($datei2)
    $hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap1)
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage1)
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 0, 0, $Width2, $Height2)
    _GDIPlus_BitmapDispose($hImage)
    _GDIPlus_ImageSaveToFile($hImage1, $datei2)
    _GDIPlus_BitmapDispose($hImage1)
    _WinAPI_DeleteObject ($hBitmap1)
    _GDIPlus_Shutdown()
    endif
    repic($datei2, 144, 81, 1)
    EndFunc

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

    Func _d2()
    $skb = (FileGetSize ($datei2) / 1024)
    local $foo = Run(FileGetShortName(@TempDir) & "\" & "curl.exe " & $newcurl, FileGetShortName(@TempDir) & "\" , @SW_HIDE, $STDERR_CHILD), $line
    While $ip = 0 and ProcessExists ( "curl.exe")
    $line = StderrRead($foo)
    $line = StringRegExp($line, '\d+', 3)
    if NOT @error then
    if $line[0] = 100 then $line[0] = 99
    GUICtrlSetData ($c09, "uploading " & $line[0] & " %")
    endif
    sleep(50)
    if $waiting = 0 then exitloop
    Wend
    Processclose ( "curl.exe")
    GUICtrlSetData ($c09, "uploading 100 %")
    if FileExists (@TempDir & "\" & "\curl.txt") = 0 Then FileInstall("dummy", @TempDir & "\" & "\curl.txt", 1)
    EndFunc

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

    func _load($ldi)
    $file = FileOpen(@TempDir & "\" & "\curl.txt", 0)
    $chars = FileRead($file)
    FileClose($file)
    _filter($datei2)
    if stringlen ($chars) > 100 then $chars = "Error"
    $show = $chars
    if stringinstr ($show, ".jpg") > 0 or stringinstr ($show, ".gif") > 0 then
    GUICtrlSetData($c08, $interface[195])
    if GUICtrlRead($c24) = $interface[34] then ClipPut($show & @CRLF)
    if GUICtrlRead($c24) = "HTML" then ClipPut("<img src="""&$show&""">"& @CRLF)
    if stringinstr(GUICtrlRead($c24), ""& @CRLF)
    endif
    EndFunc

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

    func _dis()
    $opt3 = GUICtrlRead($cl2)
    _curl($datei2)
    FileDelete ( @TempDir & "\curl.txt" )
    FileDelete (@TempDir & "\test.txt")
    FileDelete ( $datei2 )
    $waiting = 1
    $x = ""
    $y = ""
    For $i = $snip to $c08
    GUICtrlSetState ($i, $GUI_DISABLE)
    next
    GUICtrlSetState ($c09, $GUI_ENABLE)
    GUICtrlSetColor($c09,0xff0000)
    GUICtrlSetData ($c09, "preparing upload...")
    EndFunc

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

    func _en()
    For $i = $snip to $c08
    GUICtrlSetState ($i, $GUI_ENABLE)
    next
    GUICtrlSetData ($c09, $interface[29])
    EndFunc

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

    func _filter($filter)
    if $opt3 = "imageshack.us" then
    $result = StringInStr($chars, "url_image_path"" value=""")
    $chars = StringTrimLeft($chars, $result + 22)
    $result = StringInStr($chars, """")
    $res2 = StringLen ($chars)
    $chars = StringTrimRight($chars, $res2 - $result + 1)
    $result = StringInStr($chars, "/")
    $res2 = StringLeft ($chars, $result -1)
    $chars = "http://" & $res2 & ".imageshack.us/" & $chars
    elseif $opt3 = "abload.de" then
    $result = StringInStr($chars, "&quot;;}}")
    $res2 = StringLen ($chars)
    $chars = StringTrimRight($chars, $res2 - $result + 1)
    while StringInStr($chars, ":&quot;") > 0
    $res2 = StringInStr($chars, ":&quot;")
    $chars = StringTrimLeft($chars, $res2 + 6)
    wend
    $chars = "http://www.abload.de/img/" & $chars
    elseif $opt3 = "imagebanana.com" then
    $result = StringInStr($chars, "]")
    $res2 = StringLen ($chars)
    $chars = StringTrimRight($chars, $res2 - $result + 1)
    $chars = StringReplace ($chars, "/thumb", "")
    elseif $opt3 = "directupload.net" then
    $result = StringInStr($chars, "[URL=http://www.directupload.net]")
    $res2 = StringLen ($chars)
    $chars = StringTrimRight($chars, $res2 - $result + 1)
    elseif $opt3 = "img-teufel.de" then
    $result = StringInStr($chars, "[Blockierte Grafik: http://www.img-teufel.de/uploads/&quot;)<br>%20%20%20%20%20%20%20%20%24chars%20=%20StringTrimLeft(%24chars,%20%24result%20+%204)<br>%20%20%20%20%20%20%20%20%24result%20=%20StringInStr(%24chars,%20&quot;]")
    $res2 = StringLen ($chars)
    $chars = StringTrimRight($chars, $res2 - $result + 1)
    Else
    MsgBox(16, $interface[18], $interface[113])
    Exit
    EndIf
    endfunc

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

    Func _lableer()
    GUICtrlSetColor($c09, 0x008000)
    GUICtrlSetData ($c09, $interface[29])
    ClipPut ("")
    repic(@TempDir & "\a2.jpg", 144, 81, 1)
    GUICtrlSetData($c08, "")
    $show = ""
    EndFunc

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

    Func IsVisible($handle)
    If BitAnd(WinGetState($handle), 2) Then
    Return 1
    Else
    Return 0
    EndIf
    EndFunc

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

    Func _directurl()
    if StringInStr ($show, "http://") > 0 Then
    if GUICtrlRead($c24) = $interface[34] then ClipPut($show & @CRLF)
    if GUICtrlRead($c24) = "HTML" then ClipPut("<img src="""&$show&""">"& @CRLF)
    if stringinstr(GUICtrlRead($c24), ""& @CRLF)
    GUICtrlSetData($c08, $interface[137])
    sleep(400)
    GUICtrlSetData($c08, $interface[195])
    endif
    EndFunc

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

    func _area($a1, $a2)
    $var = WinList()
    For $i = 1 to $var[0][0]
    If $var[$i][0] <> "" AND $var[$i][0] <> "start" AND IsVisible($var[$i][1]) Then WinSetState ($var[$i][0], "", @SW_DISABLE )
    Next
    $GUI_2 = GUICreate("", 1, 1, -1, -1, 0x80000000 + 0x00800000, 0x00000008)
    GUISetBkColor(0x0c6eec)
    WinSetTrans($GUI_2, "", 130)
    local $s_left = "", $s_top = "", $s_width = "", $s_height = "", $mgp[2]
    $mpos = MouseGetPos()
    Local $hGUI_Cross = GUICreate("", 30, 30, $mpos[0], $mpos[1], $WS_POPUP, $WS_DISABLED + $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST)
    GUISetState(@SW_SHOW, $hGUI_Cross)
    WinSetTrans($hGUI_Cross, "", 1)
    GUISetCursor(3)
    $x = WinGetPos($hi)
    $y = 0
    ToolTip($interface[199] & @CRLF & $interface[200] & @CRLF & @CRLF & $interface[201], $x[0]+160, $x[1]+35)
    $ii = GUICtrlRead($a1)
    $i = _Timer_Init()
    While Not _IsPressed(01)
    if _Timer_Diff($i) > 400 then
    GUICtrlSetData($a1, "")
    endif
    if _Timer_Diff($i) > 800 then
    $i = _Timer_Init()
    GUICtrlSetData($a1, $ii)
    endif
    $mgp = MouseGetPos()
    WinMove($hGUI_Cross, "", $mgp[0] - 15, $mgp[1] - 15)
    Sleep(20)
    if $y < 61 then $y += 1
    if $y = 15 or $y = 45 then ToolTip("")
    if $y = 30 or $y = 60 then ToolTip($interface[199] & @CRLF & $interface[200] & @CRLF & @CRLF & $interface[201], $x[0]+160, $x[1]+35)
    if _IsPressed("1B") then exitloop
    WEnd
    GUICtrlSetData($a1, $a2)
    WinMove($GUI_2, "", $mgp[0], $mgp[1], 1, 1)
    GUISetState(@SW_SHOW, $GUI_2)
    if _IsPressed(01) then
    While _IsPressed(01)
    $mgp_2 = MouseGetPos()
    If $mgp_2[0] > $mgp[0] And $mgp_2[1] > $mgp[1] Then
    local $s_left = $mgp[0], $s_top = $mgp[1], $s_width = $mgp_2[0] - $mgp[0], $s_height = $mgp_2[1] - $mgp[1], $s_right = $mgp_2[0], $s_down = $mgp_2[1]
    ElseIf $mgp_2[0] > $mgp[0] And $mgp_2[1] < $mgp[1] Then
    Local $s_left = $mgp[0], $s_top = $mgp_2[1], $s_width = $mgp_2[0] - $mgp[0], $s_height = $mgp[1] - $mgp_2[1], $s_right = $mgp_2[0], $s_down = $mgp[1]
    ElseIf $mgp_2[0] < $mgp[0] And $mgp_2[1] > $mgp[1] Then
    Local $s_left = $mgp_2[0], $s_top = $mgp[1], $s_width = $mgp[0] - $mgp_2[0], $s_height = $mgp_2[1] - $mgp[1], $s_right = $mgp[0], $s_down = $mgp_2[1]
    ElseIf $mgp_2[0] < $mgp[0] And $mgp_2[1] < $mgp[1] Then
    Local $s_left = $mgp_2[0], $s_top = $mgp_2[1], $s_width = $mgp[0] - $mgp_2[0], $s_height = $mgp[1] - $mgp_2[1], $s_right = $mgp[0], $s_down = $mgp[1]
    EndIf
    WinMove($GUI_2, "", $s_left, $s_top, $s_width, $s_height)
    ToolTip($s_width & "x" & $s_height)
    sleep(5)
    WEnd
    endif
    ToolTip("")
    GUIDelete($hGUI_Cross)
    GLOBAL $s_left = $s_left, $s_top = $s_top, $s_width = $s_width, $s_height = $s_height, $s_right = $s_right, $s_down = $s_down
    $var = WinList()
    For $i = 1 to $var[0][0]
    If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then WinSetState ($var[$i][0], "", @SW_ENABLE )
    Next
    endfunc

    [/autoit]


    mich würde dein quelltext mal interessieren, quasi als ideenaustausch.

    lg andy

  • Bist du Webdesigner? Die Website ist ja so geil :D .
    Wäre schön mal ein paar Screenshots zu sehen, da ich gerade kz habe das Programm herunterzuladen.
    Wenn die GUI auch noch so schön ist (Screeeenshots), dann lad ich mirs aufjedenfall herunter.
    - w3-media-website sieht ja auch ganz gut aus.. genial :thumbup: ; Ihr designt Websiten?
    MfG AntiSpeed

    Nur keine Hektik - das Leben ist stressig genug

  • Bist du Webdesigner? Die Website ist ja so geil :D .
    Wäre schön mal ein paar Screenshots zu sehen, da ich gerade kz habe das Programm herunterzuladen.
    Wenn die GUI auch noch so schön ist (Screeeenshots), dann lad ich mirs aufjedenfall herunter.
    - w3-media-website sieht ja auch ganz gut aus.. genial :thumbup: ; Ihr designt Websiten?
    MfG AntiSpeed


    Kann deinen Eifer für die Webseite gerade nicht verstehen, ist ja nichts besonderes, auf jeden fall meiner meinug nach.
    Ohne gestalltung der Grafiken vllt ne Arbeit von 30 min.

    mfg Darter

    Das finden von Rechtschreibfehlern muss sofort und unverzüglich dem Autor gemeldet werden. Das eigennützige Verwenden dieser Rechtschreibfehler ist strengstens untersagt und kann mit Freiheitsenzug bestraft werden.

  • Darter:
    Ja ich weiß, dass es nicht sehr viel Arbeit ist (wenn mans kann ^^ ).
    Aber das ist so desgnt wie Google das macht (und Google setzt ja wohl Maßstäbe an denen man sich orientieren sollte)
    Guck: http://www.google.de/ , http://www.youtube.com/ :D
    Edit: http://www.lastfm.de/, http://www.nerdcore.de/, http://www.engadget.com/, http://de.wikipedia.org/ (sehr viele Website außer Google machen das auch..)
    Das ist schon Web 2.5 oder 3.0 :thumbup: (nach meiner Meinung, da es so eine Mitte zwischen 1.0 und 2.0 ist [informationsreich, schlicht, nicht zu bund])

    Nur keine Hektik - das Leben ist stressig genug

  • Sry aber ich versteh dich nicht. ich weiß beim besten nicht was die Seiten gemeinsam haben sollen und was willst du dich an Google orientiren? Google hat ein Logo eine inputbox und 2 Buttons, und das nicht erst seit gestern, also wo setzt da Google bitte Masstäbe, an denen man sich Orientireren soll ?

    Das finden von Rechtschreibfehlern muss sofort und unverzüglich dem Autor gemeldet werden. Das eigennützige Verwenden dieser Rechtschreibfehler ist strengstens untersagt und kann mit Freiheitsenzug bestraft werden.

  • hallo,

    sowas habe ich auch schon mal gemacht, reduziert auf curl.exe als einziges fileinclude.
    (die restlichen fileincludes kann ich zusenden, die haben aber keinen funktion sondern nur optik)

    mich würde dein quelltext mal interessieren, quasi als ideenaustausch.

    lg andy

    Hab mich dazu durchgerungen den Source mal an den ersten Post zu hängen. ;)

    Bist du Webdesigner? Die Website ist ja so geil :D .
    Wäre schön mal ein paar Screenshots zu sehen, da ich gerade kz habe das Programm herunterzuladen.
    Wenn die GUI auch noch so schön ist (Screeeenshots), dann lad ich mirs aufjedenfall herunter.
    - w3-media-website sieht ja auch ganz gut aus.. genial :thumbup: ; Ihr designt Websiten?
    MfG AntiSpeed

    Jap, mit Internetseiten verdiene ich mein Geld. :)
    Screenshot ist angehängt - geht ja praktischerweise mit dem Programm zu erstellen. :D
    Ist natürlich simpel und einfach aufgebaut, aber hab es mit Funktionen nur so überschüttet. ^^


    Kann deinen Eifer für die Webseite gerade nicht verstehen, ist ja nichts besonderes, auf jeden fall meiner meinug nach.
    Ohne gestalltung der Grafiken vllt ne Arbeit von 30 min.

    mfg Darter

    Selbst mit der Gestaltung der Grafiken nur 30 Min. ;)
    Dahinter steht ja kein "echtes" CMS, nur nen simples Script und ne .htaccess mit ModRewrite.
    So nen Script samt (validem) XHTML bastel ich in 5-10 Minuten. :D

    Darter:
    Ja ich weiß, dass es nicht sehr viel Arbeit ist (wenn mans kann ^^ ).
    Aber das ist so desgnt wie Google das macht (und Google setzt ja wohl Maßstäbe an denen man sich orientieren sollte)
    Guck: http://www.google.de/ , http://www.youtube.com/ :D
    Edit: http://www.lastfm.de/, http://www.nerdcore.de/, http://www.engadget.com/, http://de.wikipedia.org/ (sehr viele Website außer Google machen das auch..)
    Das ist schon Web 2.5 oder 3.0 :thumbup: (nach meiner Meinung, da es so eine Mitte zwischen 1.0 und 2.0 ist [informationsreich, schlicht, nicht zu bund])

    Danke - aber die Seite war eigentlich nur hektisch erstellt, damit ich das Programm besser promoten kann. :D

    Sry aber ich versteh dich nicht. ich weiß beim besten nicht was die Seiten gemeinsam haben sollen und was willst du dich an Google orientiren? Google hat ein Logo eine inputbox und 2 Buttons, und das nicht erst seit gestern, also wo setzt da Google bitte Masstäbe, an denen man sich Orientireren soll ?

    Dann kennst du aber nicht sehr viele Projekte von Google - oder glaubst du, Google macht 24 Mrd. US$ Umsatz mit ner Inputbox? :D

    Das Website Design ist schlicht , einfach bisschen in Photoshop was zaubern und slicen.
    Fertig ist so ein Design :)

    Screenshots wären nice zum programm

    Ich bevorzuge Fireworks MX - und "slicen" machen echte Programmierer/Designer nicht. :D Zumindest schonmal garnicht mir den "Slice-Funktionen", es wird eher jedes Bild einzeln in eine Datei geschoben, transparent gemacht, und angepasst, eckig oder gar rund zu schneiden wäre der Tod eines jeden dynamischen Designs. ;)