Hi,
ich habe gerade das Problem, dass ein Png-Bild trotz MatrixRotate nicht gedreht wird. Das gedrehte Png-Bild soll anschließend, wieder auf einen Hintergrund gezeichnet werden.
Mein Code:
Spoiler anzeigen
_GDIPlus_Startup()
$hImage_Background = _GDIPlus_BitmapCreateFromFile($_Path & "123.png")
$hImage_Foreground = _GDIPlus_BitmapCreateFromFile($_Path & "xyz.png")
Global $iWidth = _GDIPlus_ImageGetWidth($hImage_Background)
Global $iHeight = _GDIPlus_ImageGetHeight($hImage_Background)
Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWindow_Programm)
Global $bitmap = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphic)
Global $hGraphic_Buffer = _GDIPlus_GraphicsCreateFromHWND($hWindow_Programm)
Global $hBitmap_Buffer = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphic)
Global $hBack_Buffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
_GDIPlus_GraphicsDrawImage($hBack_Buffer, $hImage_Background, 0, 0) ;zeichnet das Hintergrundbild
_GDIPlus_GraphicsDrawImage($hBack_Buffer, $hImage_Foreground, 480, 304) ;zeichnet das Vordergrundbild
_GDIPlus_GraphicsDrawImageRect($hGraphic, $bitmap, 24, 24, $iWidth, $iHeight) ;zeichnet die beiden Bilder die in $hGraphic gezeichnet wurden
$hMatrix = _GDIPlus_MatrixCreate()
;_GDIPlus_MatrixTranslate($hMatrix,800,240)
_GDIPlus_MatrixRotate($hMatrix, 90, "False")
_GDIPlus_GraphicsSetTransform($hImage_Foreground, $hMatrix)
_GDIPlus_GraphicsDrawImage($hBack_Buffer, $hImage_Background, 0, 0) ;zeichnet das Hintergrundbild
_GDIPlus_GraphicsDrawImage($hBack_Buffer, $hImage_Foreground, 480, 304) ;zeichnet das Vordergrundbild
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap_Buffer, 24, 24, $iWidth, $iHeight);zeichnet die beiden Bilder die in $hGraphic gezeichnet wurden
Zum besseren Verständnis eine "kleine Beschreibung" im Anhang.