Bilder spiegeln

  • Hab ich schon nachgeguckt habe aber nur ne möglichkeit gefunden sie zu skallieren. Ich habe hier noch nen Programm gefunden kann mir jemand erklären wie das nutze oder wie funktioniert:
    $imagepath = "E:\AutoIT\ImageViewer\"
    $imagetitle = "IMAGE2.JPG"
    Run("mspaint "&$imagepath&$imagetitle,"",@SW_HIDE)
    WinActivate($imagetitle)
    Do
    $winstate = WinGetState($imagetitle)
    Sleep(10)
    Until $winstate = 5 ; 1 = Window exists 4 = Window is enabled (4+1)
    Send("^d")
    Do
    $winstate = WinGetState("Bild drehen und spiegeln")
    Until $winstate = 15; 1 = Window exists 2 = Window is visible 4 = Window is enabled 8 = Window is active

    WinSetState("Bild drehen und spiegeln","",@SW_SHOW)

    Dim $BUTTON[5][2]
    $BUTTON[0][0] = "Horizontal Spiegeln"
    $BUTTON[0][1] = 2
    $BUTTON[1][0] = "Vertikal Spiegeln"
    $BUTTON[1][1] = 3
    $BUTTON[2][0] = "Drehen im Winkel von:"
    $BUTTON[2][1] = 4
    $BUTTON[3][0] = "90°"
    $BUTTON[3][1] = 5
    $BUTTON[4][0] = "180°"
    $BUTTON[4][1] = 6
    $BUTTON[5][0] = "270°"
    $BUTTON[4][1] = 7

    $ret = ControlClick ("Bild drehen und spiegeln","","[CLASS:Button; INSTANCE:"&$BUTTON[1][1]&"]","left",1)
    MsgBox(0,"",$ret)

    Einmal editiert, zuletzt von moritz1243 (1. Februar 2009 um 15:47)

  • also ich hab bisher nur das
    http://msdn.microsoft.com/de-de/library/3b575a03(VS.80).aspx
    gefunden ist allerdings VB und C# ... dort werden bilder quasi neu gezeichnet mit anderen bezugspunkten habs mit _GDIPlus_GraphicsDrawImage &REct(&Rect) versucht aber da kann man das bild nur skalieren und verschieben ... :/, habs mit negativen werten versucht (bei php klappt sowas öfters^^) aber hier nüscht :(

    MFG FireFlyer

    *Paradox ist, wenn man sich im Handumdrehen den Fuss bricht* :D

  • In GDIplus git es ImageRotateFlip, nur noch nicht in der UDF:

    Spoiler anzeigen
    [autoit]

    #include<GDIplus.au3>
    ; Konstanten für RotateFlip-Operationen
    Global Const $RotateNoneFlipNone = 0
    Global Const $Rotate90FlipNone = 1
    Global Const $Rotate180FlipNone = 2
    Global Const $Rotate270FlipNone = 3

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

    Global Const $RotateNoneFlipX = 4
    Global Const $Rotate90FlipX = 5
    Global Const $Rotate180FlipX = 6
    Global Const $Rotate270FlipX = 7

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

    Global Const $RotateNoneFlipY = $Rotate180FlipX
    Global Const $Rotate90FlipY = $Rotate270FlipX
    Global Const $Rotate180FlipY = $RotateNoneFlipX
    Global Const $Rotate270FlipY = $Rotate90FlipX

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

    Global Const $RotateNoneFlipXY = $Rotate180FlipNone
    Global Const $Rotate90FlipXY = $Rotate270FlipNone
    Global Const $Rotate180FlipXY = $RotateNoneFlipNone
    Global Const $Rotate270FlipXY = $Rotate90FlipNone

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

    ;===============================================================================
    ;
    ; Function Name: _GDIplus_ImageRotateFlip
    ; Description:: Rotates or flips an Image
    ; Parameter(s): $hImage - GDIPlus image handle
    ; $RotateFlipType - RotateFlip action to perform
    ; Requirement(s): GDIplus
    ; Return Value(s): Success: 1
    ; Error: 0 and @error <> 0
    ; Author(s): Prog@ndy
    ;
    ;===============================================================================
    ;
    Func _GDIplus_ImageRotateFlip($hImage,$RotateFlipType)
    Local $ret = DllCall($ghGDIPDll,"int","GdipImageRotateFlip","hwnd",$hImage,"dword",$RotateFlipType)
    If @error Then Return SetError(1,0,0)
    Return SetError($ret[0],0,$ret[0]=0)
    EndFunc

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

    Func _GDIPlus_BitmapCreateFromImage($hImage)
    ; Prog@ndy
    Local $Graph = _GDIPlus_ImageGetGraphicsContext($hImage)
    Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics(_GDIPlus_ImageGetWidth($hImage),_GDIPlus_ImageGetHeight($hImage),$Graph)
    _GDIPlus_GraphicsDispose($Graph)
    Return $hBitmap
    EndFunc

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

    _GDIPlus_Startup()

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

    $SRC = "49635_full.jpg"
    $DEST = "49635_full_flip.jpg"

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

    $hImage = _GDIPlus_ImageLoadFromFile($SRC)

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

    _GDIplus_ImageRotateFlip($hImage,$RotateNoneFlipX)

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

    _GDIPlus_ImageSaveToFile($hImage,$DEST)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()

    [/autoit]
  • Du willst es mit AutoIt machen, aber mspaint verwenden?? Das ist doch ein kleiner Widerspruch ;)
    -AutoIt: nimm GDIplus (ab XP bei Windows dabei, bei älteren Systemen brauchst du die GDIplus.dll)
    -mspaint: Untersuche die Controls mal mit Autoit Window Info Tool / Au3Info :)