Hallo
Ich habe folgendes Skript:
Spoiler anzeigen
#include <GDIPlus.au3>
_GDIPlus_Startup()
$hGui = GUICreate("Test Rotate", 800, 600)
GUISetState()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
$hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir& "\test.png")
$RotatedImage=_ImageRotateFromLeft($hGraphic,800,600,$hImage,"Right")
_GDIPlus_GraphicsDrawImage($hGraphic,$RotatedImage,0,0)
While GUIGetMsg() <> -3
Sleep(10)
WEnd
_GDIPlus_ImageDispose($RotatedImage)
_GDIPlus_Shutdown()
Func _ImageRotateFromLeft($iGraphic,$iGraphicW,$iGraphicH,$iImage,$iRotateTo)
Local $iBitmap = _GDIPlus_BitmapCreateFromGraphics($iGraphicW,$iGraphicH,$iGraphic),$iGDI_Buffer = _GDIPlus_ImageGetGraphicsContext($iBitmap)
Local $iWidth = _GDIPlus_ImageGetWidth($iImage),$iHeight = _GDIPlus_ImageGetHeight($iImage),$iMatrix = _GDIPlus_MatrixCreate()
Local $iX = 0, $iY = 0
Switch $iRotateTo
Case "Down"
_GDIPlus_MatrixTranslate($iMatrix,0,$iHeight-1)
_GDIPlus_MatrixRotate($iMatrix, 270, False)
;$iX = 0
;$iY = 0
Case "Right"
_GDIPlus_MatrixTranslate($iMatrix,$iWidth,$iHeight)
_GDIPlus_MatrixRotate($iMatrix, 180, False)
$iX = 0
$iY = 0
Case "Top"
_GDIPlus_MatrixTranslate($iMatrix,$iHeight,0)
_GDIPlus_MatrixRotate($iMatrix, 90, False)
EndSwitch
_GDIPlus_GraphicsSetTransform($iGDI_Buffer, $iMatrix)
_GDIPlus_GraphicsDrawImage($iGDI_Buffer,$iImage,$iX,$iY)
_GDIPlus_MatrixDispose($iMatrix)
_GDIPlus_GraphicsDispose($iGDI_Buffer)
Return $iBitmap
EndFunc
Nur leider fehlt nach dem Drehen mit eine ganze Zeile/Spalte Pixel nach dem Drehen!? Der Fehler liegt an MatrixRotate, weil danach dieser Fehler auftritt. Weiß einer von euch woran das liegt?
Vielen Dank für euerer Bemühen
MfG AntiSpeed