Morgen,
könnte mir jemand sagen wie ich mit autoit ein bild xyz.jpg horizontal bzw vertikal spiegeln kann und als xyz_s.jpg abspeichern kann.
Danke
Bilder spiegeln
-
- [ offen ]
-
moritz1243 -
1. Februar 2009 um 14:19 -
Geschlossen -
Erledigt
-
-
ich glaube das geht mit gdi+
-
ja aber wie kannst du mal nen bsp schreiben
-
nee ich kann das auch nicht...
guck dir mal die Helpfilean -
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 activeWinSetState("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) -
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 -
ist schon mal nen guter ansatz aber könntest du dir das programm oben mal ansehen und mir sagen wie es mit paint arbeitet und wie es ihm die anweisungen gibt
-
In GDIplus git es ImageRotateFlip, nur noch nicht in der UDF:
Spoiler anzeigen
[autoit]#include<GDIplus.au3>
[/autoit] [autoit][/autoit] [autoit]
; Konstanten für RotateFlip-Operationen
Global Const $RotateNoneFlipNone = 0
Global Const $Rotate90FlipNone = 1
Global Const $Rotate180FlipNone = 2
Global Const $Rotate270FlipNone = 3Global Const $RotateNoneFlipX = 4
[/autoit] [autoit][/autoit] [autoit]
Global Const $Rotate90FlipX = 5
Global Const $Rotate180FlipX = 6
Global Const $Rotate270FlipX = 7Global Const $RotateNoneFlipY = $Rotate180FlipX
[/autoit] [autoit][/autoit] [autoit]
Global Const $Rotate90FlipY = $Rotate270FlipX
Global Const $Rotate180FlipY = $RotateNoneFlipX
Global Const $Rotate270FlipY = $Rotate90FlipXGlobal Const $RotateNoneFlipXY = $Rotate180FlipNone
[/autoit] [autoit][/autoit] [autoit]
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)
EndFuncFunc _GDIPlus_BitmapCreateFromImage($hImage)
[/autoit] [autoit][/autoit] [autoit]
; Prog@ndy
Local $Graph = _GDIPlus_ImageGetGraphicsContext($hImage)
Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics(_GDIPlus_ImageGetWidth($hImage),_GDIPlus_ImageGetHeight($hImage),$Graph)
_GDIPlus_GraphicsDispose($Graph)
Return $hBitmap
EndFunc_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]$SRC = "49635_full.jpg"
[/autoit] [autoit][/autoit] [autoit]
$DEST = "49635_full_flip.jpg"$hImage = _GDIPlus_ImageLoadFromFile($SRC)
[/autoit] [autoit][/autoit] [autoit]_GDIplus_ImageRotateFlip($hImage,$RotateNoneFlipX)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_ImageSaveToFile($hImage,$DEST)
[/autoit]
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown() -
Moinsen,
das geht mit StretchBlt ...
http://msdn.microsoft.com/en-us/library/dd145120(VS.85).aspxEDIT:
Ups, Andy war schneller ...Gruß
Greenhorn -
das ist zwar ein auch eine gute idee aber ich wollte es mit autoit machen kann mir jemand sagen wie das porgramm oben paint die anweisungen gib was es machen soll
-
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