OOPGDIP UDF - GDI+ mit Objekten

  • Ich hab mich in letzter Zeit mit der objektorientierten Programmierung in AutoIt beschäftigt (AutoItObject), angefangen das Ganze zu verstehen und ich muss sagen ich bin begeistert.

    Da ich auch ein GDI+ Fan bin und ich mir dachte, dass GDI+ mit Objekten viel leichter zu handeln wäre, habe ich angefangen das ganze umzusetzen.

    Vorweg sage ich gleich dass ich das Skript nur zu Lernzwecken geschrieben habe und deswegen ist ungewiss, ob ich daraus eine komplette UDF machen werde. Aber ich werde mich dennoch bemühen das Skript, soweit wie mir möglich ist, zu erweitern.

    Lange Rede, kurzer Sinn, hier die UDF:

    Skript
    [autoit]

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_UseUpx=n
    #AutoIt3Wrapper_UseX64=n
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    ;EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

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

    #cs Impressum-----------------------------------------------------------------------
    AutoIt Version: 3.3.6.1
    UDF Version: 0.40.00
    Author: Nestos (h2112)

    Script Function:
    UDF (Funktionssammlung) für die objektorientierte Programmierung mit GDIPlus.
    #ce --------------------------------------------------------------------------------

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

    #cs Fortschritte--------------------------------------------------------------------
    04.05.2011
    Idee für die UDF
    Erste Versuche mit OOP in AutoIT

    10.05.2011 - 8:55
    Erste Funktionen umgesetzt und getestet - erfolgreich:
    _OOPGDIP_GraphicsCreate
    _OOPGDIP_PenCreate
    _OOPGDIP_BrushCreate
    _OOPGDIP_LineCreate
    _OOPGDIP_FilledEllipseCreate

    10.05.2011 - 12:05
    Weitere Formen umgesetzt:
    _OOPGDIP_FilledPolygonCreate
    _OOPGDIP_PolygonCreate
    _OOPGDIP_FilledRectCreate
    _OOPGDIP_RectCreate
    _OOPGDIP_EllipseCreate

    10.05.2011 - 15:45
    Umgesetzte Methoden:
    graphic.dispose
    pen.dispose
    brush.dispose

    Umgesetzte Funktionen:
    _OOPGDIP_BufferCreate

    11.05.2011 - 16:05
    Skript aufgeräumt und in UDF-Form gebracht

    Umgesetzte Funktionserweiterungen:
    _OOPGDIP_BufferCreate & _OOPGDIP_GraphicsCreate Property clearcolor hinzufügen

    Umgesetzte Methoden:
    Buffer.update

    Umgesetzte Funktionsänderungen:
    Formen - update-Methoden zu draw umbenennen

    12.05.2011 - 22:00
    Alle Standardformen von GDIPlus.au3 umgesetzt:
    _OOPGDIP_PieCreate
    _OOPGDIP_ClosedCurveCreate
    _OOPGDIP_FilledClosedCurveCreate
    _OOPGDIP_CurveCreate
    _OOPGDIP_BezierCreate

    13.05.2011 - 08:35
    _OOPGDIP_ImageCreate umgesetzt

    31.05.2011 - 08:35
    _OOPGDIP_StringCreate umgesetzt

    02.06.2011 -
    _OOPGDIP_FontCreate umgesetzt
    _OOPGDIP_StringExCreate umgesetzt
    #ce --------------------------------------------------------------------------------

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

    #cs Funktionen----------------------------------------------------------------------
    _OOPGDIP_StartUp
    _OOPGDIP_ShutDown
    _OOPGDIP_GraphicsCreate
    _OOPGDIP_PenCreate
    _OOPGDIP_BrushCreate
    _OOPGDIP_LineCreate
    _OOPGDIP_FilledEllipseCreate
    _OOPGDIP_FilledPolygonCreate
    _OOPGDIP_PolygonCreate
    _OOPGDIP_FilledRectCreate
    _OOPGDIP_RectCreate
    _OOPGDIP_EllipseCreate
    #ce --------------------------------------------------------------------------------

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

    #cs Interne Funktionen--------------------------------------------------------------
    __OOPGDIP_FilledEllipsedraw
    __OOPGDIP_BrushUpdate
    __OOPGDIP_PenUpdate
    __OOPGDIP_GraphicsClear
    __OOPGDIP_Linedraw
    __OOPGDIP_FilledPolygondraw
    __OOPGDIP_Polygondraw
    __OOPGDIP_FilledRectdraw
    __OOPGDIP_Rectdraw
    __OOPGDIP_Ellipsedraw
    __OOPGDIP_FilledEllipsedraw
    #ce --------------------------------------------------------------------------------

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

    #Region Include---------------------------------------------------------------------
    #include-once
    #include <AutoItObject.au3>
    #include <GDIPlus.au3>
    #EndRegion Include---------------------------------------------------------------------
    ;EndRegion Include------------------------------------------------------------------

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

    #Region Variablen-------------------------------------------------------------------
    Global $OOPGDIP_Test = False
    Global $OOPGDIPStringExStruct[100] = [0]

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

    If $OOPGDIP_Test Then __OOPGDIP_TestRun()
    #EndRegion Variablen-------------------------------------------------------------------
    ;EndRegion Variablen----------------------------------------------------------------

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

    #Region Formen----------------------------------------------------------------------
    Func _OOPGDIP_LineCreate($Graphics, $x1Pos, $y1Pos, $x2Pos, $y2Pos, $Pen)
    Local $oGDIPLine = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPLine, "graphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPLine, "x1Pos", $ELSCOPE_PUBLIC, $x1Pos)
    _AutoItObject_AddProperty($oGDIPLine, "y1Pos", $ELSCOPE_PUBLIC, $y1Pos)
    _AutoItObject_AddProperty($oGDIPLine, "x2Pos", $ELSCOPE_PUBLIC, $x2Pos)
    _AutoItObject_AddProperty($oGDIPLine, "y2Pos", $ELSCOPE_PUBLIC, $y2Pos)
    _AutoItObject_AddProperty($oGDIPLine, "pen", $ELSCOPE_PUBLIC, $Pen.handle)
    _AutoItObject_AddMethod($oGDIPLine, "draw", "__OOPGDIP_LineDraw")
    Return $oGDIPLine
    EndFunc ;==>_OOPGDIP_LineCreate

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

    Func __OOPGDIP_LineDraw($oSelf)
    _GDIPlus_GraphicsDrawLine($oSelf.graphic, $oSelf.x1Pos, $oSelf.y1Pos, $oSelf.x2Pos, $oSelf.y2Pos, $oSelf.pen)
    EndFunc ;==>__OOPGDIP_LineDraw

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

    Func _OOPGDIP_RectCreate($Graphics, $xPos, $yPos, $width, $height, $Pen)
    Local $oGDIPRect = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPRect, "graphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPRect, "xPos", $ELSCOPE_PUBLIC, $xPos)
    _AutoItObject_AddProperty($oGDIPRect, "yPos", $ELSCOPE_PUBLIC, $yPos)
    _AutoItObject_AddProperty($oGDIPRect, "width", $ELSCOPE_PUBLIC, $width)
    _AutoItObject_AddProperty($oGDIPRect, "height", $ELSCOPE_PUBLIC, $height)
    _AutoItObject_AddProperty($oGDIPRect, "pen", $ELSCOPE_PUBLIC, $Pen.handle)
    _AutoItObject_AddMethod($oGDIPRect, "draw", "__OOPGDIP_RectDraw")
    Return $oGDIPRect
    EndFunc ;==>_OOPGDIP_RectCreate

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

    Func __OOPGDIP_RectDraw($oSelf)
    _GDIPlus_GraphicsDrawRect($oSelf.graphic, $oSelf.xPos, $oSelf.yPos, $oSelf.width, $oSelf.height, $oSelf.pen)
    EndFunc ;==>__OOPGDIP_RectDraw

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

    Func _OOPGDIP_FilledRectCreate($Graphics, $xPos, $yPos, $width, $height, $Brush)
    Local $oGDIPFilledRect = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPFilledRect, "graphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPFilledRect, "xPos", $ELSCOPE_PUBLIC, $xPos)
    _AutoItObject_AddProperty($oGDIPFilledRect, "yPos", $ELSCOPE_PUBLIC, $yPos)
    _AutoItObject_AddProperty($oGDIPFilledRect, "width", $ELSCOPE_PUBLIC, $width)
    _AutoItObject_AddProperty($oGDIPFilledRect, "height", $ELSCOPE_PUBLIC, $height)
    _AutoItObject_AddProperty($oGDIPFilledRect, "brush", $ELSCOPE_PUBLIC, $Brush.handle)
    _AutoItObject_AddMethod($oGDIPFilledRect, "draw", "__OOPGDIP_FilledRectDraw")
    Return $oGDIPFilledRect
    EndFunc ;==>_OOPGDIP_FilledRectCreate

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

    Func __OOPGDIP_FilledRectDraw($oSelf)
    _GDIPlus_GraphicsFillRect($oSelf.graphic, $oSelf.xPos, $oSelf.yPos, $oSelf.width, $oSelf.height, $oSelf.brush)
    EndFunc ;==>__OOPGDIP_FilledRectDraw

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

    Func _OOPGDIP_PolygonCreate($Graphics, $cords, $Pen)
    Local $oGDIPPolygon = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPPolygon, "graphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPPolygon, "cords", $ELSCOPE_PUBLIC, $cords)
    _AutoItObject_AddProperty($oGDIPPolygon, "pen", $ELSCOPE_PUBLIC, $Pen.handle)
    _AutoItObject_AddMethod($oGDIPPolygon, "draw", "__OOPGDIP_PolygonDraw")
    Return $oGDIPPolygon
    EndFunc ;==>_OOPGDIP_PolygonCreate

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

    Func __OOPGDIP_PolygonDraw($oSelf)
    _GDIPlus_GraphicsDrawPolygon($oSelf.graphic, $oSelf.cords, $oSelf.pen)
    EndFunc ;==>__OOPGDIP_PolygonDraw

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

    Func _OOPGDIP_FilledPolygonCreate($Graphics, $cords, $Brush)
    Local $oGDIPFilledPolygon = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPFilledPolygon, "graphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPFilledPolygon, "cords", $ELSCOPE_PUBLIC, $cords)
    _AutoItObject_AddProperty($oGDIPFilledPolygon, "brush", $ELSCOPE_PUBLIC, $Brush.handle)
    _AutoItObject_AddMethod($oGDIPFilledPolygon, "draw", "__OOPGDIP_FilledPolygonDraw")
    Return $oGDIPFilledPolygon
    EndFunc ;==>_OOPGDIP_FilledPolygonCreate

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

    Func __OOPGDIP_FilledPolygonDraw($oSelf)
    _GDIPlus_GraphicsFillPolygon($oSelf.graphic, $oSelf.cords, $oSelf.brush)
    EndFunc ;==>__OOPGDIP_FilledPolygonDraw

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

    Func _OOPGDIP_EllipseCreate($Graphics, $xPos, $yPos, $width, $height, $Pen, $StartAngle = 0, $EndAngle = 360)
    Local $oGDIPEllipse = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPEllipse, "graphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPEllipse, "xPos", $ELSCOPE_PUBLIC, $xPos)
    _AutoItObject_AddProperty($oGDIPEllipse, "yPos", $ELSCOPE_PUBLIC, $yPos)
    _AutoItObject_AddProperty($oGDIPEllipse, "width", $ELSCOPE_PUBLIC, $width)
    _AutoItObject_AddProperty($oGDIPEllipse, "height", $ELSCOPE_PUBLIC, $height)
    _AutoItObject_AddProperty($oGDIPEllipse, "pen", $ELSCOPE_PUBLIC, $Pen.handle)
    _AutoItObject_AddProperty($oGDIPEllipse, "sangle", $ELSCOPE_PUBLIC, $StartAngle)
    _AutoItObject_AddProperty($oGDIPEllipse, "eangle", $ELSCOPE_PUBLIC, $EndAngle)
    _AutoItObject_AddMethod($oGDIPEllipse, "draw", "__OOPGDIP_EllipseDraw")
    Return $oGDIPEllipse
    EndFunc ;==>_OOPGDIP_EllipseCreate

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

    Func __OOPGDIP_EllipseDraw($oSelf)
    _GDIPlus_GraphicsDrawArc($oSelf.graphic, $oSelf.xPos, $oSelf.yPos, $oSelf.width, $oSelf.height, $oSelf.sangle, $oSelf.eangle, $oSelf.pen)
    EndFunc ;==>__OOPGDIP_EllipseDraw

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

    Func _OOPGDIP_FilledEllipseCreate($Graphics, $xPos, $yPos, $width, $height, $Brush, $StartAngle = 0, $EndAngle = 360)
    Local $oGDIPFilledEllipse = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPFilledEllipse, "graphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPFilledEllipse, "xPos", $ELSCOPE_PUBLIC, $xPos)
    _AutoItObject_AddProperty($oGDIPFilledEllipse, "yPos", $ELSCOPE_PUBLIC, $yPos)
    _AutoItObject_AddProperty($oGDIPFilledEllipse, "width", $ELSCOPE_PUBLIC, $width)
    _AutoItObject_AddProperty($oGDIPFilledEllipse, "height", $ELSCOPE_PUBLIC, $height)
    _AutoItObject_AddProperty($oGDIPFilledEllipse, "brush", $ELSCOPE_PUBLIC, $Brush.handle)
    _AutoItObject_AddProperty($oGDIPFilledEllipse, "sangle", $ELSCOPE_PUBLIC, $StartAngle)
    _AutoItObject_AddProperty($oGDIPFilledEllipse, "eangle", $ELSCOPE_PUBLIC, $EndAngle)
    _AutoItObject_AddMethod($oGDIPFilledEllipse, "draw", "__OOPGDIP_FilledEllipseDraw")
    Return $oGDIPFilledEllipse
    EndFunc ;==>_OOPGDIP_FilledEllipseCreate

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

    Func __OOPGDIP_FilledEllipseDraw($oSelf)
    _GDIPlus_GraphicsFillPie($oSelf.graphic, $oSelf.xPos, $oSelf.yPos, $oSelf.width, $oSelf.height, $oSelf.sangle, $oSelf.eangle, $oSelf.brush)
    EndFunc ;==>__OOPGDIP_FilledEllipseDraw

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

    Func _OOPGDIP_PieCreate($Graphics, $xPos, $yPos, $width, $height, $Pen, $StartAngle = 0, $EndAngle = 360)
    Local $oGDIPPie = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPPie, "graphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPPie, "xPos", $ELSCOPE_PUBLIC, $xPos)
    _AutoItObject_AddProperty($oGDIPPie, "yPos", $ELSCOPE_PUBLIC, $yPos)
    _AutoItObject_AddProperty($oGDIPPie, "width", $ELSCOPE_PUBLIC, $width)
    _AutoItObject_AddProperty($oGDIPPie, "height", $ELSCOPE_PUBLIC, $height)
    _AutoItObject_AddProperty($oGDIPPie, "pen", $ELSCOPE_PUBLIC, $Pen.handle)
    _AutoItObject_AddProperty($oGDIPPie, "sangle", $ELSCOPE_PUBLIC, $StartAngle)
    _AutoItObject_AddProperty($oGDIPPie, "eangle", $ELSCOPE_PUBLIC, $EndAngle)
    _AutoItObject_AddMethod($oGDIPPie, "draw", "__OOPGDIP_PieDraw")
    Return $oGDIPPie
    EndFunc ;==>_OOPGDIP_PieCreate

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

    Func __OOPGDIP_PieDraw($oSelf)
    _GDIPlus_GraphicsDrawPie($oSelf.graphic, $oSelf.xPos, $oSelf.yPos, $oSelf.width, $oSelf.height, $oSelf.sangle, $oSelf.eangle, $oSelf.pen)
    EndFunc ;==>__OOPGDIP_PieDraw

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

    Func _OOPGDIP_ClosedCurveCreate($Graphics, $cords, $Pen)
    Local $oGDIPClosedCurve = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPClosedCurve, "graphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPClosedCurve, "cords", $ELSCOPE_PUBLIC, $cords)
    _AutoItObject_AddProperty($oGDIPClosedCurve, "pen", $ELSCOPE_PUBLIC, $Pen.handle)
    _AutoItObject_AddMethod($oGDIPClosedCurve, "draw", "__OOPGDIP_ClosedCurveDraw")
    Return $oGDIPClosedCurve
    EndFunc ;==>_OOPGDIP_ClosedCurveCreate

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

    Func __OOPGDIP_ClosedCurveDraw($oSelf)
    _GDIPlus_GraphicsDrawClosedCurve($oSelf.graphic, $oSelf.cords, $oSelf.pen)
    EndFunc ;==>__OOPGDIP_ClosedCurveDraw

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

    Func _OOPGDIP_FilledClosedCurveCreate($Graphics, $cords, $Brush)
    Local $oGDIPFilledClosedCurve = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPFilledClosedCurve, "graphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPFilledClosedCurve, "cords", $ELSCOPE_PUBLIC, $cords)
    _AutoItObject_AddProperty($oGDIPFilledClosedCurve, "brush", $ELSCOPE_PUBLIC, $Brush.handle)
    _AutoItObject_AddMethod($oGDIPFilledClosedCurve, "draw", "__OOPGDIP_FilledClosedCurveDraw")
    Return $oGDIPFilledClosedCurve
    EndFunc ;==>_OOPGDIP_FilledClosedCurveCreate

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

    Func __OOPGDIP_FilledClosedCurveDraw($oSelf)
    _GDIPlus_GraphicsFillClosedCurve($oSelf.graphic, $oSelf.cords, $oSelf.brush)
    EndFunc ;==>__OOPGDIP_FilledClosedCurveDraw

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

    Func _OOPGDIP_CurveCreate($Graphics, $cords, $Pen)
    Local $oGDIPCurve = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPCurve, "graphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPCurve, "cords", $ELSCOPE_PUBLIC, $cords)
    _AutoItObject_AddProperty($oGDIPCurve, "pen", $ELSCOPE_PUBLIC, $Pen.handle)
    _AutoItObject_AddMethod($oGDIPCurve, "draw", "__OOPGDIP_CurveDraw")
    Return $oGDIPCurve
    EndFunc ;==>_OOPGDIP_CurveCreate

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

    Func __OOPGDIP_CurveDraw($oSelf)
    _GDIPlus_GraphicsDrawCurve($oSelf.graphic, $oSelf.cords, $oSelf.pen)
    EndFunc ;==>__OOPGDIP_CurveDraw

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

    Func _OOPGDIP_BezierCreate($Graphics, $x1Pos, $y1Pos, $x2Pos, $y2Pos, $x3Pos, $y3Pos, $x4Pos, $y4Pos, $Pen)
    Local $oGDIPBezier = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPBezier, "graphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPBezier, "x1Pos", $ELSCOPE_PUBLIC, $x1Pos)
    _AutoItObject_AddProperty($oGDIPBezier, "y1Pos", $ELSCOPE_PUBLIC, $y1Pos)
    _AutoItObject_AddProperty($oGDIPBezier, "x2Pos", $ELSCOPE_PUBLIC, $x2Pos)
    _AutoItObject_AddProperty($oGDIPBezier, "y2Pos", $ELSCOPE_PUBLIC, $y2Pos)
    _AutoItObject_AddProperty($oGDIPBezier, "x3Pos", $ELSCOPE_PUBLIC, $x3Pos)
    _AutoItObject_AddProperty($oGDIPBezier, "y3Pos", $ELSCOPE_PUBLIC, $y3Pos)
    _AutoItObject_AddProperty($oGDIPBezier, "x4Pos", $ELSCOPE_PUBLIC, $x4Pos)
    _AutoItObject_AddProperty($oGDIPBezier, "y4Pos", $ELSCOPE_PUBLIC, $y4Pos)
    _AutoItObject_AddProperty($oGDIPBezier, "pen", $ELSCOPE_PUBLIC, $Pen.handle)
    _AutoItObject_AddMethod($oGDIPBezier, "draw", "__OOPGDIP_BezierDraw")
    Return $oGDIPBezier
    EndFunc ;==>_OOPGDIP_BezierCreate

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

    Func __OOPGDIP_BezierDraw($oSelf)
    _GDIPlus_GraphicsDrawBezier($oSelf.graphic, $oSelf.x1Pos, $oSelf.y1Pos, $oSelf.x2Pos, $oSelf.y2Pos, $oSelf.x3Pos, $oSelf.y3Pos, $oSelf.x4Pos, $oSelf.y4Pos, $oSelf.pen)
    EndFunc ;==>__OOPGDIP_BezierDraw

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

    #EndRegion Formen----------------------------------------------------------------------
    ;EndRegion Formen-------------------------------------------------------------------

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

    #Region Besondere-Formen------------------------------------------------------------
    Func _OOPGDIP_ImageCreate($Graphics, $Image, $x1Pos, $y1Pos, $width1 = Default, $height1 = Default, $x2Pos = 0, $y2Pos = 0, $width2 = Default, $height2 = Default, $unit = 2)
    Local $oGDIPImage = _AutoItObject_Create()
    Local $aOriginalCords[2] = [_GDIPlus_ImageGetWidth($Image), _GDIPlus_ImageGetHeight($Image)]
    If $width1 = Default Then $width1 = $aOriginalCords[0]
    If $height1 = Default Then $height1 = $aOriginalCords[1]
    If $width2 = Default Then $width2 = $aOriginalCords[0]
    If $height2 = Default Then $height2 = $aOriginalCords[1]
    _AutoItObject_AddProperty($oGDIPImage, "graphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPImage, "image", $ELSCOPE_PUBLIC, Number($Image))
    _AutoItObject_AddProperty($oGDIPImage, "x1Pos", $ELSCOPE_PUBLIC, $x1Pos)
    _AutoItObject_AddProperty($oGDIPImage, "y1Pos", $ELSCOPE_PUBLIC, $y1Pos)
    _AutoItObject_AddProperty($oGDIPImage, "width1", $ELSCOPE_PUBLIC, $width1)
    _AutoItObject_AddProperty($oGDIPImage, "height1", $ELSCOPE_PUBLIC, $height1)
    _AutoItObject_AddProperty($oGDIPImage, "x2Pos", $ELSCOPE_PUBLIC, $x2Pos)
    _AutoItObject_AddProperty($oGDIPImage, "y2Pos", $ELSCOPE_PUBLIC, $y2Pos)
    _AutoItObject_AddProperty($oGDIPImage, "width2", $ELSCOPE_PUBLIC, $width2)
    _AutoItObject_AddProperty($oGDIPImage, "height2", $ELSCOPE_PUBLIC, $height2)
    _AutoItObject_AddProperty($oGDIPImage, "unit", $ELSCOPE_PUBLIC, $unit)
    _AutoItObject_AddMethod($oGDIPImage, "draw", "__OOPGDIP_ImageDraw")
    Return $oGDIPImage
    EndFunc ;==>_OOPGDIP_ImageCreate

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

    Func __OOPGDIP_ImageDraw($oSelf)
    _GDIPlus_GraphicsDrawImageRectRect($oSelf.graphic, $oSelf.image, $oSelf.x2Pos, $oSelf.y2Pos, $oSelf.width2, $oSelf.height2, $oSelf.x1Pos, $oSelf.y1Pos, $oSelf.width1, $oSelf.height1, $oSelf.unit)
    EndFunc ;==>__OOPGDIP_ImageDraw

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

    Func _OOPGDIP_StringCreate($Graphics, $Text, $xPos, $yPos, $Font = "Arial", $Size = 10, $Format = 0)
    Local $oGDIPString = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPString, "graphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPString, "text", $ELSCOPE_PUBLIC, $Text)
    _AutoItObject_AddProperty($oGDIPString, "xPos", $ELSCOPE_PUBLIC, $xPos)
    _AutoItObject_AddProperty($oGDIPString, "yPos", $ELSCOPE_PUBLIC, $yPos)
    _AutoItObject_AddProperty($oGDIPString, "font", $ELSCOPE_PUBLIC, $Font)
    _AutoItObject_AddProperty($oGDIPString, "size", $ELSCOPE_PUBLIC, $Size)
    _AutoItObject_AddProperty($oGDIPString, "format", $ELSCOPE_PUBLIC, $Format)
    _AutoItObject_AddMethod($oGDIPString, "draw", "__OOPGDIP_StringDraw")
    Return $oGDIPString
    EndFunc ;==>_OOPGDIP_StringCreate

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

    Func __OOPGDIP_StringDraw($oSelf)
    _GDIPlus_GraphicsDrawString($oSelf.graphic, $oSelf.text, $oSelf.xPos, $oSelf.yPos, $oSelf.font, $oSelf.size, $oSelf.format)
    EndFunc ;==>__OOPGDIP_StringDraw

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

    Func _OOPGDIP_StringExCreate($Graphics, $Text, $xPos, $yPos, $width, $height, $Font, $Brush = 0)
    Local $tLayout = _GDIPlus_RectFCreate($xPos, $yPos, $width, $height)
    Local $aInfo = _GDIPlus_GraphicsMeasureString($Graphics.graphic, $Text, $Font.handle, $tLayout, $Font.hformat)

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

    $OOPGDIPStringExStruct[0] += 1
    $OOPGDIPStringExStruct[$OOPGDIPStringExStruct[0]] = $aInfo[0]

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

    Local $oGDIPStringEx = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPStringEx, "graphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPStringEx, "brush", $ELSCOPE_PUBLIC, $Brush.handle)
    _AutoItObject_AddProperty($oGDIPStringEx, "font", $ELSCOPE_PUBLIC, $Font.handle)
    _AutoItObject_AddProperty($oGDIPStringEx, "hformat", $ELSCOPE_PUBLIC, $Font.hformat)
    _AutoItObject_AddProperty($oGDIPStringEx, "text", $ELSCOPE_PUBLIC, $Text)
    _AutoItObject_AddProperty($oGDIPStringEx, "xPos", $ELSCOPE_PUBLIC, $xPos)
    _AutoItObject_AddProperty($oGDIPStringEx, "yPos", $ELSCOPE_PUBLIC, $yPos)
    _AutoItObject_AddProperty($oGDIPStringEx, "width", $ELSCOPE_PUBLIC, $width)
    _AutoItObject_AddProperty($oGDIPStringEx, "height", $ELSCOPE_PUBLIC, $height)
    _AutoItObject_AddProperty($oGDIPStringEx, "struct", $ELSCOPE_PUBLIC, $OOPGDIPStringExStruct[0])
    _AutoItObject_AddMethod($oGDIPStringEx, "update", "__OOPGDIP_StringExUpdate")
    _AutoItObject_AddMethod($oGDIPStringEx, "draw", "__OOPGDIP_StringExDraw")

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

    Return $oGDIPStringEx
    EndFunc ;==>_OOPGDIP_StringExCreate

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

    Func __OOPGDIP_StringExDraw($oSelf)
    _GDIPlus_GraphicsDrawStringEx($oSelf.graphic, $oSelf.text, $oSelf.font, $OOPGDIPStringExStruct[$oSelf.struct], $oSelf.hformat, $oSelf.brush)
    EndFunc ;==>__OOPGDIP_StringExDraw

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

    Func __OOPGDIP_StringExUpdate($oSelf)
    Local $tLayout = _GDIPlus_RectFCreate($oSelf.xPos, $oSelf.yPos, $oSelf.width, $oSelf.height)
    Local $aInfo = _GDIPlus_GraphicsMeasureString($oSelf.graphic, $oSelf.text, $oSelf.font, $tLayout, $oSelf.hformat)
    $OOPGDIPStringExStruct[$oSelf.struct] = $aInfo[0]
    EndFunc ;==>__OOPGDIP_StringExUpdate
    #EndRegion Besondere-Formen------------------------------------------------------------
    ;EndRegion Besondere-Formen---------------------------------------------------------

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

    #Region Graphic---------------------------------------------------------------------
    Func _OOPGDIP_GraphicsCreate($hWnd, $clearcolor = 0xFF000000)
    Local $GDIPGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    Local $oGDIPGraphic = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPGraphic, "graphic", $ELSCOPE_PUBLIC, Number($GDIPGraphic))
    _AutoItObject_AddProperty($oGDIPGraphic, "clearcolor", $ELSCOPE_PUBLIC, $clearcolor)
    _AutoItObject_AddMethod($oGDIPGraphic, "clear", "__OOPGDIP_GraphicsClear")
    _AutoItObject_AddMethod($oGDIPGraphic, "dispose", "__OOPGDIP_GraphicsDispose")
    Return $oGDIPGraphic
    EndFunc ;==>_OOPGDIP_GraphicsCreate

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

    Func __OOPGDIP_GraphicsDispose($oSelf)
    _GDIPlus_GraphicsDispose($oSelf.graphic)
    EndFunc ;==>__OOPGDIP_GraphicsDispose

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

    Func __OOPGDIP_GraphicsClear($oSelf)
    _GDIPlus_GraphicsClear($oSelf.graphic)
    EndFunc ;==>__OOPGDIP_GraphicsClear

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

    Func _OOPGDIP_BufferCreate($Graphics, $width, $height, $clearcolor = 0xFF000000, $smooth = 0)
    Local $Bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $Graphics.graphic)
    Local $Context = _GDIPlus_ImageGetGraphicsContext($Bitmap)
    _GDIPlus_GraphicsSetSmoothingMode($Context, $smooth)
    Local $oGDIPBuffer = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPBuffer, "maingraphic", $ELSCOPE_PUBLIC, $Graphics.graphic)
    _AutoItObject_AddProperty($oGDIPBuffer, "bitmap", $ELSCOPE_PUBLIC, Number($Bitmap))
    _AutoItObject_AddProperty($oGDIPBuffer, "graphic", $ELSCOPE_PUBLIC, Number($Context))
    _AutoItObject_AddProperty($oGDIPBuffer, "width", $ELSCOPE_PUBLIC, $width)
    _AutoItObject_AddProperty($oGDIPBuffer, "height", $ELSCOPE_PUBLIC, $height)
    _AutoItObject_AddProperty($oGDIPBuffer, "clearcolor", $ELSCOPE_PUBLIC, $clearcolor)
    _AutoItObject_AddProperty($oGDIPBuffer, "smooth", $ELSCOPE_PUBLIC, $smooth)
    _AutoItObject_AddMethod($oGDIPBuffer, "draw", "__OOPGDIP_BufferDraw")
    _AutoItObject_AddMethod($oGDIPBuffer, "clear", "__OOPGDIP_BufferClear")
    _AutoItObject_AddMethod($oGDIPBuffer, "update", "__OOPGDIP_BufferUpdate")
    _AutoItObject_AddMethod($oGDIPBuffer, "dispose", "__OOPGDIP_BufferDispose")
    Return $oGDIPBuffer
    EndFunc ;==>_OOPGDIP_BufferCreate

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

    Func __OOPGDIP_BufferUpdate($oSelf)
    _GDIPlus_GraphicsSetSmoothingMode($oSelf.graphic, $oSelf.smooth)
    EndFunc ;==>__OOPGDIP_BufferUpdate

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

    Func __OOPGDIP_BufferDispose($oSelf)
    _GDIPlus_GraphicsDispose($oSelf.graphic)
    _GDIPlus_BitmapDispose($oSelf.bitmap)
    EndFunc ;==>__OOPGDIP_BufferDispose

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

    Func __OOPGDIP_BufferClear($oSelf)
    _GDIPlus_GraphicsClear($oSelf.graphic, $oSelf.clearcolor)
    EndFunc ;==>__OOPGDIP_BufferClear

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

    Func __OOPGDIP_BufferDraw($oSelf)
    _GDIPlus_GraphicsDrawImageRect($oSelf.maingraphic, $oSelf.bitmap, 0, 0, $oSelf.width, $oSelf.height)
    EndFunc ;==>__OOPGDIP_BufferDraw
    #EndRegion Graphic---------------------------------------------------------------------
    ;EndRegion Graphic------------------------------------------------------------------

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

    #Region Zeichenobjekte--------------------------------------------------------------
    Func _OOPGDIP_PenCreate($color, $width = 1, $unit = 2)
    Local $GDIPPen = _GDIPlus_PenCreate($color, $width, $unit)
    Local $oGDIPPen = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPPen, "handle", $ELSCOPE_PUBLIC, Number($GDIPPen))
    _AutoItObject_AddProperty($oGDIPPen, "color", $ELSCOPE_PUBLIC, $color)
    _AutoItObject_AddProperty($oGDIPPen, "width", $ELSCOPE_PUBLIC, $width)
    _AutoItObject_AddProperty($oGDIPPen, "unit", $ELSCOPE_PUBLIC, $unit)
    _AutoItObject_AddMethod($oGDIPPen, "update", "__OOPGDIP_PenUpdate")
    _AutoItObject_AddMethod($oGDIPPen, "dispose", "__OOPGDIP_PenDispose")
    Return $oGDIPPen
    EndFunc ;==>_OOPGDIP_PenCreate

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

    Func __OOPGDIP_PenDispose($oSelf)
    _GDIPlus_PenDispose($oSelf.handle)
    EndFunc ;==>__OOPGDIP_PenDispose

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

    Func __OOPGDIP_PenUpdate($oSelf)
    _GDIPlus_PenSetColor($oSelf.handle, $oSelf.color)
    _GDIPlus_PenSetWidth($oSelf.handle, $oSelf.width)
    EndFunc ;==>__OOPGDIP_PenUpdate

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

    Func _OOPGDIP_BrushCreate($color)
    Local $GDIPBrush = _GDIPlus_BrushCreateSolid($color)
    Local $oGDIPBrush = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPBrush, "handle", $ELSCOPE_PUBLIC, Number($GDIPBrush))
    _AutoItObject_AddProperty($oGDIPBrush, "color", $ELSCOPE_PUBLIC, $color)
    _AutoItObject_AddMethod($oGDIPBrush, "update", "__OOPGDIP_BrushUpdate")
    _AutoItObject_AddMethod($oGDIPBrush, "dispose", "__OOPGDIP_BrushDispose")
    Return $oGDIPBrush
    EndFunc ;==>_OOPGDIP_BrushCreate

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

    Func __OOPGDIP_BrushDispose($oSelf)
    _GDIPlus_BrushDispose($oSelf.handle)
    EndFunc ;==>__OOPGDIP_BrushDispose

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

    Func __OOPGDIP_BrushUpdate($oSelf)
    _GDIPlus_BrushSetSolidColor($oSelf.handle, $oSelf.color)
    EndFunc ;==>__OOPGDIP_BrushUpdate

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

    Func _OOPGDIP_FontCreate($fSize, $sFamily = "Arial", $iStyle = 0, $Align = 0, $iFormat = 0, $iLangID = 0)
    Local $hFamily = _GDIPlus_FontFamilyCreate($sFamily)
    Local $hFont = _GDIPlus_FontCreate($hFamily, $fSize, $iStyle, 2)
    Local $hFormat = _GDIPlus_StringFormatCreate($iFormat, $iLangID)
    _GDIPlus_StringFormatSetAlign($hFormat, $Align)
    Local $oGDIPFont = _AutoItObject_Create()
    _AutoItObject_AddProperty($oGDIPFont, "handle", $ELSCOPE_PUBLIC, Number($hFont))
    _AutoItObject_AddProperty($oGDIPFont, "hfamily", $ELSCOPE_PUBLIC, Number($hFamily))
    _AutoItObject_AddProperty($oGDIPFont, "hformat", $ELSCOPE_PUBLIC, Number($hFormat))
    _AutoItObject_AddProperty($oGDIPFont, "size", $ELSCOPE_PUBLIC, $fSize)
    _AutoItObject_AddProperty($oGDIPFont, "fontname", $ELSCOPE_PUBLIC, $sFamily)
    _AutoItObject_AddProperty($oGDIPFont, "style", $ELSCOPE_PUBLIC, $iStyle)
    _AutoItObject_AddProperty($oGDIPFont, "align", $ELSCOPE_PUBLIC, $Align)
    _AutoItObject_AddProperty($oGDIPFont, "format", $ELSCOPE_PUBLIC, $iFormat)
    _AutoItObject_AddProperty($oGDIPFont, "langID", $ELSCOPE_PUBLIC, $iLangID)
    _AutoItObject_AddMethod($oGDIPFont, "dispose", "__OOPGDIP_FontDispose")
    _AutoItObject_AddMethod($oGDIPFont, "update", "__OOPGDIP_FontDispose")
    Return $oGDIPFont
    EndFunc ;==>_OOPGDIP_FontCreate

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

    Func __OOPGDIP_FontDispose($oSelf)
    _GDIPlus_FontDispose($oSelf.hanlde)
    _GDIPlus_FontFamilyDispose($oSelf.hfamily)
    _GDIPlus_StringFormatDispose($oSelf.hformat)
    EndFunc ;==>__OOPGDIP_FontDispose

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

    Func _OOPGDIP_FontUpdate($oSelf)
    $oSelf.hfamily = Number(_GDIPlus_FontFamilyCreate($oSelf.fontname))
    $oSelf.handle = Number(_GDIPlus_FontCreate($oSelf.family, $oSelf.size, $oSelf.style, 2))
    $oSelf.hformat = Number(_GDIPlus_StringFormatCreate($oSelf.format, $oSelf.langID))
    _GDIPlus_StringFormatSetAlign($oSelf.hformat, $oSelf.align)
    EndFunc ;==>_OOPGDIP_FontUpdate

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

    #EndRegion Zeichenobjekte--------------------------------------------------------------
    ;EndRegion Zeichenobjekte-----------------------------------------------------------

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

    #Region Sonstiges-------------------------------------------------------------------
    Func _OOPGDIP_Startup()
    _AutoItObject_Startup()
    _GDIPlus_Startup()
    EndFunc ;==>_OOPGDIP_Startup

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

    Func _OOPGDIP_Shutdown()
    _AutoItObject_Shutdown()
    _GDIPlus_Shutdown()
    EndFunc ;==>_OOPGDIP_Shutdown

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

    Func __OOPGDIP_TestRun()
    Local $hGUI, $hImage
    Local $oGDIPGraphic, $oGDIPLine, $oGDIPPen, $oGDIPBrush, $oGDIPRect, $oGDIPEllipse, $oGDIPFilledEllipse, $oGDIPFilledRect, $oGDIPPolygon, $oGDIPFilledPolygon, $oGDIPBuffer, $oGDIPPie, $oGDIPClosedCurve, $oGDIPFilledClosedCurve, $oGDIPCurve, $oGDIPBezier, $oGDIPImage, $oGDIPString, $oGDIPFont, $oGDIPStringEx[2]
    Local $aPolygonCords[4][2] = [[3],[300, 30],[300, 160],[400, 160]]
    Local $aCurveCords[5][2] = [[4],[20, 100],[50, 50],[100, 100],[150, 50]]
    Local $ImageRotation = True

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

    $hGUI = GUICreate("OOPGDIP = AutoIt + OOP + GDI+ ~-~ Funktionstest", 500, 500, -1, -1)
    GUISetBkColor(0x6544AB)
    GUISetState()

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

    _OOPGDIP_Startup()

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

    $hImage = _GDIPlus_ImageLoadFromFile("NosHacks Logo_trans.png")

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

    $oGDIPGraphic = _OOPGDIP_GraphicsCreate($hGUI)
    $oGDIPBuffer = _OOPGDIP_BufferCreate($oGDIPGraphic, 500, 500, 0xFF6544AB, 4)
    $oGDIPPen = _OOPGDIP_PenCreate(0xFF00FF00)
    $oGDIPBrush = _OOPGDIP_BrushCreate(0xFFFF0000)
    $oGDIPLine = _OOPGDIP_LineCreate($oGDIPBuffer, 10, 40, 100, 200, $oGDIPPen)
    $oGDIPRect = _OOPGDIP_RectCreate($oGDIPBuffer, 10, 40, 100, 200, $oGDIPPen)
    $oGDIPEllipse = _OOPGDIP_EllipseCreate($oGDIPBuffer, 200, 200, 170, 100, $oGDIPPen, 0, 320)
    $oGDIPPie = _OOPGDIP_PieCreate($oGDIPBuffer, 300, 300, 170, 100, $oGDIPPen, 0, 320)
    $oGDIPFilledEllipse = _OOPGDIP_FilledEllipseCreate($oGDIPBuffer, 300, 300, 170, 100, $oGDIPBrush, 0, 320)
    $oGDIPFilledRect = _OOPGDIP_FilledRectCreate($oGDIPBuffer, 10, 300, 200, 100, $oGDIPBrush)
    $oGDIPPolygon = _OOPGDIP_PolygonCreate($oGDIPBuffer, $aPolygonCords, $oGDIPPen)
    $oGDIPFilledPolygon = _OOPGDIP_FilledPolygonCreate($oGDIPBuffer, $aPolygonCords, $oGDIPBrush)
    $oGDIPClosedCurve = _OOPGDIP_ClosedCurveCreate($oGDIPBuffer, $aPolygonCords, $oGDIPPen)
    $oGDIPFilledClosedCurve = _OOPGDIP_FilledClosedCurveCreate($oGDIPBuffer, $aPolygonCords, $oGDIPBrush)
    $oGDIPCurve = _OOPGDIP_CurveCreate($oGDIPBuffer, $aCurveCords, $oGDIPPen)
    $oGDIPBezier = _OOPGDIP_BezierCreate($oGDIPBuffer, 30, 50, 100, 5, 125, 25, 250, 50, $oGDIPPen)
    $oGDIPImage = _OOPGDIP_ImageCreate($oGDIPBuffer, $hImage, 10, 500 - 40)
    $oGDIPString = _OOPGDIP_StringCreate($oGDIPBuffer, "Test", 100, 100, "Blackadder ITC", 100)
    $oGDIPFont = _OOPGDIP_FontCreate(70, "Curlz MT", 1, 1)
    $oGDIPStringEx[0] = _OOPGDIP_StringExCreate($oGDIPBuffer, "TestEx1", 0, 0, 400, 100, $oGDIPFont, $oGDIPBrush)
    $oGDIPStringEx[1] = _OOPGDIP_StringExCreate($oGDIPBuffer, "TestEx2", 0, 100, 400, 100, $oGDIPFont, $oGDIPBrush)

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

    While GUIGetMsg() <> -3
    Sleep(20)
    $oGDIPBuffer.clear
    If $oGDIPImage.width1 >= -214 And $ImageRotation Then
    $oGDIPImage.x1Pos = $oGDIPImage.x1Pos + 1
    $oGDIPImage.width1 = $oGDIPImage.width1 - 2
    If $oGDIPImage.width1 = -214 Then $ImageRotation = False
    Else
    $oGDIPImage.x1Pos = $oGDIPImage.x1Pos - 1
    $oGDIPImage.width1 = $oGDIPImage.width1 + 2
    If $oGDIPImage.width1 = 214 Then $ImageRotation = True
    EndIf
    $oGDIPImage.draw
    $oGDIPLine.draw
    $oGDIPRect.draw
    $oGDIPFilledEllipse.sangle = $oGDIPFilledEllipse.sangle + 2
    $oGDIPFilledEllipse.draw
    $oGDIPEllipse.draw
    $oGDIPPie.sangle = $oGDIPPie.sangle + 2
    $oGDIPPie.draw
    $oGDIPFilledRect.draw
    $oGDIPFilledClosedCurve.draw
    $oGDIPClosedCurve.draw
    $oGDIPFilledPolygon.draw
    $oGDIPPolygon.draw
    $oGDIPCurve.draw
    $oGDIPBezier.draw
    $oGDIPString.draw
    If $oGDIPStringEx[0] .xPos <= 200 Then $oGDIPStringEx[0] .xPos = $oGDIPStringEx[0] .xPos + 1
    $oGDIPStringEx[0] .update
    $oGDIPStringEx[0] .draw
    If $oGDIPStringEx[1] .yPos <= 380 Then $oGDIPStringEx[1] .yPos = $oGDIPStringEx[1] .yPos + 1
    $oGDIPStringEx[1] .update
    $oGDIPStringEx[1] .draw
    $oGDIPBuffer.draw
    WEnd

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

    _GDIPlus_ImageDispose($hImage)

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

    $oGDIPBrush.dispose
    $oGDIPPen.dispose
    $oGDIPBuffer.dispose
    $oGDIPGraphic.dispose
    _OOPGDIP_Shutdown()
    Exit
    EndFunc ;==>__OOPGDIP_TestRun
    #EndRegion Sonstiges-------------------------------------------------------------------
    ;EndRegion Sonstiges----------------------------------------------------------------

    [/autoit]


    Die AutoItObject.au3 muss in das Include-Verzeichnis, ansonsten funktioniert das Skript nicht!
    AutoItObject.au3 - Download

    Ich erbitte Feedback und viele Anregungen, wie ich das Skript verbessern kann.

    MfG,
    Nestos aka h2112.


    ChangeLog

    Edit:
    1. Update - Mehr Formen verfügbar

    Edit:
    2. Update - Buffer umgesetzt und Dispose-Methoden umgesetzt

    Edit:
    3. Update - clearcolor hinzugefügt, Skript aufgeräumt und Beispiel hinzugefügt

    Edit:
    4. Update - String durch Number ersetzt - Danke an Progandy!

    Edit:
    5. Update - Alle Standardformen von GDI+ umgesetzt

    Edit:
    6. Update - Image umgesetzt

    Edit:
    7. Update - String umgesetzt

    Edit:
    8. Update - Font und StringEx umgesetzt

    In dem Anhang ist enthalen:
    AutoItObject.au3
    OOPGDIP.au3
    Beispiel - Kompletter Funktionsumfang.au3
    NosHacks Logo_trans.png
    PingPong.au3

    Dateien

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%

    11 Mal editiert, zuletzt von H2112 (2. Juni 2011 um 21:41) aus folgendem Grund: Update

  • Das ging mir auch durch den Kopf, um überhaupt sich mit der OOP vertraut zu machen, aber wofür GDI+ (meine Meinung)?

    Lieber DirectX, Direct2D o.ä. mit OOP überstetzen...

    Ansonsten ein schönes Beispiel für OOP! :thumbup:

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Das ging mir auch durch den Kopf, um überhaupt sich mit der OOP vertraut zu machen, aber wofür GDI+ (meine Meinung)?

    Wie gesagt, das Skript ist nur zu Lernzwecken gedacht. Zudem finde ich es mit Objekten leichter GDI+ zu steuern. So kann man sich die Erstellung unzähliger Variablen ersparen und das ganze kürzer halten.

    Warum ich genau GDI+ gewählt habe ist die Tatsache, dass ich GDI+ fast in jedem Skript verwende und ich mir jetzt dachte, wieso das ganze nicht etwas einfacher gestalten?

    MfG,
    Nestos.

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%

  • das wofür GDI+ (meine Meinung) wollte ich nur sagen, dass ich nicht versuchen werde, mit GDI+ anzufangen, sondern eher mit klassischen Beispielen, deswegen das wofür GDI+.

    Ich finde es klasse, dass du es für GDI+ gemacht hast :!:

    Irgendwann fange ich auch mal damit an...

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • Das sieht sehr interessant aus, schönes Beispiel H2112 :) . Ich habe mich noch nie wirklich mit OOP beschäftigt (Kann also sein, dass meine Frage totaler Schwachsinn ist), aber wäre es möglich die Vektorklassen die aus z.B. C++ bekannt sind in AutoIt zu verwenden? :S

  • Ich hab jetzt den Buffer ebenfalls umgesetzt und Dispose-Methoden ebenfalls hinzugefügt.
    Um das ganze einfacher zu halten, wird die Bitmap gleich miterstellt, was ich in einer späteren Version aber ändern werde.

    MfG,
    Nestos.

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%

  • Ein kleines Update:
    graphic.clearcolor & buffer.clearcolor hinzugefügt
    Skript aufgeräumt

    Zudem habe ich ein kleines Beispiel geschrieben.
    Ein PingPong-Spiel um zu verdeutlichen, was man mit der UDF machen kann. Ich persönlich finde es gelungen und finde ebenfalls, dass damit vereinfacht dargestellt wird was man mit der UDF anfangen kann.

    MfG,
    Nestos.

    Edit:
    Update - Alle Standardformen der GDIPlus.au3 umgesetzt

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%

    Einmal editiert, zuletzt von H2112 (12. Mai 2011 um 22:11)

  • Update!

    Nun habe ich ImageCreate auch noch umgesetzt.
    Geplant sind noch String, danach werde ich Funktionsbeschreibungen machen und ein paar Funktion verbessern.

    MfG,
    Nestos.

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%

  • Update!

    _OOPGDIP_StringCreate umgesetzt. ;)

    Ich habe oben noch ein weiteres Beispielskript eingefügt, was den kompletten Funktionsumfang zeigt.

    MfG,
    Nestos.

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%

  • hi,

    du könntest noch methoden machen wie zB. kollisionsabfragen zwischen den objekten.


    Das gehört nicht zur Grafik. Ein zusätzliches Objekt, das die GDI+Objekte nach Koordinaten und Typ auf Kollisionen prüft, ist aber eine nette Idee.

    Wenn du noch Aufgaben suchst, würde ich dir vorschlagen, auch für Polygone und Kurven noch Funktionen zum bearbeiten einzelner Punkte zu erstellen, z.B. verschieben, hinzufügen und löschen ;)

  • wow
    Das sieht sehr gut aus ^^. Richtig gut finde ich, dass du es Buffer genannt hast und nicht iwie mit Bitmap und ImageCreate... Und wenn jetzt schon wie gesagt noch eine Kollisionsabfrage reinkommen würde, dann würd ichs aufjeden Fall immer anstatt Gdi+ benutzen ^^. Vlt noch die Sachen aus der Gdip.au3 mit hinzufügen zur Verfolständigung - wäre sehr nett :thumbup:

    Nur keine Hektik - das Leben ist stressig genug

  • hi,

    du könntest noch methoden machen wie zB. kollisionsabfragen zwischen den objekten.

    Die Idee geht mir schon seit geraumer Zeit durch den Kopf, jedoch wäre das mehr für eine eigen UDF.
    Das Problem ist hier, dass ich die Kollisionsformeln nicht kenne und anwenden kann. Da du dich ja schon eingehend damit befasst hast, wäre es sehr nett, wenn du mir die Formeln und vielleicht sogar ein paar Beispiele bereitstellen würdest, dann würde ich das auf jeden Fall umsetzten. :)

    Wenn du noch Aufgaben suchst, würde ich dir vorschlagen, auch für Polygone und Kurven noch Funktionen zum bearbeiten einzelner Punkte zu erstellen, z.B. verschieben, hinzufügen und löschen ;)

    Kam mir auch in den Sinn, nur bei der Umsätzung scheitere ich ein bisschen.
    Wenn man immer nur zwei Punkte hinzufügen kann, wäre es sehr umständlich. Da wäre es viel besser, wenn man gleich 'unendlich' viele Koordinaten angeben könnte. Dort scheitere ich.


    wow
    Das sieht sehr gut aus ^^. Richtig gut finde ich, dass du es Buffer genannt hast und nicht iwie mit Bitmap und ImageCreate... Und wenn jetzt schon wie gesagt noch eine Kollisionsabfrage reinkommen würde, dann würd ichs aufjeden Fall immer anstatt Gdi+ benutzen ^^. Vlt noch die Sachen aus der Gdip.au3 mit hinzufügen zur Verfolständigung - wäre sehr nett :thumbup:


    Danke für das Lob. ;)
    Mir erschien es einfacher für Anfänger, wenn man direkt einen Buffer erzeugen kann, ohne viel Aufwand zu betreiben.
    Mit den Kollisionsabfragen ist es wie gesagt ein Problem, aber ich werd mich darum kümmern, sobald ich die Formeln im Überblick habe.
    Als erstes werde ich mich darum kümmern, die Funktionen aus der GDIPlus.au3 umszusetzen, danach kann man immer noch weiter schauen. ;)

    Danke für das Lob und die Vorschläge. :party:

    MfG,
    Nestos.

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%

  • Update!

    _OOPGDIP_FontCreate und _OOPGDIP_StringExCreate umgesetzt. ;)

    Das Beispielskript wurde auch geupdatet.

    Ich würde mich freuen, wenn sich einige mit der UDF auseinandersetzen würden, sodass sie mir Verbesserungsvorschläge sagen und Fehler melden können. Auch würde ich mich über Beispiele freuen.

    MfG,
    Nestos.

    Zitat

    [Heute, 11:39] Raupi: Soll ich es dir machen?
    [Heute, 11:47] BugFix: "Soll ich es dir machen? " - also Raupi !! bitte nicht so öffentlich :rofl:

    Zitat

    [Heute, 11:51] BugFix: und ich werde es mir jetzt machen - das Mittagessen :P

    AMsg UDF v1.00.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%
    OwnStyle UDF Version 1.10.00 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 100%