Hallo liebe AutoIt Community,
ich habe ein Problem beim vergrößern eines Bildes per GDI+.
Wenn ich das Bild vergrößer so fehlen im "ecken", es verrutscht irgendwie, hier mal mein Script:
_GDIPlus_StartUp()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($sGui)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($Width, $Height, $hGraphic)
$hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
$sPicture = _GDIPlus_ImageLoadFromFile($ImageFile)
_GDIPlus_GraphicsSetInterpolationMode($hBackbuffer, 5)
_GDIPlus_GraphicsDrawImageRect($hBackbuffer, $sPicture, 0,0 $Width, $Height)
_GDIPlus_ImageSaveToFile($hBitmap, $Output)
_GDIPlus_Shutdown()
Func _GDIPlus_GraphicsSetInterpolationMode($hGraphics, $iInterpolationMode)
Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "hwnd", $hGraphics, "int", $iInterpolationMode)
If @error Then Return SetError(@error, @extended, False)
Return $aResult[0] = 0
EndFunc ;==>_GDIPlus_GraphicsSetInterpolationMode
;5 = Non Smoothing
Hier mal 2 Links zum vorherigen Bild und dem Ergebnis:
Natur: http://img812.imageshack.us/img812/3329/sworddg.png
Ergebnis: http://img94.imageshack.us/img94/1526/swordrs.png
Okay, das original Schwert ist ein bisschen (sehr) klein, aber eigentlich sollte das nicht sein, oder ?
Hilfe ! - MfG Mattthias