;~ #include <GDIPlus2.au3>
#include <Misc.au3>
#include <Memory.au3>
#include <Array.au3>
#include <WindowsConstants.au3>

#region - GDIPlus2 (nur die Normalen Funktionen. manche aber rausgenommen...)

#include-once

#include "GDIPlusConstants.au3"
#include "WinAPI.au3"
#include "StructureConstants.au3"

; #INDEX# =======================================================================================================================
; Title .........: GDIPlus
; AutoIt Version : 3.2.3++
; Language ......: English
; Description ...: Functions that assist with Microsoft Windows GDI+ management.
;                  It enables applications to use graphics and formatted text on both the video display and the printer.
;                  Applications based on the Microsoft Win32 API do not access graphics hardware directly.
;                  Instead, GDI+ interacts with device drivers on behalf of applications.
;                  GDI+ can be used in all Windows-based applications.
;                  GDI+ is new technology that is included in Windows XP and  the Windows Server 2003.
;                  It is required as a redistributable for applications that run on the Windows NT 4.0 SP6,
;                  Windows 2000, Windows 98, and Windows Me operating systems.
; Author ........: Paul Campbell (PaulIA)
; Dll ...........: GDIPlus.dll
; ===============================================================================================================================

; #VARIABLES# ===================================================================================================================
Global $ghGDIPBrush = 0
Global $ghGDIPDll = 0
Global $ghGDIPPen = 0
Global $giGDIPRef = 0
Global $giGDIPToken = 0
; ===============================================================================================================================

; #CURRENT# =====================================================================================================================
;_GDIPlus_ArrowCapCreate
;_GDIPlus_ArrowCapDispose
;_GDIPlus_ArrowCapGetFillState
;_GDIPlus_ArrowCapGetHeight
;_GDIPlus_ArrowCapGetMiddleInset
;_GDIPlus_ArrowCapGetWidth
;_GDIPlus_ArrowCapSetFillState
;_GDIPlus_ArrowCapSetHeight
;_GDIPlus_ArrowCapSetMiddleInset
;_GDIPlus_ArrowCapSetWidth
;_GDIPlus_BitmapCloneArea
;_GDIPlus_BitmapCreateFromFile
;_GDIPlus_BitmapCreateFromGraphics
;_GDIPlus_BitmapCreateFromHBITMAP
;_GDIPlus_BitmapCreateHBITMAPFromBitmap
;_GDIPlus_BitmapDispose
;_GDIPlus_BitmapLockBits
;_GDIPlus_BitmapUnlockBits
;_GDIPlus_BrushClone
;_GDIPlus_BrushCreateSolid
;_GDIPlus_BrushDispose
;_GDIPlus_BrushGetSolidColor
;_GDIPlus_BrushGetType
;_GDIPlus_BrushSetSolidColor
;_GDIPlus_CustomLineCapDispose
;_GDIPlus_Decoders
;_GDIPlus_DecodersGetCount
;_GDIPlus_DecodersGetSize
;_GDIPlus_DrawImagePoints
;_GDIPlus_Encoders
;_GDIPlus_EncodersGetCLSID
;_GDIPlus_EncodersGetCount
;_GDIPlus_EncodersGetParamList
;_GDIPlus_EncodersGetParamListSize
;_GDIPlus_EncodersGetSize
;_GDIPlus_FontCreate
;_GDIPlus_FontDispose
;_GDIPlus_FontFamilyCreate
;_GDIPlus_FontFamilyDispose
;_GDIPlus_GraphicsClear
;_GDIPlus_GraphicsCreateFromHDC
;_GDIPlus_GraphicsCreateFromHWND
;_GDIPlus_GraphicsDispose
;_GDIPlus_GraphicsDrawArc
;_GDIPlus_GraphicsDrawBezier
;_GDIPlus_GraphicsDrawClosedCurve
;_GDIPlus_GraphicsDrawCurve
;_GDIPlus_GraphicsDrawEllipse
;_GDIPlus_GraphicsDrawImage
;_GDIPlus_GraphicsDrawImageRect
;_GDIPlus_GraphicsDrawImageRectRect
;_GDIPlus_GraphicsDrawLine
;_GDIPlus_GraphicsDrawPie
;_GDIPlus_GraphicsDrawPolygon
;_GDIPlus_GraphicsDrawRect
;_GDIPlus_GraphicsDrawString
;_GDIPlus_GraphicsDrawStringEx
;_GDIPlus_GraphicsFillClosedCurve
;_GDIPlus_GraphicsFillEllipse
;_GDIPlus_GraphicsFillPie
;_GDIPlus_GraphicsFillPolygon
;_GDIPlus_GraphicsFillRect
;_GDIPlus_GraphicsGetDC
;_GDIPlus_GraphicsGetSmoothingMode
;_GDIPlus_GraphicsMeasureString
;_GDIPlus_GraphicsReleaseDC
;_GDIPlus_GraphicsSetTransform
;_GDIPlus_GraphicsSetSmoothingMode
;_GDIPlus_ImageDispose
;_GDIPlus_ImageGetFlags
;_GDIPlus_ImageGetGraphicsContext
;_GDIPlus_ImageGetHeight
;_GDIPlus_ImageGetHorizontalResolution
;_GDIPlus_ImageGetPixelFormat
;_GDIPlus_ImageGetRawFormat
;_GDIPlus_ImageGetType
;_GDIPlus_ImageGetVerticalResolution
;_GDIPlus_ImageGetWidth
;_GDIPlus_ImageLoadFromFile
;_GDIPlus_ImageSaveToFile
;_GDIPlus_ImageSaveToFileEx
;_GDIPlus_MatrixCreate
;_GDIPlus_MatrixDispose
;_GDIPlus_MatrixRotate
;_GDIPlus_MatrixScale
;_GDIPlus_MatrixTranslate
;_GDIPlus_ParamAdd
;_GDIPlus_ParamInit
;_GDIPlus_PenCreate
;_GDIPlus_PenDispose
;_GDIPlus_PenGetAlignment
;_GDIPlus_PenGetColor
;_GDIPlus_PenGetCustomEndCap
;_GDIPlus_PenGetDashCap
;_GDIPlus_PenGetDashStyle
;_GDIPlus_PenGetEndCap
;_GDIPlus_PenGetWidth
;_GDIPlus_PenSetAlignment
;_GDIPlus_PenSetColor
;_GDIPlus_PenSetDashCap
;_GDIPlus_PenSetCustomEndCap
;_GDIPlus_PenSetDashStyle
;_GDIPlus_PenSetEndCap
;_GDIPlus_PenSetWidth
;_GDIPlus_RectFCreate
;_GDIPlus_Shutdown
;_GDIPlus_Startup
;_GDIPlus_StringFormatCreate
;_GDIPlus_StringFormatDispose
;_GDIPlus_StringFormatSetAlign
; ===============================================================================================================================

; #INTERNAL_USE_ONLY# ===========================================================================================================
;__GDIPlus_BrushDefCreate
;__GDIPlus_BrushDefDispose
;__GDIPlus_ExtractFileExt
;__GDIPlus_LastDelimiter
;__GDIPlus_PenDefCreate
;__GDIPlus_PenDefDispose
; ===============================================================================================================================

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ArrowCapCreate
; Description ...: Creates an adjustable arrow line cap with the specified height and width
; Syntax.........: _GDIPlus_ArrowCapCreate($nHeight, $nWidth[, $bFilled = True])
; Parameters ....: $fHeight - Specifies the length, in units, of the arrow from its base to its point
;                  $fWidth  - Specifies the distance, in units, between the corners of the base of the arrow
;                  $bFilled - Fill flag:
;                  |True  - Arrow will be filled
;                  |False - Arrow will not be filled
; Return values .: Success      - Returns a handle to a new ArrowCap object
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: After you are done with the object, call _GDIPlus_ArrowCapDispose to release the object resources
; Related .......: _GDIPlus_ArrowCapDispose
; Link ..........: @@MsdnLink@@ GdipCreateAdjustableArrowCap
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ArrowCapCreate($fHeight, $fWidth, $bFilled = True)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateAdjustableArrowCap", "float", $fHeight, "float", $fWidth, "bool", $bFilled, "ptr*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[4])
EndFunc   ;==>_GDIPlus_ArrowCapCreate

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ArrowCapDispose
; Description ...: Release an adjustable arrow line cap object
; Syntax.........: _GDIPlus_ArrowCapDispose($hCap)
; Parameters ....: $hCap        - Handle to a adjustable arrow line cap object
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_ArrowCapCreate
; Link ..........: @@MsdnLink@@ GdipDeleteCustomLineCap
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ArrowCapDispose($hCap)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeleteCustomLineCap", "handle", $hCap)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_ArrowCapDispose

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ArrowCapGetFillState
; Description ...: Determines whether the arrow cap is filled
; Syntax.........: _GDIPlus_ArrowCapGetFillState($hArrowCap)
; Parameters ....: $hArrowCap   - Handle to a ArrowCap object
; Return values .: True         - Arrow cap is filled
;                  False        - Arrow cap is not filled or if error then @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_ArrowCapSetFillState
; Link ..........: @@MsdnLink@@ GdipGetAdjustableArrowCapFillState
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ArrowCapGetFillState($hArrowCap)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetAdjustableArrowCapFillState", "handle", $hArrowCap, "bool*", 0)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_ArrowCapGetFillState

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ArrowCapGetHeight
; Description ...: Gets the height of the arrow cap
; Syntax.........: _GDIPlus_ArrowCapGetHeight($hArrowCap)
; Parameters ....: $hArrowCap   - Handle to a ArrowCap object
; Return values .: Success      - Returns the height of the arrow cap
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: The height is the distance from the base of the arrow to its vertex
; Related .......: _GDIPlus_ArrowCapSetHeight
; Link ..........: @@MsdnLink@@ GdipGetAdjustableArrowCapHeight
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ArrowCapGetHeight($hArrowCap)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetAdjustableArrowCapHeight", "handle", $hArrowCap, "float*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_ArrowCapGetHeight

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ArrowCapGetMiddleInset
; Description ...: Gets the value of the inset
; Syntax.........: _GDIPlus_ArrowCapGetMiddleInset($hArrowCap)
; Parameters ....: $hArrowCap   - Handle to a ArrowCap object
; Return values .: Success      - Inset value
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: The middle inset is the number of units that the midpoint of the base shifts towards the vertex.  A middle
;                  inset of zero results in no shift (the base is a straight line, giving the arrow a triangular shape).  A
;                  positive (greater than zero) middle inset results in a shift the specified number of units toward the vertex
;                  (the base is an arrow shape that points toward the vertex, giving the arrow cap a V-shape).  A negative (less
;                  than zero) middle inset results in a shift the specified number of units away from the vertex (the base
;                  becomes an arrow shape that points away from the vertex, giving the arrow either a diamond shape (if the
;                  absolute value of the middle inset is equal to the height) or distorted diamond shape.  If the middle inset is
;                  equal to or greater than the height of the arrow cap, the cap does not appear at all.  The value of the middle
;                  inset affects the arrow cap only if the arrow cap is filled.
; Related .......: _GDIPlus_ArrowCapSetMiddleInset
; Link ..........: @@MsdnLink@@ GdipGetAdjustableArrowCapMiddleInset
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ArrowCapGetMiddleInset($hArrowCap)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetAdjustableArrowCapMiddleInset", "handle", $hArrowCap, "float*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_ArrowCapGetMiddleInset

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ArrowCapGetWidth
; Description ...: Gets the width of the arrow cap
; Syntax.........: _GDIPlus_ArrowCapGetWidth($hArrowCap)
; Parameters ....: $hArrowCap   - Handle to a ArrowCap object
; Return values .: Success      - Returns the width of the arrow cap
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: The width is the distance between the endpoints of the base of the arrow
; Related .......: _GDIPlus_ArrowCapSetWidth
; Link ..........: @@MsdnLink@@ GdipGetAdjustableArrowCapWidth
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ArrowCapGetWidth($hArrowCap)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetAdjustableArrowCapWidth", "handle", $hArrowCap, "float*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_ArrowCapGetWidth

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ArrowCapSetFillState
; Description ...: Sets whether the arrow cap is filled
; Syntax.........: _GDIPlus_ArrowCapSetFillState($hArrowCap, $bFilled = True)
; Parameters ....: $hArrowCap   - Handle to a ArrowCap object
;                  $bFilled     - Fill state:
;                  |True  - Arrow cap is filled
;                  |False - Arrow cap is not filled
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_ArrowCapGetFillState
; Link ..........: @@MsdnLink@@ GdipSetAdjustableArrowCapFillState
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ArrowCapSetFillState($hArrowCap, $bFilled = True)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetAdjustableArrowCapFillState", "handle", $hArrowCap, "bool", $bFilled)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_ArrowCapSetFillState

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ArrowCapSetHeight
; Description ...: Sets the height of the arrow cap
; Syntax.........: _GDIPlus_ArrowCapSetHeight($hArrowCap, $fHeight)
; Parameters ....: $hArrowCap   - Handle to a ArrowCap object
;                  $fHeight     - Specifies the length, in units, of the arrow from its base to its point
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_ArrowCapGetHeight
; Link ..........: @@MsdnLink@@ GdipSetAdjustableArrowCapHeight
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ArrowCapSetHeight($hArrowCap, $fHeight)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetAdjustableArrowCapHeight", "handle", $hArrowCap, "float", $fHeight)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_ArrowCapSetHeight

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ArrowCapSetMiddleInset
; Description ...: Gets the value of the inset
; Syntax.........: _GDIPlus_ArrowCapSetMiddleInset($hArrowCap, $fInset)
; Parameters ....: $hArrowCap   - Handle to a ArrowCap object
;                  $fInset      - Inset value
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: The middle inset is the number of units that the midpoint of the base shifts towards the vertex.  A middle
;                  inset of zero results in no shift (the base is a straight line, giving the arrow a triangular shape).  A
;                  positive (greater than zero) middle inset results in a shift the specified number of units toward the vertex
;                  (the base is an arrow shape that points toward the vertex, giving the arrow cap a V-shape).  A negative (less
;                  than zero) middle inset results in a shift the specified number of units away from the vertex (the base
;                  becomes an arrow shape that points away from the vertex, giving the arrow either a diamond shape (if the
;                  absolute value of the middle inset is equal to the height) or distorted diamond shape.  If the middle inset is
;                  equal to or greater than the height of the arrow cap, the cap does not appear at all.  The value of the middle
;                  inset affects the arrow cap only if the arrow cap is filled.
; Related .......: _GDIPlus_ArrowCapGetMiddleInset
; Link ..........: @@MsdnLink@@ GdipSetAdjustableArrowCapMiddleInset
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ArrowCapSetMiddleInset($hArrowCap, $fInset)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetAdjustableArrowCapMiddleInset", "handle", $hArrowCap, "float", $fInset)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_ArrowCapSetMiddleInset

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ArrowCapSetWidth
; Description ...: Sets the width of the arrow cap
; Syntax.........: _GDIPlus_ArrowCapSetWidth($hArrowCap, $fWidth)
; Parameters ....: $hArrowCap   - Handle to a ArrowCap object
;                  $fWidth      - Specifies the width, in units, of the arrow between the endpoints of the base of the arrow
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_ArrowCapGetWidth
; Link ..........: @@MsdnLink@@ GdipSetAdjustableArrowCapWidth
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ArrowCapSetWidth($hArrowCap, $fWidth)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetAdjustableArrowCapWidth", "handle", $hArrowCap, "float", $fWidth)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_ArrowCapSetWidth

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_BitmapCloneArea
; Description ...: Create a clone of a Bitmap object from the coordinates and format specified
; Syntax.........: _GDIPlus_BitmapCloneArea($hBmp, $iLeft, $iTop, $iWidth, $iHeight[, $iFormat = 0x00021808])
; Parameters ....: $hBmp        - Handle to a Bitmap object
;                  $iLeft       - X coordinate of upper left corner of the rectangle to copy
;                  $iTop        - Y coordinate of upper left corner of the rectangle to copy
;                  $iWidth      - The width of the rectangle that specifies the portion of this bitmap to copy
;                  $iHeight     - The height of the rectangle that specifies the portion of this bitmap to copy
;                  $iFormat     - Pixel format for the new bitmap:
;                  |$GDIP_PXF01INDEXED   = 1 bit per pixel, indexed
;                  |$GDIP_PXF04INDEXED   = 4 bits per pixel, indexed
;                  |$GDIP_PXF08INDEXED   = 8 bits per pixel, indexed
;                  |$GDIP_PXF16GRAYSCALE = 16 bits per pixel, grayscale
;                  |$GDIP_PXF16RGB555    = 16 bits per pixel; 5 bits for each RGB component
;                  |$GDIP_PXF16RGB565    = 16 bits per pixel; 5 bits for red, 6 bits for green and 5 bits blue
;                  |$GDIP_PXF16ARGB1555  = 16 bits per pixel; 1 bit for alpha and 5 bits for each RGB component
;                  |$GDIP_PXF24RGB       = 24 bits per pixel; 8 bits for each RGB component
;                  |$GDIP_PXF32RGB       = 32 bits per pixel; 8 bits for each RGB component. No alpha component.
;                  |$GDIP_PXF32ARGB      = 32 bits per pixel; 8 bits for each RGB and alpha component
;                  |$GDIP_PXF32PARGB     = 32 bits per pixel; 8 bits for each RGB and alpha component, pre-mulitiplied
;                  |$GDIP_PXF48RGB       = 48 bits per pixel; 16 bits for each RGB component
;                  |$GDIP_PXF64ARGB      = 64 bits per pixel; 16 bits for each RGB and alpha component
;                  |$GDIP_PXF64PARGB     = 64 bits per pixel; 16 bits for each RGB and alpha component, pre-multiplied
; Return values .: Success      - Returns a handle to a new Bitmap object
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the Bitmap object, call _WinAPI_DeleteObject to release the resources
; Related .......: _WinAPI_DeleteObject, _GDIPlus_ImageGetPixelFormat
; Link ..........: @@MsdnLink@@ GdipCloneBitmapAreaI
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_BitmapCloneArea($hBmp, $iLeft, $iTop, $iWidth, $iHeight, $iFormat = 0x00021808)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipCloneBitmapAreaI", "int", $iLeft, "int", $iTop, "int", $iWidth, "int", $iHeight, _
			"int", $iFormat, "handle", $hBmp, "ptr*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[7])
EndFunc   ;==>_GDIPlus_BitmapCloneArea

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_BitmapCreateFromFile
; Description ...: Create a Bitmap object from file
; Syntax.........: _GDIPlus_BitmapCreateFromFile($sFileName)
; Parameters ....: $sFileName   - Path to a bitmap file
; Return values .: Success      - Handle to a Bitmap object
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the Bitmap object, call _GDIPlus_BitmapDispose to release the resources
; Related .......: _WinAPI_DeleteObject
; Link ..........: @@MsdnLink@@ GdipCreateBitmapFromFile
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_BitmapCreateFromFile($sFileName)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateBitmapFromFile", "wstr", $sFileName, "ptr*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_BitmapCreateFromFile

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_BitmapCreateFromGraphics
; Description ...: Creates a Bitmap object based on a Graphics object, a width, and a height
; Syntax.........: _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics)
; Parameters ....: $iWidth      - Specifies the width, in pixels, of the bitmap
;                  $iHeight     - Specifies the height, in pixels, of the bitmap
;                  $hGraphics   - Handle to a Graphics object
; Return values .: Success      - Handle to a Bitmap object
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the Bitmap object, call _GDIPlus_BitmapDispose to release the resources
; Related .......: _WinAPI_DeleteObject
; Link ..........: @@MsdnLink@@ GdipCreateBitmapFromGraphics
; Example .......:
; ===============================================================================================================================
Func _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateBitmapFromGraphics", "int", $iWidth, "int", $iHeight, "handle", $hGraphics, _
			"ptr*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[4])
EndFunc   ;==>_GDIPlus_BitmapCreateFromGraphics

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_BitmapCreateFromHBITMAP
; Description ...: Create a Bitmap object from a bitmap handle
; Syntax.........: _GDIPlus_BitmapCreateFromHBITMAP($hBmp[, $hPal = 0])
; Parameters ....: $hBmp        - Handle to a HBITMAP
;                  $hPal        - Handle to a HPALETTE
; Return values .: Success      - Handle to a Bitmap object
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the Bitmap object, call _GDIPlus_BitmapDispose to release the resources
; Related .......: _WinAPI_DeleteObject
; Link ..........: @@MsdnLink@@ GdipCreateBitmapFromHBITMAP
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_BitmapCreateFromHBITMAP($hBmp, $hPal = 0)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateBitmapFromHBITMAP", "handle", $hBmp, "handle", $hPal, "ptr*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[3])
EndFunc   ;==>_GDIPlus_BitmapCreateFromHBITMAP

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_BitmapCreateHBITMAPFromBitmap
; Description ...: Create a handle to a bitmap from a bitmap object
; Syntax.........: _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap[, $iARGB = 0xFF000000])
; Parameters ....: $hBitmap     - Handle to a bitmap object
;                  $iARGB       - Color object that specifies the background color
; Return values .: Success      - Handle to a HBITMAP
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the Bitmap object, call _WinAPI_DeleteObject to release the resources
; Related .......: _WinAPI_DeleteObject
; Link ..........: @@MsdnLink@@ GdipCreateHBITMAPFromBitmap
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap, $iARGB = 0xFF000000)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateHBITMAPFromBitmap", "handle", $hBitmap, "ptr*", 0, "dword", $iARGB)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_BitmapCreateHBITMAPFromBitmap

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_BitmapDispose
; Description ...: Release a bitmap object
; Syntax.........: _GDIPlus_BitmapDispose($hBitmap)
; Parameters ....: $hBitmap     - Handle to a bitmap object
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDisposeImage
; Example .......:
; ===============================================================================================================================
Func _GDIPlus_BitmapDispose($hBitmap)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDisposeImage", "handle", $hBitmap)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_BitmapDispose

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_BitmapLockBits
; Description ...: Locks a portion of a bitmap for reading or writing
; Syntax.........: _GDIPlus_BitmapLockBits($hBitmap, $iLeft, $iTop, $iWidth, $iHeight, $iFlags = $GDIP_ILMREAD, $iFormat = $GDIP_PXF32RGB)
; Parameters ....: $hBitmap     - Handle to a bitmap object
;                  $iLeft       - X coordinate of the upper-left corner of the rectangle to lock
;                  $iTop        - Y coordinate of the upper-left corner of the rectangle to lock
;                  $iWidth      - The width of the rectangle to lock
;                  $iHeight     - The height of the rectangle to lock
;                  $iFlags      - Set of flags that specify whether the locked portion of the bitmap is available for reading  or
;                  +for writing and whether the caller has already allocated a buffer. Can be a combination of the following:
;                  |$GDIP_ILMREAD         - A portion of the image is locked for reading
;                  |$GDIP_ILMWRITE        - A portion of the image is locked for writing
;                  |$GDIP_ILMUSERINPUTBUF - The buffer is allocated by the user
;                  $iFormat     - Specifies the format of the pixel data in the temporary buffer. Can be one of the following:
;                  |$GDIP_PXF01INDEXED   - 1 bpp, indexed
;                  |$GDIP_PXF04INDEXED   - 4 bpp, indexed
;                  |$GDIP_PXF08INDEXED   - 8 bpp, indexed
;                  |$GDIP_PXF16GRAYSCALE - 16 bpp, grayscale
;                  |$GDIP_PXF16RGB555    - 16 bpp; 5 bits for each RGB
;                  |$GDIP_PXF16RGB565    - 16 bpp; 5 bits red, 6 bits green, and 5 bits blue
;                  |$GDIP_PXF16ARGB1555  - 16 bpp; 1 bit for alpha and 5 bits for each RGB component
;                  |$GDIP_PXF24RGB       - 24 bpp; 8 bits for each RGB
;                  |$GDIP_PXF32RGB       - 32 bpp; 8 bits for each RGB. No alpha.
;                  |$GDIP_PXF32ARGB      - 32 bpp; 8 bits for each RGB and alpha
;                  |$GDIP_PXF32PARGB     - 32 bpp; 8 bits for each RGB and alpha, pre-mulitiplied
; Return values .: Success      - $tagGDIPBITMAPDATA structure
;                  Failure      - @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the locked portion, call _GDIPlus_BitmapUnlockBits to release the locked region
; Related .......: _WinAPI_DeleteObject, _GDIPlus_ImageGetPixelFormat
; Link ..........: @@MsdnLink@@ GdipBitmapLockBits
; Example .......:
; ===============================================================================================================================
Func _GDIPlus_BitmapLockBits($hBitmap, $iLeft, $iTop, $iWidth, $iHeight, $iFlags = $GDIP_ILMREAD, $iFormat = $GDIP_PXF32RGB)
	Local $tData = DllStructCreate($tagGDIPBITMAPDATA)
	Local $pData = DllStructGetPtr($tData)
	Local $tRect = DllStructCreate($tagRECT)
	Local $pRect = DllStructGetPtr($tRect)

	; The RECT is initialized strange for this function.  It wants the Left and
	; Top members set as usual but instead of Right and Bottom also being
	; coordinates they are expected to be the Width and Height sizes
	; respectively.
	DllStructSetData($tRect, "Left", $iLeft)
	DllStructSetData($tRect, "Top", $iTop)
	DllStructSetData($tRect, "Right", $iWidth)
	DllStructSetData($tRect, "Bottom", $iHeight)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipBitmapLockBits", "handle", $hBitmap, "ptr", $pRect, "uint", $iFlags, "int", $iFormat, "ptr", $pData)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $tData)
EndFunc   ;==>_GDIPlus_BitmapLockBits

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_BitmapUnlockBits
; Description ...: Unlocks a portion of a bitmap that was locked by _GDIPlus_BitmapLockBits
; Syntax.........: _GDIPlus_BitmapUnlockBits($hBitmap, $tBitmapData)
; Parameters ....: $hBitmap     - Handle to a bitmap object
;                  $tBitmapData - $tagGDIPBITMAPDATA structure previously passed to _GDIPlus_BitmapLockBits
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the locked portion, call _GDIPlus_BitmapUnlockBits to release the locked region
; Related .......: _WinAPI_DeleteObject
; Link ..........: @@MsdnLink@@ GdipBitmapUnlockBits
; Example .......:
; ===============================================================================================================================
Func _GDIPlus_BitmapUnlockBits($hBitmap, $tBitmapData)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipBitmapUnlockBits", "handle", $hBitmap, "ptr", DllStructGetPtr($tBitmapData))
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_BitmapUnlockBits

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_BrushClone
; Description ...: Clone a Brush object
; Syntax.........: _GDIPlus_BrushClone($hBrush)
; Parameters ....: $hBrush      - Handle to a Brush object
; Return values .: Success      - Handle to a new Brush object
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the Brush object, call _GDIPlus_BrushDispose to release the resources
; Related .......: _GDIPlus_BrushDispose
; Link ..........: @@MsdnLink@@ GdipCloneBrush
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_BrushClone($hBrush)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipCloneBrush", "handle", $hBrush, "ptr*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_BrushClone

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_BrushCreateSolid
; Description ...: Create a solid Brush object
; Syntax.........: _GDIPlus_BrushCreateSolid([$iARGB = 0xFF000000])
; Parameters ....: $iARGB       - Alpha, Red, Green and Blue components of brush
; Return values .: Success      - Handle to a solid Brush object
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the Brush object, call _GDIPlus_BrushDispose to release the resources
; Related .......: _GDIPlus_BrushDispose
; Link ..........: @@MsdnLink@@ GdipCreateSolidFill
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_BrushCreateSolid($iARGB = 0xFF000000)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateSolidFill", "int", $iARGB, "dword*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_BrushCreateSolid

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_BrushDispose
; Description ...: Release a Brush object
; Syntax.........: _GDIPlus_BrushDispose($hBrush)
; Parameters ....: $hBrush      - Handle to a Brush object
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_BrushCreateSolid, _GDIPlus_BrushClone
; Link ..........: @@MsdnLink@@ GdipDeleteBrush
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_BrushDispose($hBrush)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeleteBrush", "handle", $hBrush)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_BrushDispose

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_BrushGetSolidColor
; Description ...: Get the color of a Solid Brush object
; Syntax.........: _GDIPlus_BrushGetSolidColor($hBrush, [$iARGB = 0xFF000000])
; Parameters ....: $hBrush      - Handle to a Brush object
;				   $iARGB		- The color of the brush.
; Return values .: Success      - Brush color
;                  Failure      - -1 and @error is set
; Author ........:
; Modified.......: smashly
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipGetSolidFillColor
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_BrushGetSolidColor($hBrush)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetSolidFillColor", "handle", $hBrush, "dword*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_BrushGetSolidColor

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_BrushGetType
; Description ...: Retrieve the type of Brush object
; Syntax.........: _GDIPlus_BrushGetType($hBrush)
; Parameters ....: $hBrush      - Handle to a Brush object
; Return values .: Success      - Brush type:
;                  |0 - Solid color
;                  |1 - Hatch fill
;                  |2 - Texture fill
;                  |3 - Path gradient
;                  |4 - Linear gradient
;                  Failure     - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipGetBrushType
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_BrushGetType($hBrush)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetBrushType", "handle", $hBrush, "int*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_BrushGetType

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_BrushSetSolidColor
; Description ...: Set the color of a Solid Brush object
; Syntax.........: _GDIPlus_BrushSetSolidColor($hBrush, [$iARGB = 0xFF000000])
; Parameters ....: $hBrush      - Handle to a Brush object
;                  $iARGB       - Alpha, Red, Green and Blue components of brush
; Return values .: Success      - True
;                  Failure      - False
; Author ........:
; Modified.......: smashly
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipSetSolidFillColor
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_BrushSetSolidColor($hBrush, $iARGB = 0xFF000000)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetSolidFillColor", "handle", $hBrush, "dword", $iARGB)
	If @error Then Return SetError(@error, @extended, 0)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_BrushSetSolidColor

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_CustomLineCapDispose
; Description ...: Release a custom line cap object
; Syntax.........: _GDIPlus_CustomLineCapDispose($hCap)
; Parameters ....: $hCap        - Handle to a custom line cap object
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDeleteCustomLineCap
; Example .......:
; ===============================================================================================================================
Func _GDIPlus_CustomLineCapDispose($hCap)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeleteCustomLineCap", "handle", $hCap)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_CustomLineCapDispose

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_Decoders
; Description ...: Get an array of information about the available image decoders
; Syntax.........: _GDIPlus_Decoders()
; Parameters ....:
; Return values .: Success      - Array with the following format:
;                  |[0][ 0] - Number of decoders
;                  |[1][ 1] - Codec identifier
;                  |[1][ 2] - File format identifier
;                  |[1][ 3] - Codec name
;                  |[1][ 4] - Dll in which the code resides
;                  |[1][ 5] - The name of the file format used by the codec
;                  |[1][ 6] - Filename extensions associated with the codec
;                  |[1][ 7] - The mime type of the codec
;                  |[1][ 8] - Combination of $GDIP_ICF flags
;                  |[1][ 9] - The version of the codec
;                  |[1][10] - The number of signatures used by the file format
;                  |[1][11] - The number of bytes in each signature
;                  |[1][12] - Pointer to the pattern for each signature
;                  |[1][13] - Pointer to the mask for each signature
;                  Failure     - @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_Encoders
; Link ..........: @@MsdnLink@@ GdipGetImageDecoders
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_Decoders()
	Local $iCount = _GDIPlus_DecodersGetCount()
	Local $iSize = _GDIPlus_DecodersGetSize()
	Local $tBuffer = DllStructCreate("byte[" & $iSize & "]")
	Local $pBuffer = DllStructGetPtr($tBuffer)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetImageDecoders", "uint", $iCount, "uint", $iSize, "ptr", $pBuffer)
	If @error Then Return SetError(@error, @extended, 0)
	If $aResult[0] <> 0 Then Return SetError($aResult[0], 0, 0)

	Local $tCodec, $aInfo[$iCount + 1][14]
	$aInfo[0][0] = $iCount
	For $iI = 1 To $iCount
		$tCodec = DllStructCreate($tagGDIPIMAGECODECINFO, $pBuffer)
		$aInfo[$iI][1] = _WinAPI_StringFromGUID(DllStructGetPtr($tCodec, "CLSID"))
		$aInfo[$iI][2] = _WinAPI_StringFromGUID(DllStructGetPtr($tCodec, "FormatID"))
		$aInfo[$iI][3] = _WinAPI_WideCharToMultiByte(DllStructGetData($tCodec, "CodecName"))
		$aInfo[$iI][4] = _WinAPI_WideCharToMultiByte(DllStructGetData($tCodec, "DllName"))
		$aInfo[$iI][5] = _WinAPI_WideCharToMultiByte(DllStructGetData($tCodec, "FormatDesc"))
		$aInfo[$iI][6] = _WinAPI_WideCharToMultiByte(DllStructGetData($tCodec, "FileExt"))
		$aInfo[$iI][7] = _WinAPI_WideCharToMultiByte(DllStructGetData($tCodec, "MimeType"))
		$aInfo[$iI][8] = DllStructGetData($tCodec, "Flags")
		$aInfo[$iI][9] = DllStructGetData($tCodec, "Version")
		$aInfo[$iI][10] = DllStructGetData($tCodec, "SigCount")
		$aInfo[$iI][11] = DllStructGetData($tCodec, "SigSize")
		$aInfo[$iI][12] = DllStructGetData($tCodec, "SigPattern")
		$aInfo[$iI][13] = DllStructGetData($tCodec, "SigMask")
		$pBuffer += DllStructGetSize($tCodec)
	Next
	Return $aInfo
EndFunc   ;==>_GDIPlus_Decoders

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_DecodersGetCount
; Description ...: Get the number of available image decoders
; Syntax.........: _GDIPlus_DecodersGetCount()
; Parameters ....:
; Return values .: Success      - Number of image decoders
;                  Failure      - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_DecodersGetSize
; Link ..........: @@MsdnLink@@ GdipGetImageDecodersSize
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_DecodersGetCount()
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetImageDecodersSize", "uint*", 0, "uint*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[1])
EndFunc   ;==>_GDIPlus_DecodersGetCount

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_DecodersGetSize
; Description ...: Get the total size of the structure that is returned by _GDIPlus_GetImageDecoders
; Syntax.........: _GDIPlus_DecodersGetSize()
; Parameters ....:
; Return values .: Success      - Total size, in bytes
;                  Failure      - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_DecodersGetCount
; Link ..........: @@MsdnLink@@ GdipGetImageDecodersSize
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_DecodersGetSize()
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetImageDecodersSize", "uint*", 0, "uint*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_DecodersGetSize

; #FUNCTION# =====================================================================
; Name...........: _GDIPlus_DrawImagePoints
; Description ...: Draws an image at a specified location.
; Syntax.........: _GDIPlus_DrawImagePoints($hGraphic, $hImage, $nULX, $nULY, $nURX, $nURY, $nLLX, $nLLY[, $count = 3])
; Parameters ....: $hGraphic    - Handle to a Graphics object
;                  $hImage      - Handle to an Image object
;                  $nULX        - The X coordinate of the upper left corner of the source image
;                  $nULY        - The Y coordinate of the upper left corner of the source image
;                  $nURX        - The X coordinate of the upper right corner of the source image
;                  $nURY        - The Y coordinate of the upper right corner of the source image
;                  $nLLX        - The X coordinate of the lower left corner of the source image
;                  $nLLY        - The Y coordinate of the lower left corner of the source image
;                  $count       - Specifies the number of points (x,y)'s in the structure.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Malkey
; Modified.......:
; Remarks .......: The value of the count parameter must equal 3 to specify the coordinates of
;                  the upper-left corner, upper-right corner, and lower-left corner of the
;                  parallelogram. The coordinate of the lower-right corner, the width, and the
;                  height of the image, are calculated using the three given coordinates.
;                  The image is scaled to fit the parallelogram.
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDrawImagePoints
; Example .......: Yes
; ===============================================================================
Func _GDIPlus_DrawImagePoints($hGraphic, $hImage, $nULX, $nULY, $nURX, $nURY, $nLLX, $nLLY, $count = 3)
	Local $tPoint = DllStructCreate("float X;float Y;float X2;float Y2;float X3;float Y3")
	DllStructSetData($tPoint, "X", $nULX)
	DllStructSetData($tPoint, "Y", $nULY)
	DllStructSetData($tPoint, "X2", $nURX)
	DllStructSetData($tPoint, "Y2", $nURY)
	DllStructSetData($tPoint, "X3", $nLLX)
	DllStructSetData($tPoint, "Y3", $nLLY)
	Local $pPoint = DllStructGetPtr($tPoint)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawImagePoints", "handle", $hGraphic, "handle", $hImage, "ptr", $pPoint, "int", $count)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_DrawImagePoints

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_Encoders
; Description ...: Get an array of information about the available image encoders
; Syntax.........: _GDIPlus_Encoders()
; Parameters ....:
; Return values .: Success      - Array with the following format:
;                  |[0][ 0] - Number of decoders
;                  |[1][ 1] - Codec identifier
;                  |[1][ 2] - File format identifier
;                  |[1][ 3] - Codec name
;                  |[1][ 4] - Dll in which the code resides
;                  |[1][ 5] - The name of the file format used by the codec
;                  |[1][ 6] - Filename extensions associated with the codec
;                  |[1][ 7] - The mime type of the codec
;                  |[1][ 8] - Combination of $GDIP_ICF flags
;                  |[1][ 9] - The version of the codec
;                  |[1][10] - The number of signatures used by the file format
;                  |[1][11] - The number of bytes in each signature
;                  |[1][12] - Pointer to the pattern for each signature
;                  |[1][13] - Pointer to the mask for each signature
;                  Failure     - @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_Decoders
; Link ..........: @@MsdnLink@@ GdipGetImageEncoders
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_Encoders()
	Local $iCount = _GDIPlus_EncodersGetCount()
	Local $iSize = _GDIPlus_EncodersGetSize()
	Local $tBuffer = DllStructCreate("byte[" & $iSize & "]")
	Local $pBuffer = DllStructGetPtr($tBuffer)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetImageEncoders", "uint", $iCount, "uint", $iSize, "ptr", $pBuffer)
	If @error Then Return SetError(@error, @extended, 0)
	If $aResult[0] <> 0 Then Return SetError($aResult[0], 0, 0)

	Local $tCodec, $aInfo[$iCount + 1][14]
	$aInfo[0][0] = $iCount
	For $iI = 1 To $iCount
		$tCodec = DllStructCreate($tagGDIPIMAGECODECINFO, $pBuffer)
		$aInfo[$iI][1] = _WinAPI_StringFromGUID(DllStructGetPtr($tCodec, "CLSID"))
		$aInfo[$iI][2] = _WinAPI_StringFromGUID(DllStructGetPtr($tCodec, "FormatID"))
		$aInfo[$iI][3] = _WinAPI_WideCharToMultiByte(DllStructGetData($tCodec, "CodecName"))
		$aInfo[$iI][4] = _WinAPI_WideCharToMultiByte(DllStructGetData($tCodec, "DllName"))
		$aInfo[$iI][5] = _WinAPI_WideCharToMultiByte(DllStructGetData($tCodec, "FormatDesc"))
		$aInfo[$iI][6] = _WinAPI_WideCharToMultiByte(DllStructGetData($tCodec, "FileExt"))
		$aInfo[$iI][7] = _WinAPI_WideCharToMultiByte(DllStructGetData($tCodec, "MimeType"))
		$aInfo[$iI][8] = DllStructGetData($tCodec, "Flags")
		$aInfo[$iI][9] = DllStructGetData($tCodec, "Version")
		$aInfo[$iI][10] = DllStructGetData($tCodec, "SigCount")
		$aInfo[$iI][11] = DllStructGetData($tCodec, "SigSize")
		$aInfo[$iI][12] = DllStructGetData($tCodec, "SigPattern")
		$aInfo[$iI][13] = DllStructGetData($tCodec, "SigMask")
		$pBuffer += DllStructGetSize($tCodec)
	Next
	Return $aInfo
EndFunc   ;==>_GDIPlus_Encoders

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_EncodersGetCLSID
; Description ...: Return the encoder CLSID for a specific image file type
; Syntax.........: _GDIPlus_EncodersGetCLSID($sFileExt)
; Parameters ....: $sFileExt    - File extension to search for (BMP, JPG, TIF, etc.)
; Return values .: Success      - CLSID of the encoder in string format
;                  Failure      - Blank string
; Author ........: Paul Campbell (PaulIA)
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipGetImageEncoders
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_EncodersGetCLSID($sFileExt)
	Local $aEncoders = _GDIPlus_Encoders()
	For $iI = 1 To $aEncoders[0][0]
		If StringInStr($aEncoders[$iI][6], "*." & $sFileExt) > 0 Then Return $aEncoders[$iI][1]
	Next
	Return SetError(-1, -1, "")
EndFunc   ;==>_GDIPlus_EncodersGetCLSID

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_EncodersGetCount
; Description ...: Get the number of available image encoders
; Syntax.........: _GDIPlus_EncodersGetCount()
; Parameters ....:
; Return values .: Success      - Number of image encoders
;                  Failure      - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_EncodersGetSize
; Link ..........: @@MsdnLink@@ GdipGetImageEncodersSize
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_EncodersGetCount()
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetImageEncodersSize", "uint*", 0, "uint*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[1])
EndFunc   ;==>_GDIPlus_EncodersGetCount

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_EncodersGetParamList
; Description ...: Get the parameter list for a specified image encoder
; Syntax.........: _GDIPlus_EncodersGetParamList($hImage, $sEncoder)
; Parameters ....: $hImage      - Handle to an image object
;                  $sEncoder    - GUID string of encoder to be used
; Return values .: Success      - $tagGDIPPENCODERPARAMS structure
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_EncodersGetParamListSize, $tagGDIPENCODERPARAMS
; Link ..........: @@MsdnLink@@ GdipGetEncoderParameterList
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_EncodersGetParamList($hImage, $sEncoder)
	Local $iSize = _GDIPlus_EncodersGetParamListSize($hImage, $sEncoder)
	If @error Then Return SetError(@error, -1, 0)
	Local $tGUID = _WinAPI_GUIDFromString($sEncoder)
	Local $pGUID = DllStructGetPtr($tGUID)
	Local $tBuffer = DllStructCreate("dword Count;byte Params[" & $iSize - 4 & "]")
	Local $pBuffer = DllStructGetPtr($tBuffer)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetEncoderParameterList", "handle", $hImage, "ptr", $pGUID, "uint", $iSize, "ptr", $pBuffer)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $tBuffer)
EndFunc   ;==>_GDIPlus_EncodersGetParamList

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_EncodersGetParamListSize
; Description ...: Get the size of the parameter list for a specified image encoder
; Syntax.........: _GDIPlus_EncodersGetParamListSize($hImage, $sEncoder)
; Parameters ....: $hImage      - Handle to an image object
;                  $sEncoder    - GUID string of encoder to be used
; Return values .: Success      - Size, in bytes, of the parameter list
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_EncodersGetParamList
; Link ..........: @@MsdnLink@@ GdipGetEncoderParameterListSize
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_EncodersGetParamListSize($hImage, $sEncoder)
	Local $tGUID = _WinAPI_GUIDFromString($sEncoder)
	Local $pGUID = DllStructGetPtr($tGUID)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetEncoderParameterListSize", "handle", $hImage, "ptr", $pGUID, "uint*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[3])
EndFunc   ;==>_GDIPlus_EncodersGetParamListSize

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_EncodersGetSize
; Description ...: Get the total size of the structure that is returned by _GDIPlus_GetImageEncoders
; Syntax.........: _GDIPlus_EncodersGetSize()
; Parameters ....:
; Return values .: Success      - Total size, in bytes
;                  Failure      - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_EncodersGetCount
; Link ..........: @@MsdnLink@@ GdipGetImageEncodersSize
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_EncodersGetSize()
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetImageEncodersSize", "uint*", 0, "uint*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_EncodersGetSize

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_FontCreate
; Description ...: Create a Font object
; Syntax.........: _GDIPlus_FontCreate($hFamily, $fSize[, $iStyle = 0[, $iUnit = 3]])
; Parameters ....: $hFamily     - Handle to a Font Family object
;                  $fSize       - The size of the font measured in the units specified in the $iUnit parameter
;                  $iStyle      - The style of the typeface. Can be a combination of the following:
;                  |0 - Normal weight or thickness of the typeface
;                  |1 - Bold typeface
;                  |2 - Italic typeface
;                  |4 - Underline
;                  |8 - Strikethrough
;                  $iUnit       - Unit of measurement for the font size:
;                  |0 - World coordinates, a nonphysical unit
;                  |1 - Display units
;                  |2 - A unit is 1 pixel
;                  |3 - A unit is 1 point or 1/72 inch
;                  |4 - A unit is 1 inch
;                  |5 - A unit is 1/300 inch
;                  |6 - A unit is 1 millimeter
; Return values .: Success      - Handle to a Font object
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the Font object, call _GDIPlus_FontDispose to release the resources
; Related .......: _GDIPlus_FontDispose
; Link ..........: @@MsdnLink@@ GdipCreateFont
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_FontCreate($hFamily, $fSize, $iStyle = 0, $iUnit = 3)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateFont", "handle", $hFamily, "float", $fSize, "int", $iStyle, "int", $iUnit, "ptr*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[5])
EndFunc   ;==>_GDIPlus_FontCreate

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_FontDispose
; Description ...: Release a Font object
; Syntax.........: _GDIPlus_FontDispose($hFont)
; Parameters ....: $hFont       - Handle to a Font object
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_FontCreate
; Link ..........: @@MsdnLink@@ GdipDeleteFont
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_FontDispose($hFont)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeleteFont", "handle", $hFont)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_FontDispose

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_FontFamilyCreate
; Description ...: Create a Font Family object
; Syntax.........: _GDIPlus_FontFamilyCreate($sFamily)
; Parameters ....: $sFamily     - Name of the Font Family
; Return values .: Success      - Handle to a Font Family object
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the Font Family object, call _GDIPlus_FontFamilyDispose to release the resources
; Related .......: _GDIPlus_FontFamilyDispose
; Link ..........: @@MsdnLink@@ GdipCreateFontFamilyFromName
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_FontFamilyCreate($sFamily)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateFontFamilyFromName", "wstr", $sFamily, "ptr", 0, "handle*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[3])
EndFunc   ;==>_GDIPlus_FontFamilyCreate

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_FontFamilyDispose
; Description ...: Release a Font Family object
; Syntax.........: _GDIPlus_FontFamilyDispose($hFamily)
; Parameters ....: $hFamily     - Handle to a Font Family object
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_FontFamilyCreate
; Link ..........: @@MsdnLink@@ GdipDeleteFontFamily
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_FontFamilyDispose($hFamily)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeleteFontFamily", "handle", $hFamily)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_FontFamilyDispose

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsClear
; Description ...: Clears a Graphics object to a specified color
; Syntax.........: _GDIPlus_GraphicsClear($hGraphics[, $iARGB = 0xFF000000])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $iARGB       - Alpha, Red, Green and Blue components of color
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipGraphicsClear
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsClear($hGraphics, $iARGB = 0xFF000000)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGraphicsClear", "handle", $hGraphics, "dword", $iARGB)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsClear

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsCreateFromHDC
; Description ...: Create a Graphics object from a device contect (DC)
; Syntax.........: _GDIPlus_GraphicsCreateFromHDC($hDC)
; Parameters ....: $hDC         - Device context
; Return values .: Success      - Handle to a Graphics object
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the Graphics object, call _GDIPlus_GraphicsDispose to release the resources
; Related .......: _GDIPlus_GraphicsDispose
; Link ..........: @@MsdnLink@@ GdipCreateFromHDC
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsCreateFromHDC($hDC)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateFromHDC", "handle", $hDC, "ptr*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_GraphicsCreateFromHDC

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsCreateFromHWND
; Description ...: Create a Graphics object from a window handle
; Syntax.........: _GDIPlus_GraphicsCreateFromHWND($hWnd)
; Parameters ....: $hWnd        - Handle to a window
; Return values .: Success      - Handle to a Graphics object
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the Graphics object, call _GDIPlus_GraphicsDispose to release the resources
; Related .......: _GDIPlus_GraphicsDispose
; Link ..........: @@MsdnLink@@ GdipCreateFromHWND
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsCreateFromHWND($hWnd)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateFromHWND", "hwnd", $hWnd, "ptr*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_GraphicsCreateFromHWND

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsDispose
; Description ...: Release a Graphics object
; Syntax.........: _GDIPlus_GraphicsDispose($hGraphics)
; Parameters ....: $hGraphics   - Handle to a Graphics object
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_GraphicsCreateFromHDC, _GDIPlus_GraphicsCreateFromHWND
; Link ..........: @@MsdnLink@@ GdipDeleteGraphics
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsDispose($hGraphics)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeleteGraphics", "handle", $hGraphics)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsDispose

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsDrawArc
; Description ...: Draw an arc
; Syntax.........: _GDIPlus_GraphicsDrawArc($hGraphics, $iX, $iY, $iWidth, $iHeight, $fStartAngle, $fSweepAngle[, $hPen = 0])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $iX          - The X coordinate of the upper left corner of the rectangle that bounds the ellipse in which  to
;                  +draw the arc
;                  $iY          - The Y coordinate of the upper left corner of the rectangle that bounds the ellipse in which  to
;                  +draw the arc
;                  $iWidth      - The width of the rectangle that bounds the ellipse in which to draw the arc
;                  $iHeight     - The height of the rectangle that bounds the ellipse in which to draw the arc
;                  $fStartAngle - The angle between the X axis and the starting point of the arc
;                  $fSweepAngle - The angle between the starting and ending points of the arc
;                  $hPen        - Handle to a pen object that is used to draw the arc.  If 0, a solid black pen with a width of 1
;                  +will be used.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDrawArcI
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsDrawArc($hGraphics, $iX, $iY, $iWidth, $iHeight, $fStartAngle, $fSweepAngle, $hPen = 0)
	__GDIPlus_PenDefCreate($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawArcI", "handle", $hGraphics, "handle", $hPen, "int", $iX, "int", $iY, _
			"int", $iWidth, "int", $iHeight, "float", $fStartAngle, "float", $fSweepAngle)
	Local $tmpError = @error, $tmpExtended = @extended
	__GDIPlus_PenDefDispose()
	If $tmpError Then Return SetError($tmpError, $tmpExtended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsDrawArc

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsDrawBezier
; Description ...: Draw a bezier spline
; Syntax.........: _GDIPlus_GraphicsDrawBezier($hGraphics, $iX1, $iY1, $iX2, $iY2, $iX3, $iY3, $iX4, $iY4[, $hPen = 0])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $hPen        - Handle to a pen object that is used to draw the arc
;                  $iX1         - X coordinate of the starting point
;                  $iY1         - Y coordinate of the starting point
;                  $iX2         - X coordinate of the first control point
;                  $iY2         - Y coordinate of the first control point
;                  $iX3         - X coordinate of the second control point
;                  $iY3         - Y coordinate of the second control point
;                  $iX4         - X coordinate of the ending point
;                  $iY4         - Y coordinate of the ending point
;                  $hPen        - Handle to a pen object that is used to draw the bezier. If 0, a solid black pen with a width of
;                  +1 will be used.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: A Bezier spline does not pass through its control points. The control points act as magnets, pulling the curve
;                  in certain directions to influence the way the spline bends.
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDrawBezierI
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsDrawBezier($hGraphics, $iX1, $iY1, $iX2, $iY2, $iX3, $iY3, $iX4, $iY4, $hPen = 0)
	__GDIPlus_PenDefCreate($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawBezierI", "handle", $hGraphics, "handle", $hPen, "int", $iX1, "int", $iY1, _
			"int", $iX2, "int", $iY2, "int", $iX3, "int", $iY3, "int", $iX4, "int", $iY4)
	Local $tmpError = @error, $tmpExtended = @extended
	__GDIPlus_PenDefDispose()
	If $tmpError Then Return SetError($tmpError, $tmpExtended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsDrawBezier

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsDrawClosedCurve
; Description ...: Draw a closed cardinal spline
; Syntax.........: _GDIPlus_GraphicsDrawClosedCurve($hGraphics, $aPoints[, $hPen = 0])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $aPoints     - Array that specifies the points of the curve:
;                  |[0][0] - Number of points
;                  |[1][0] - Point 1 X position
;                  |[1][1] - Point 1 Y position
;                  |[2][0] - Point 2 X position
;                  |[2][1] - Point 2 Y position
;                  |[n][0] - Point n X position
;                  |[n][1] - Point n Y position
;                  $hPen        - Handle to a pen object that is used to draw the spline. If 0, a solid black pen with a width of
;                  +1 will be used.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: In a closed cardinal spline, the curve continues through the last point in the points array and connects  with
;                  the first point in the array. The array of points must contain a minimum of three elements.
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDrawClosedCurveI
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsDrawClosedCurve($hGraphics, $aPoints, $hPen = 0)
	Local $iCount = $aPoints[0][0]
	Local $tPoints = DllStructCreate("long[" & $iCount * 2 & "]")
	Local $pPoints = DllStructGetPtr($tPoints)
	For $iI = 1 To $iCount
		DllStructSetData($tPoints, 1, $aPoints[$iI][0], (($iI - 1) * 2) + 1)
		DllStructSetData($tPoints, 1, $aPoints[$iI][1], (($iI - 1) * 2) + 2)
	Next

	__GDIPlus_PenDefCreate($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawClosedCurveI", "handle", $hGraphics, "handle", $hPen, "ptr", $pPoints, "int", $iCount)
	Local $tmpError = @error, $tmpExtended = @extended
	__GDIPlus_PenDefDispose()
	If $tmpError Then Return SetError($tmpError, $tmpExtended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsDrawClosedCurve

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsDrawCurve
; Description ...: Draw a cardinal spline
; Syntax.........: _GDIPlus_GraphicsDrawCurve($hGraphics, $aPoints[, $hPen = 0])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $aPoints     - Array that specifies the points of the curve:
;                  |[0][0] - Number of points
;                  |[1][0] - Point 1 X position
;                  |[1][1] - Point 1 Y position
;                  |[2][0] - Point 2 X position
;                  |[2][1] - Point 2 Y position
;                  |[n][0] - Point n X position
;                  |[n][1] - Point n Y position
;                  $hPen        - Handle to a pen object that is used to draw the spline. If 0, a solid black pen with a width of
;                  +1 will be used.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: A segment is defined as a curve that connects two consecutive points in the cardinal spline.  The ending point
;                  of each segment is the starting point for the next.
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDrawCurveI
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsDrawCurve($hGraphics, $aPoints, $hPen = 0)
	Local $iCount = $aPoints[0][0]
	Local $tPoints = DllStructCreate("long[" & $iCount * 2 & "]")
	Local $pPoints = DllStructGetPtr($tPoints)
	For $iI = 1 To $iCount
		DllStructSetData($tPoints, 1, $aPoints[$iI][0], (($iI - 1) * 2) + 1)
		DllStructSetData($tPoints, 1, $aPoints[$iI][1], (($iI - 1) * 2) + 2)
	Next

	__GDIPlus_PenDefCreate($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawCurveI", "handle", $hGraphics, "handle", $hPen, "ptr", $pPoints, "int", $iCount)
	Local $tmpError = @error, $tmpExtended = @extended
	__GDIPlus_PenDefDispose()
	If $tmpError Then Return SetError($tmpError, $tmpExtended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsDrawCurve

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsDrawEllipse
; Description ...: Draw an ellipse
; Syntax.........: _GDIPlus_GraphicsDrawEllipse($hGraphics, $iX, $iY, $iWidth, $iHeight[, $hPen = 0])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $iX          - The X coordinate of the upper left corner of the rectangle that bounds the ellipse
;                  $iY          - The Y coordinate of the upper left corner of the rectangle that bounds the ellipse
;                  $iWidth      - The width of the rectangle that bounds the ellipse
;                  $iHeight     - The height of the rectangle that bounds the ellipse
;                  $hPen        - Handle to a pen object that is used to draw the arc.  If 0, a solid black pen with a width of 1
;                  +will be used.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDrawEllipseI
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsDrawEllipse($hGraphics, $iX, $iY, $iWidth, $iHeight, $hPen = 0)
	__GDIPlus_PenDefCreate($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawEllipseI", "handle", $hGraphics, "handle", $hPen, "int", $iX, "int", $iY, _
			"int", $iWidth, "int", $iHeight)
	Local $tmpError = @error, $tmpExtended = @extended
	__GDIPlus_PenDefDispose()
	If $tmpError Then Return SetError($tmpError, $tmpExtended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsDrawEllipse

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsDrawImage
; Description ...: Draw an Image object
; Syntax.........: _GDIPlus_GraphicsDrawImage($hGraphics, $hImage, $iX, $iY)
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $hImage      - Handle to an Image object
;                  $iX          - The X coordinate of the upper left corner of the rendered image
;                  $iY          - The Y coordinate of the upper left corner of the rendered image
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDrawImageI
; Example .......: Yes
; ===============================================================================================================================
;~ Func _GDIPlus_GraphicsDrawImage($hGraphics, $hImage, $iX, $iY)
;~ 	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawImageI", "handle", $hGraphics, "handle", $hImage, "int", $iX, "int", $iY)
;~ 	If @error Then Return SetError(@error, @extended, False)
;~ 	Return $aResult[0] = 0
;~ EndFunc   ;==>_GDIPlus_GraphicsDrawImage

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsDrawImageRect
; Description ...: Draws an image at a specified location
; Syntax.........: _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, $iX, $iY, $iW, $iH )
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $hImage      - Handle to an Image object
;                  $iX          - The X coordinate of the upper left corner of the rendered image
;                  $iY          - The Y coordinate of the upper left corner of the rendered image
;                  $iW          - Specifies the width of the destination rectangle at which to draw the image
;                  $iH          - Specifies the height of the destination rectangle at which to draw the image
; Return values .: Success      - True
;                  Failure      - False
; Author ........: smashly
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDrawImageRectI
; Example .......: Yes
; ===============================================================================================================================
;~ Func _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, $iX, $iY, $iW, $iH)
;~ 	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawImageRectI", "handle", $hGraphics, "handle", $hImage, "int", $iX, "int", $iY, _
;~ 	"int", $iW, "int", $iH)
;~ 	If @error Then Return SetError(@error, @extended, False)
;~ 	Return $aResult[0] = 0
;~ EndFunc   ;==>_GDIPlus_GraphicsDrawImageRect

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsDrawImageRectRect
; Description ...: Draw an Image object
; Syntax.........: _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $hImage, $iSrcX, $iSrcY, $iSrcWidth, $iSrcHeight, $iDstX, $iDstY, $iDstWidth, $iDstHeight[, $iUnit = 2])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $hImage      - Handle to an Image object
;                  $iSrcX       - The X coordinate of the upper left corner of the source image
;                  $iSrcY       - The Y coordinate of the upper left corner of the source image
;                  $iSrcWidth   - Width of the source image
;                  $iSrcHeight  - Height of the source image
;                  $iDstX       - The X coordinate of the upper left corner of the destination image
;                  $iDstY       - The Y coordinate of the upper left corner of the destination image
;                  $iDstWidth   - Width of the destination image
;                  $iDstHeight  - Height of the destination image
;                  $iUnit       - Specifies the unit of measure for the image
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDrawImageRectRectI
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $hImage, $iSrcX, $iSrcY, $iSrcWidth, $iSrcHeight, $iDstX, $iDstY, $iDstWidth, $iDstHeight, $iUnit = 2)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawImageRectRectI", "handle", $hGraphics, "handle", $hImage, "int", $iDstX, _
			"int", $iDstY, "int", $iDstWidth, "int", $iDstHeight, "int", $iSrcX, "int", $iSrcY, "int", $iSrcWidth, _
			"int", $iSrcHeight, "int", $iUnit, "int", 0, "int", 0, "int", 0)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsDrawImageRectRect

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsDrawLine
; Description ...: Draw a line
; Syntax.........: _GDIPlus_GraphicsDrawLine($hGraphics, $iX1, $iY1, $iX2, $iY2[, $hPen = 0])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $iX1         - The X coordinate of the starting point of the line
;                  $iY1         - The Y coordinate of the starting point of the line
;                  $iX2         - The X coordinate of the ending point of the line
;                  $iY2         - The Y coordinate of the ending point of the line
;                  $hPen        - Handle to a pen object that is used to draw the arc.  If 0, a solid black pen with a width of 1
;                  +will be used.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDrawLineI
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsDrawLine($hGraphics, $iX1, $iY1, $iX2, $iY2, $hPen = 0)
	__GDIPlus_PenDefCreate($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawLineI", "handle", $hGraphics, "handle", $hPen, "int", $iX1, "int", $iY1, _
			"int", $iX2, "int", $iY2)
	Local $tmpError = @error, $tmpExtended = @extended
	__GDIPlus_PenDefDispose()
	If $tmpError Then Return SetError($tmpError, $tmpExtended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsDrawLine

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsDrawPie
; Description ...: Draw a pie
; Syntax.........: _GDIPlus_GraphicsDrawPie($hGraphics, $iX, $iY, $iWidth, $iHeight, $fStartAngle, $fSweepAngle[, $hPen = 0])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $iX          - The X coordinate of the upper left corner of the rectangle that bounds the ellipse in which  to
;                  +draw the pie
;                  $iY          - The Y coordinate of the upper left corner of the rectangle that bounds the ellipse in which  to
;                  +draw the pie
;                  $iWidth      - The width of the rectangle that bounds the ellipse in which to draw the pie
;                  $iHeight     - The height of the rectangle that bounds the ellipse in which to draw the pie
;                  $fStartAngle - The angle, in degrees, between the X axis and the starting point of the arc  that  defines  the
;                  +pie. A positive value specifies clockwise rotation.
;                  $fSweepAngle - The angle, in degrees, between the starting and ending points of the arc that defines the  pie.
;                  +A positive value specifies clockwise rotation.
;                  $hPen        - Handle to a pen object that is used to draw the arc.  If 0, a solid black pen with a width of 1
;                  +will be used.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDrawPieI
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsDrawPie($hGraphics, $iX, $iY, $iWidth, $iHeight, $fStartAngle, $fSweepAngle, $hPen = 0)
	__GDIPlus_PenDefCreate($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawPieI", "handle", $hGraphics, "handle", $hPen, "int", $iX, "int", $iY, _
			"int", $iWidth, "int", $iHeight, "float", $fStartAngle, "float", $fSweepAngle)
	Local $tmpError = @error, $tmpExtended = @extended
	__GDIPlus_PenDefDispose()
	If $tmpError Then Return SetError($tmpError, $tmpExtended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsDrawPie

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsDrawPolygon
; Description ...: Draw a polygon
; Syntax.........: _GDIPlus_GraphicsDrawPolygon($hGraphics, $aPoints[, $hPen = 0])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $aPoints     - Array that specify the vertices of the polygon:
;                  |[0][0] - Number of vertices
;                  |[1][0] - Vertice 1 X position
;                  |[1][1] - Vertice 1 Y position
;                  |[2][0] - Vertice 2 X position
;                  |[2][1] - Vertice 2 Y position
;                  |[n][0] - Vertice n X position
;                  |[n][1] - Vertice n Y position
;                  $hPen        - Handle to a pen object that is used to draw the polygon.  If 0, a solid black pen with a  width
;                  +of 1 will be used.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: If the first and last points are not identical, a line is drawn between them to close the polygon
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDrawPolygonI
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsDrawPolygon($hGraphics, $aPoints, $hPen = 0)
	Local $iCount = $aPoints[0][0]
	Local $tPoints = DllStructCreate("long[" & $iCount * 2 & "]")
	Local $pPoints = DllStructGetPtr($tPoints)
	For $iI = 1 To $iCount
		DllStructSetData($tPoints, 1, $aPoints[$iI][0], (($iI - 1) * 2) + 1)
		DllStructSetData($tPoints, 1, $aPoints[$iI][1], (($iI - 1) * 2) + 2)
	Next

	__GDIPlus_PenDefCreate($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawPolygonI", "handle", $hGraphics, "handle", $hPen, "ptr", $pPoints, "int", $iCount)
	Local $tmpError = @error, $tmpExtended = @extended
	__GDIPlus_PenDefDispose()
	If $tmpError Then Return SetError($tmpError, $tmpExtended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsDrawPolygon

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsDrawRect
; Description ...: Draw a rectangle
; Syntax.........: _GDIPlus_GraphicsDrawRect($hGraphics, $iX, $iY, $iWidth, $iHeight[, $hPen = 0])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $iX          - The X coordinate of the upper left corner of the rectangle
;                  $iY          - The Y coordinate of the upper left corner of the rectangle
;                  $iWidth      - The width of the rectangle
;                  $iHeight     - The height of the rectangle
;                  $hPen        - Handle to a pen object that is used to draw the rectangle. If 0, a solid black pen with a width
;                  +of 1 will be used
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDrawRectangleI
; Example .......: Yes
; ===============================================================================================================================
;~ Func _GDIPlus_GraphicsDrawRect($hGraphics, $iX, $iY, $iWidth, $iHeight, $hPen = 0)
;~ 	__GDIPlus_PenDefCreate($hPen)
;~ 	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawRectangleI", "handle", $hGraphics, "handle", $hPen, "int", $iX, "int", $iY, _
;~ 			"int", $iWidth, "int", $iHeight)
;~ 	Local $tmpError = @error, $tmpExtended = @extended
;~ 	__GDIPlus_PenDefDispose()
;~ 	If $tmpError Then Return SetError($tmpError, $tmpExtended, False)
;~ 	Return $aResult[0] = 0
;~ EndFunc   ;==>_GDIPlus_GraphicsDrawRect

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsDrawString
; Description ...: Draw a string
; Syntax.........: _GDIPlus_GraphicsDrawString($hGraphics, $sString, $nX, $nY[, $sFont = "Arial"[, $nSize = 10[, $iFormat = 0]]])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $sString     - String to be drawn
;                  $nX          - X coordinate where the string will be drawn
;                  $nY          - Y coordinate where the string will be drawn
;                  $sFont       - Name of the font to use for drawing
;                  $nSize       - Font size to use for drawing
;                  $iFormat     - Format flags. Can be one or more of the following:
;                  |0x0001 - Specifies that reading order is right to left
;                  |0x0002 - Specifies that individual lines of text are drawn vertically on the display device
;                  |0x0004 - Specifies that parts of characters are allowed to overhang the string's layout rectangle
;                  |0x0020 - Specifies that Unicode layout control characters are displayed with a representative character
;                  |0x0400 - Specifies that an alternate font is used for characters that are not supported in the requested font
;                  |0x0800 - Specifies that the space at the end of each line is included in a string measurement
;                  |0x1000 - Specifies that the wrapping of text to the next line is disabled
;                  |0x2000 - Specifies that only entire lines are laid out in the layout rectangle
;                  |0x4000 - Specifies that characters overhanging the layout rectangle and text  extending  outside  the  layout
;                  +rectangle are allowed to show
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......:
; Remarks .......:
; Related .......: _GDIPlus_GraphicsDrawStringEx
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsDrawString($hGraphics, $sString, $nX, $nY, $sFont = "Arial", $nSize = 10, $iFormat = 0)
	Local $hBrush = _GDIPlus_BrushCreateSolid()
	Local $hFormat = _GDIPlus_StringFormatCreate($iFormat)
	Local $hFamily = _GDIPlus_FontFamilyCreate($sFont)
	Local $hFont = _GDIPlus_FontCreate($hFamily, $nSize)
	Local $tLayout = _GDIPlus_RectFCreate($nX, $nY, 0, 0)
	Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, $sString, $hFont, $tLayout, $hFormat)
	Local $aResult = _GDIPlus_GraphicsDrawStringEx($hGraphics, $sString, $hFont, $aInfo[0], $hFormat, $hBrush)
	Local $iError = @error
	_GDIPlus_FontDispose($hFont)
	_GDIPlus_FontFamilyDispose($hFamily)
	_GDIPlus_StringFormatDispose($hFormat)
	_GDIPlus_BrushDispose($hBrush)
	Return SetError($iError, 0, $aResult)
EndFunc   ;==>_GDIPlus_GraphicsDrawString

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsDrawStringEx
; Description ...: Draw a string
; Syntax.........: _GDIPlus_GraphicsDrawStringEx($hGraphics, $sString, $hFont, $tLayout, $hFormat, $hBrush)
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $sString     - String to be drawn
;                  $hFont       - Handle to the font to use to draw the string
;                  $tLayout     - $tagGDIPRECTF structure that bounds the string
;                  $hFormat     - Handle to the string format to draw the string
;                  $hBrush      - Handle to the brush to draw the string
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_GraphicsDrawString, $tagGDIPRECTF
; Link ..........: @@MsdnLink@@ GdipDrawString
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsDrawStringEx($hGraphics, $sString, $hFont, $tLayout, $hFormat, $hBrush)
	Local $pLayout = DllStructGetPtr($tLayout)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawString", "handle", $hGraphics, "wstr", $sString, "int", -1, "handle", $hFont, _
			"ptr", $pLayout, "handle", $hFormat, "handle", $hBrush)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsDrawStringEx

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsFillClosedCurve
; Description ...: Fill a closed cardinal spline
; Syntax.........: _GDIPlus_GraphicsFillClosedCurve($hGraphics, $aPoints[, $hBrush = 0])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $aPoints     - Array that specifies the points of the curve:
;                  |[0][0] - Number of points
;                  |[1][0] - Point 1 X position
;                  |[1][1] - Point 1 Y position
;                  |[2][0] - Point 2 X position
;                  |[2][1] - Point 2 Y position
;                  |[n][0] - Point n X position
;                  |[n][1] - Point n Y position
;                  $hBrush      - Handle to a brush object that is used to fill the ellipse. If 0, a black brush will be used.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: In a closed cardinal spline, the curve continues through the last point in the points array and connects  with
;                  the first point in the array. The array of points must contain a minimum of three elements.
; Related .......:
; Link ..........: @@MsdnLink@@ GdipFillClosedCurveI
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsFillClosedCurve($hGraphics, $aPoints, $hBrush = 0)
	Local $iCount = $aPoints[0][0]
	Local $tPoints = DllStructCreate("long[" & $iCount * 2 & "]")
	Local $pPoints = DllStructGetPtr($tPoints)
	For $iI = 1 To $iCount
		DllStructSetData($tPoints, 1, $aPoints[$iI][0], (($iI - 1) * 2) + 1)
		DllStructSetData($tPoints, 1, $aPoints[$iI][1], (($iI - 1) * 2) + 2)
	Next

	__GDIPlus_BrushDefCreate($hBrush)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipFillClosedCurveI", "handle", $hGraphics, "handle", $hBrush, "ptr", $pPoints, "int", $iCount)
	Local $tmpError = @error, $tmpExtended = @extended
	__GDIPlus_BrushDefDispose()
	If $tmpError Then Return SetError($tmpError, $tmpExtended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsFillClosedCurve

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsFillEllipse
; Description ...: Fill an ellipse
; Syntax.........: _GDIPlus_GraphicsFillEllipse($hGraphics, $iX, $iY, $iWidth, $iHeight[, $hBrush = 0])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $iX          - The X coordinate of the upper left corner of the rectangle that bounds the ellipse
;                  $iY          - The Y coordinate of the upper left corner of the rectangle that bounds the ellipse
;                  $iWidth      - The width of the rectangle that bounds the ellipse
;                  $iHeight     - The height of the rectangle that bounds the ellipse
;                  $hBrush      - Handle to a brush object that is used to fill the ellipse. If 0, a black brush will be used.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipFillEllipseI
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsFillEllipse($hGraphics, $iX, $iY, $iWidth, $iHeight, $hBrush = 0)
	__GDIPlus_BrushDefCreate($hBrush)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipFillEllipseI", "handle", $hGraphics, "handle", $hBrush, "int", $iX, "int", $iY, _
			"int", $iWidth, "int", $iHeight)
	Local $tmpError = @error, $tmpExtended = @extended
	__GDIPlus_BrushDefDispose()
	If $tmpError Then Return SetError($tmpError, $tmpExtended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsFillEllipse

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsFillPie
; Description ...: Fill a pie
; Syntax.........: _GDIPlus_GraphicsFillPie($hGraphics, $iX, $iY, $iWidth, $iHeight, $fStartAngle, $fSweepAngle[, $hBrush = 0])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $iX          - The X coordinate of the upper left corner of the rectangle that bounds the ellipse in which  to
;                  +draw the pie
;                  $iY          - The Y coordinate of the upper left corner of the rectangle that bounds the ellipse in which  to
;                  +draw the pie
;                  $iWidth      - The width of the rectangle that bounds the ellipse in which to draw the pie
;                  $iHeight     - The height of the rectangle that bounds the ellipse in which to draw the pie
;                  $fStartAngle - The angle, in degrees, between the X axis and the starting point of the arc  that  defines  the
;                  +pie. A positive value specifies clockwise rotation.
;                  $fSweepAngle - The angle, in degrees, between the starting and ending points of the arc that defines the  pie.
;                  +A positive value specifies clockwise rotation.
;                  $hBrush      - Handle to a brush object that is used to fill the pie. If 0, a black brush will be used.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipFillPieI
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsFillPie($hGraphics, $iX, $iY, $iWidth, $iHeight, $fStartAngle, $fSweepAngle, $hBrush = 0)
	__GDIPlus_BrushDefCreate($hBrush)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipFillPieI", "handle", $hGraphics, "handle", $hBrush, "int", $iX, "int", $iY, _
			"int", $iWidth, "int", $iHeight, "float", $fStartAngle, "float", $fSweepAngle)
	Local $tmpError = @error, $tmpExtended = @extended
	__GDIPlus_BrushDefDispose()
	If $tmpError Then Return SetError($tmpError, $tmpExtended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsFillPie

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsFillPolygon
; Description ...: Fill a polygon
; Syntax.........: _GDIPlus_GraphicsFillPolygon($hGraphics, $aPoints[, $hBrush = 0])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $aPoints     - Array that specify the vertices of the polygon:
;                  |[0][0] - Number of vertices
;                  |[1][0] - Vertice 1 X position
;                  |[1][1] - Vertice 1 Y position
;                  |[2][0] - Vertice 2 X position
;                  |[2][1] - Vertice 2 Y position
;                  |[n][0] - Vertice n X position
;                  |[n][1] - Vertice n Y position
;                  $hBrush      - Handle to a brush object that is used to fill the polygon.
;                               - If $hBrush is 0, a solid black brush is used.
; Return values .: Success      - True
;                  Failure      - False
; Author ........:
; Modified.......: smashly
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipFillPolygonI
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsFillPolygon($hGraphics, $aPoints, $hBrush = 0)
	Local $iCount = $aPoints[0][0]
	Local $tPoints = DllStructCreate("long[" & $iCount * 2 & "]")
	Local $pPoints = DllStructGetPtr($tPoints)
	For $iI = 1 To $iCount
		DllStructSetData($tPoints, 1, $aPoints[$iI][0], (($iI - 1) * 2) + 1)
		DllStructSetData($tPoints, 1, $aPoints[$iI][1], (($iI - 1) * 2) + 2)
	Next

	__GDIPlus_BrushDefCreate($hBrush)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipFillPolygonI", "handle", $hGraphics, "handle", $hBrush, _
			"ptr", $pPoints, "int", $iCount, "int", "FillModeAlternate")
	Local $tmpError = @error, $tmpExtended = @extended
	__GDIPlus_BrushDefDispose()
	If $tmpError Then Return SetError($tmpError, $tmpExtended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsFillPolygon

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsFillRect
; Description ...: Fill a rectangle
; Syntax.........: _GDIPlus_GraphicsFillRect($hGraphics, $iX, $iY, $iWidth, $iHeight[, $hBrush = 0])
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $iX          - The X coordinate of the upper left corner of the rectangle
;                  $iY          - The Y coordinate of the upper left corner of the rectangle
;                  $iWidth      - The width of the rectangle
;                  $iHeight     - The height of the rectangle
;                  $hBrush      - Handle to a brush object that is used to fill the rectangle. If 0, a black brush will be used.
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipFillRectangleI
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsFillRect($hGraphics, $iX, $iY, $iWidth, $iHeight, $hBrush = 0)
	__GDIPlus_BrushDefCreate($hBrush)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipFillRectangleI", "handle", $hGraphics, "handle", $hBrush, "int", $iX, "int", $iY, _
			"int", $iWidth, "int", $iHeight)
	Local $tmpError = @error, $tmpExtended = @extended
	__GDIPlus_BrushDefDispose()
	If $tmpError Then Return SetError($tmpError, $tmpExtended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsFillRect

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsGetDC
; Description ...: Gets a handle to the device context of the Graphics object
; Syntax.........: _GDIPlus_GraphicsGetDC($hGraphics)
; Parameters ....: $hGraphics   - Handle to a Graphics object
; Return values .: Success      - DC of the Graphics object
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: Each call to the _GDIPlus_GraphicsGetDC should be paired with a call to the _GDIPlus_GraphicsReleaseDC.  Do not call
;                  any methods of the Graphics object between the calls.
; Related .......: _GDIPlus_GraphicsReleaseDC
; Link ..........: @@MsdnLink@@ GdipGetDC
; Example .......:
; ===============================================================================================================================
Func _GDIPlus_GraphicsGetDC($hGraphics)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetDC", "handle", $hGraphics, "ptr*", 0)
	If @error Then Return SetError(@error, @extended, False)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_GraphicsGetDC

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsGetSmoothingMode
; Description ...: Gets the graphics object rendering quality
; Syntax.........: _GDIPlus_GraphicsGetSmoothingMode($hGraphics)
; Parameters ....: $hGraphics   - Handle to a Graphics object
; Return values .: Success      - Smoothing mode. Can be one of the following:
;                  |0 - Smoothing is not applied
;                  |1 - Smoothing is applied using an 8 X 4 box filter
;                  |2 - Smoothing is applied using an 8 X 8 box filter
;                  Failure      - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_GraphicsSetSmoothingMode
; Link ..........: @@MsdnLink@@ GdipGetSmoothingMode
; Example .......:
; ===============================================================================================================================
Func _GDIPlus_GraphicsGetSmoothingMode($hGraphics)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetSmoothingMode", "handle", $hGraphics, "int*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Switch $aResult[2]
		Case 3
			Return SetExtended($aResult[0], 1)
		Case 7
			Return SetExtended($aResult[0], 2)
		Case Else
			Return SetExtended($aResult[0], 0)
	EndSwitch
EndFunc   ;==>_GDIPlus_GraphicsGetSmoothingMode

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsMeasureString
; Description ...: Measures the size of a string
; Syntax.........: _GDIPlus_GraphicsMeasureString($hGraphics, $sString, $hFont, $tLayout, $hFormat)
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $sString     - String to be drawn
;                  $hFont       - Handle to the font to use to draw the string
;                  $tLayout     - $tagGDIPRECTF structure that bounds the string
;                  $hFormat     - Handle to the string format to draw the string
; Return values .: Success      - Array with the following format
;                  |[0] - $tagGDIPRECTF structure that receives the rectangle that bounds the string
;                  |[1] - The number of characters that actually fit into the layout rectangle
;                  |[2] - The number of lines that fit into the layout rectangle
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: $tagGDIPRECTF
; Link ..........: @@MsdnLink@@ GdipMeasureString
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsMeasureString($hGraphics, $sString, $hFont, $tLayout, $hFormat)
	Local $pLayout = DllStructGetPtr($tLayout)
	Local $tRectF = DllStructCreate($tagGDIPRECTF)
	Local $pRectF = DllStructGetPtr($tRectF)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipMeasureString", "handle", $hGraphics, "wstr", $sString, "int", -1, "handle", $hFont, _
			"ptr", $pLayout, "handle", $hFormat, "ptr", $pRectF, "int*", 0, "int*", 0)
	If @error Then Return SetError(@error, @extended, 0)

	Local $aInfo[3]
	$aInfo[0] = $tRectF
	$aInfo[1] = $aResult[8]
	$aInfo[2] = $aResult[9]
	Return SetExtended($aResult[0], $aInfo)
EndFunc   ;==>_GDIPlus_GraphicsMeasureString

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsReleaseDC
; Description ...: Releases the device context of the Graphics object
; Syntax.........: _GDIPlus_GraphicsReleaseDC($hGraphics, $hDC)
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $hDC         - Handle to the Graphics device context
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_GraphicsGetDC
; Link ..........: @@MsdnLink@@ GdipReleaseDC
; Example .......:
; ===============================================================================================================================
Func _GDIPlus_GraphicsReleaseDC($hGraphics, $hDC)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipReleaseDC", "handle", $hGraphics, "handle", $hDC)
	If @error Then Return SetError(@error, @extended, False)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_GraphicsReleaseDC

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsSetTransform
; Description ...: Sets the world transformation for a graphics object
; Syntax.........: _GDIPlus_GraphicsSetTransform($hGraphics, $hMatrix)
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $hMatrix     - Handle to a Matrix object that specifies the world transformation
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipSetWorldTransform
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_GraphicsSetTransform($hGraphics, $hMatrix)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetWorldTransform", "handle", $hGraphics, "handle", $hMatrix)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsSetTransform

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_GraphicsSetSmoothingMode
; Description ...: Sets the graphics object rendering quality
; Syntax.........: _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $iSmooth)
; Parameters ....: $hGraphics   - Handle to a Graphics object
;                  $iSmooth     - Smoothing mode:
;                  |0 - Smoothing is not applied
;                  |1 - Smoothing is applied using an 8 X 4 box filter
;                  |2 - Smoothing is applied using an 8 X 8 box filter
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_GraphicsGetSmoothingMode
; Link ..........: @@MsdnLink@@ GdipSetSmoothingMode
; Example .......:
; ===============================================================================================================================
Func _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $iSmooth)
	If $iSmooth < 0 Or $iSmooth > 4 Then $iSmooth = 0
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetSmoothingMode", "handle", $hGraphics, "int", $iSmooth)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_GraphicsSetSmoothingMode

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ImageDispose
; Description ...: Release an image object
; Syntax.........: _GDIPlus_ImageDispose($hImage)
; Parameters ....: $hImage      - Handle to an image object
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipDisposeImage
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ImageDispose($hImage)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDisposeImage", "handle", $hImage)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_ImageDispose

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ImageGetFlags
; Description ...: Returns enumeration of pixel data attributes contained in an image
; Syntax.........: _GDIPlus_ImageGetFlags($hImage)
; Parameters ....: $hImage - Handle to an image object
; Return values .: Success - Array with the following format
;                  |[0] -  - Integer flag set of pixel data attributes
;                  |[1] -  - String of pixel data attributes separated by delimiter "|"
;                  Failure - Returns empty array and @error is set, @extended set to error location
;                  |0 - No error.
;                  |4 - Invalid image handle
; Author ........: rover
; Modified.......:
; Remarks .......: @error 4 relies on GDI+ UDF return of -1 or 0 instead of image handle for errors
;                  Use BitAND on returned integer flag set with GdipGetImageFlags constants
; Related .......: _GDIPlus_ImageGetPixelFormat
; Link ..........: @@MsdnLink@@ GdipGetImageFlags
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ImageGetFlags($hImage)
	Local $aFlag[2] = [0, ""]
	If ($hImage = -1) Or (Not $hImage) Then Return SetError(10, 1, $aFlag)
	Local $aImageFlags[13][2] = _
			[["Pixel data Cacheable", $GDIP_IMAGEFLAGS_CACHING], _
			["Pixel data read-only", $GDIP_IMAGEFLAGS_READONLY], _
			["Pixel size in image", $GDIP_IMAGEFLAGS_HASREALPIXELSIZE], _
			["DPI info in image", $GDIP_IMAGEFLAGS_HASREALDPI], _
			["YCCK color space", $GDIP_IMAGEFLAGS_COLORSPACE_YCCK], _
			["YCBCR color space", $GDIP_IMAGEFLAGS_COLORSPACE_YCBCR], _
			["Grayscale image", $GDIP_IMAGEFLAGS_COLORSPACE_GRAY], _
			["CMYK color space", $GDIP_IMAGEFLAGS_COLORSPACE_CMYK], _
			["RGB color space", $GDIP_IMAGEFLAGS_COLORSPACE_RGB], _
			["Partially scalable", $GDIP_IMAGEFLAGS_PARTIALLYSCALABLE], _
			["Alpha values other than 0 (transparent) and 255 (opaque)", $GDIP_IMAGEFLAGS_HASTRANSLUCENT], _
			["Alpha values", $GDIP_IMAGEFLAGS_HASALPHA], _
			["Scalable", $GDIP_IMAGEFLAGS_SCALABLE]]
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetImageFlags", "handle", $hImage, "long*", 0)
	If @error Then Return SetError(@error, 2, $aFlag)
	If $aResult[2] = $GDIP_IMAGEFLAGS_NONE Then
		$aFlag[1] = "No pixel data"
		Return SetError($aResult[0], 3, $aFlag)
	EndIf
	$aFlag[0] = $aResult[2]
	For $i = 0 To 12
		If BitAND($aResult[2], $aImageFlags[$i][1]) = $aImageFlags[$i][1] Then
			If StringLen($aFlag[1]) Then $aFlag[1] &= "|"
			$aResult[2] -= $aImageFlags[$i][1]
			$aFlag[1] &= $aImageFlags[$i][0]
		EndIf
	Next
	Return SetExtended($aResult[0], $aFlag)
EndFunc   ;==>_GDIPlus_ImageGetFlags

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ImageGetGraphicsContext
; Description ...: Get the graphics context of the image
; Syntax.........: _GDIPlus_ImageGetGraphicsContext($hImage)
; Parameters ....: $hImage      - Handle to an image object
; Return values .: Success      - Handle to a Graphics object
;                  Failure      - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipGetImageGraphicsContext
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ImageGetGraphicsContext($hImage)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetImageGraphicsContext", "handle", $hImage, "ptr*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_ImageGetGraphicsContext

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ImageGetHeight
; Description ...: Get the image height
; Syntax.........: _GDIPlus_ImageGetHeight($hImage)
; Parameters ....: $hImage      - Handle to an image object
; Return values .: Success      - Image height, in pixels
;                  Failure      - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_ImageGetWidth
; Link ..........: @@MsdnLink@@ GdipGetImageHeight
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ImageGetHeight($hImage)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetImageHeight", "handle", $hImage, "uint*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_ImageGetHeight

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ImageGetHorizontalResolution
; Description ...: Returns horizontal resolution in DPI (pixels per inch) of an image
; Syntax.........: _GDIPlus_ImageGetHorizontalResolution($hImage)
; Parameters ....: $hImage - Handle to an image object
; Return values .: Success - Integer of DPI (pixels per inch)
;                  Failure - Returns 0 and @error is set
;                  |0 - No error.
;                  |4 - Invalid image handle
; Author ........: rover
; Modified.......:
; Remarks .......: @error 4 relies on GDI+ UDF return of -1 or 0 instead of image handle for errors
; Related .......: _GDIPlus_ImageGetVerticalResolution
; Link ..........: @@MsdnLink@@ GdipGetImageHorizontalResolution
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ImageGetHorizontalResolution($hImage)
	If ($hImage = -1) Or (Not $hImage) Then Return SetError(10, 1, 0)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetImageHorizontalResolution", "handle", $hImage, "float*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], Round($aResult[2]))
EndFunc   ;==>_GDIPlus_ImageGetHorizontalResolution

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ImageGetPixelFormat
; Description ...: Returns pixel format of an image: Bits per pixel, Alpha channels, RGB, Grayscale, Indexed etc.
; Syntax.........: _GDIPlus_ImageGetPixelFormat($hImage)
; Parameters ....: $hImage - Handle to an image object
; Return values .: Success - Array with the following format
;                  |[0] -  - Integer of pixel format constant
;                  |[1] -  - String of pixel format
;                  Failure - Returns empty array and @error is set, @extended set to error location
;                  |0 - No error.
;                  |4 - Invalid image handle
; Author ........: rover
; Modified.......:
; Remarks .......: @error 4 relies on GDI+ UDF return of -1 or 0 instead of image handle for errors
; Related .......: _GDIPlus_ImageGetFlags, _GDIPlus_BitmapLockBits, _GDIPlus_BitmapCloneArea
; Link ..........: @@MsdnLink@@ GdipGetImagePixelFormat
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ImageGetPixelFormat($hImage)
	Local $aFormat[2] = [0, ""]
	If ($hImage = -1) Or (Not $hImage) Then Return SetError(10, 1, $aFormat)
	Local $aPixelFormat[14][2] = _
			[["1 Bpp Indexed", $GDIP_PXF01INDEXED], _
			["4 Bpp Indexed", $GDIP_PXF04INDEXED], _
			["8 Bpp Indexed", $GDIP_PXF08INDEXED], _
			["16 Bpp Grayscale", $GDIP_PXF16GRAYSCALE], _
			["16 Bpp RGB 555", $GDIP_PXF16RGB555], _
			["16 Bpp RGB 565", $GDIP_PXF16RGB565], _
			["16 Bpp ARGB 1555", $GDIP_PXF16ARGB1555], _
			["24 Bpp RGB", $GDIP_PXF24RGB], _
			["32 Bpp RGB", $GDIP_PXF32RGB], _
			["32 Bpp ARGB", $GDIP_PXF32ARGB], _
			["32 Bpp PARGB", $GDIP_PXF32PARGB], _
			["48 Bpp RGB", $GDIP_PXF48RGB], _
			["64 Bpp ARGB", $GDIP_PXF64ARGB], _
			["64 Bpp PARGB", $GDIP_PXF64PARGB]]
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetImagePixelFormat", "handle", $hImage, "int*", 0)
	If @error Then Return SetError(@error, @extended, $aFormat)
	For $i = 0 To 13
		If $aPixelFormat[$i][1] = $aResult[2] Then
			$aFormat[0] = $aPixelFormat[$i][1]
			$aFormat[1] = $aPixelFormat[$i][0]
			Return SetExtended($aResult[0], $aFormat)
		EndIf
	Next
	Return SetExtended($aResult[0], $aFormat)
EndFunc   ;==>_GDIPlus_ImageGetPixelFormat

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ImageGetRawFormat
; Description ...: Returns file format GUID and image format name of an image
; Syntax.........: _GDIPlus_ImageGetRawFormat($hImage)
; Parameters ....: $hImage - Handle to an image object
; Return values .: Success - Array with the following format
;                  |[0] -  - String of file format GUID
;                  |[1] -  - String of image format name
;                  Failure - Returns empty array and @error is set, @extended set to error location
;                  |0 - No error.
;                  |4 - Invalid image handle
; Author ........: rover
; Modified.......:
; Remarks .......: @error 4 relies on GDI+ UDF return of -1 or 0 instead of image handle for errors
; Related .......: _GDIPlus_ImageGetType
; Link ..........: @@MsdnLink@@ GdipGetImageRawFormat
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ImageGetRawFormat($hImage)
	Local $aGuid[2]
	If ($hImage = -1) Or (Not $hImage) Then Return SetError(10, 1, $aGuid)
	Local $aImageType[11][2] = _
			[["UNDEFINED", $GDIP_IMAGEFORMAT_UNDEFINED], _
			["MEMORYBMP", $GDIP_IMAGEFORMAT_MEMORYBMP], _
			["BMP", $GDIP_IMAGEFORMAT_BMP], _
			["EMF", $GDIP_IMAGEFORMAT_EMF], _
			["WMF", $GDIP_IMAGEFORMAT_WMF], _
			["JPEG", $GDIP_IMAGEFORMAT_JPEG], _
			["PNG", $GDIP_IMAGEFORMAT_PNG], _
			["GIF", $GDIP_IMAGEFORMAT_GIF], _
			["TIFF", $GDIP_IMAGEFORMAT_TIFF], _
			["EXIF", $GDIP_IMAGEFORMAT_EXIF], _
			["ICON", $GDIP_IMAGEFORMAT_ICON]]
	Local $tStruc = DllStructCreate("byte[16]")
	Local $aResult1 = DllCall($ghGDIPDll, "int", "GdipGetImageRawFormat", "handle", $hImage, "ptr", DllStructGetPtr($tStruc))
	If @error  Then Return SetError(@error, @extended, $aGuid)
	If (Not IsArray($aResult1)) Or (Not IsPtr($aResult1[2])) Or _
			(Not $aResult1[2]) Then Return SetError(1, 3, $aGuid)
	Local $sResult2 = _WinAPI_StringFromGUID($aResult1[2])
	If @error Then Return SetError(@error, 4, $aGuid)
	For $i = 0 To 10
		If $aImageType[$i][1] == $sResult2 Then
			$aGuid[0] = $aImageType[$i][1]
			$aGuid[1] = $aImageType[$i][0]
			Return SetExtended($aResult1[0], $aGuid)
		EndIf
	Next
	Return SetError(-1, 5, $aGuid)
EndFunc   ;==>_GDIPlus_ImageGetRawFormat

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ImageGetType
; Description ...: Returns type (bitmap or metafile) of an image
; Syntax.........: _GDIPlus_ImageGetType($hImage)
; Parameters ....: $hImage - Handle to an image object
; Return values .: Success - Integer of image type
;                  |$GDIP_IMAGETYPE_UNKNOWN  - Non bitmap file or not identified as bitmap by GDI+
;                  |$GDIP_IMAGETYPE_BITMAP   - Bitmap types: BMP, PNG, GIF, JPEG, TIFF, ICO, EXIF
;                  |$GDIP_IMAGETYPE_METAFILE - Metafile types: EMF, WMF
;                  Failure - Returns -1 and @error is set
;                  |0 - No error.
;                  |4 - Invalid image handle
; Author ........: rover
; Modified.......:
; Remarks .......: @error 4 relies on GDI+ UDF return of -1 or 0 instead of image handle for errors
; Related .......: _GDIPlus_ImageGetRawFormat
; Link ..........: @@MsdnLink@@ GdipGetImageType
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ImageGetType($hImage)
	If ($hImage = -1) Or (Not $hImage) Then Return SetError(10, 0, -1)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetImageType", "handle", $hImage, "int*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_ImageGetType

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ImageGetVerticalResolution
; Description ...: Returns horizontal resolution in DPI (pixels per inch) of an image
; Syntax.........: _GDIPlus_ImageGetVerticalResolution($hImage)
; Parameters ....: $hImage - Handle to an image object
; Return values .: Success - Integer of DPI (pixels per inch)
;                  Failure - Returns 0 and @error is set
;                  |0 - No error.
;                  |4 - Invalid image handle
; Author ........: rover
; Modified.......:
; Remarks .......: @error 4 relies on GDI+ UDF return of -1 or 0 instead of image handle for errors
; Related .......: _GDIPlus_ImageGetHorizontalResolution
; Link ..........: @@MsdnLink@@ GdipGetImageVerticalResolution
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ImageGetVerticalResolution($hImage)
	If ($hImage = -1) Or (Not $hImage) Then Return SetError(10, 0, 0)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetImageVerticalResolution", "handle", $hImage, "float*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], Round($aResult[2]))
EndFunc   ;==>_GDIPlus_ImageGetVerticalResolution

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ImageGetWidth
; Description ...: Get the image width
; Syntax.........: _GDIPlus_ImageGetWidth($hImage)
; Parameters ....: $hImage      - Handle to an image object
; Return values .: Success      - Image width, in pixels
;                  Failure      - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_ImageGetHeight
; Link ..........: @@MsdnLink@@ GdipGetImageWidth
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ImageGetWidth($hImage)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetImageWidth", "handle", $hImage, "uint*", -1)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_ImageGetWidth

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ImageLoadFromFile
; Description ...: Create an image object based on a file
; Syntax.........: _GDIPlus_ImageLoadFromFile($sFileName)
; Parameters ....: $sFileName   - Fully qualified image file name
; Return values .: Success      - Handle to the new image object
;                  Failure      - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost/martin
; Remarks .......:
; Related .......: _GDIPlus_ImageSaveToFile, _GDIPlus_ImageSaveToFileEx
; Link ..........: @@MsdnLink@@ GdipLoadImageFromFile
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ImageLoadFromFile($sFileName)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipLoadImageFromFile", "wstr", $sFileName, "ptr*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_ImageLoadFromFile

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ImageSaveToFile
; Description ...: Save an image to file
; Syntax.........: _GDIPlus_ImageSaveToFile($hImage, $sFileName)
; Parameters ....: $hImage      - Handle to an image object
;                  $sFileName   - Fully qualified image file name
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_ImageLoadFromFile, _GDIPlus_ImageSaveToFileEx
; Link ..........: @@MsdnLink@@ GdipSaveImageToFile
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ImageSaveToFile($hImage, $sFileName)
	Local $sExt = __GDIPlus_ExtractFileExt($sFileName)
	Local $sCLSID = _GDIPlus_EncodersGetCLSID($sExt)
	If $sCLSID = "" Then Return SetError(-1, 0, False)
	Return _GDIPlus_ImageSaveToFileEx($hImage, $sFileName, $sCLSID, 0)
EndFunc   ;==>_GDIPlus_ImageSaveToFile

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ImageSaveToFileEx
; Description ...: Save an image to file
; Syntax.........: _GDIPlus_ImageSaveToFileEx($hImage, $sFileName, $sEncoder[, $pParams = 0])
; Parameters ....: $hImage      - Handle to an image object
;                  $sFileName   - Fully qualified image file name
;                  $sEncoder    - GUID string of encoder to be used
;                  $pParams     - Pointer to a $tagGDIPPENCODERPARAMS structure
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_ImageLoadFromFile, _GDIPlus_ImageSaveToFile, $tagGDIPPENCODERPARAMS
; Link ..........: @@MsdnLink@@ GdipSaveImageToFile
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ImageSaveToFileEx($hImage, $sFileName, $sEncoder, $pParams = 0)
	Local $tGUID = _WinAPI_GUIDFromString($sEncoder)
	Local $pGUID = DllStructGetPtr($tGUID)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSaveImageToFile", "handle", $hImage, "wstr", $sFileName, "ptr", $pGUID, "ptr", $pParams)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_ImageSaveToFileEx

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_MatrixCreate
; Description ...: Creates and initializes a Matrix object that represents the identity matrix
; Syntax.........: _GDIPlus_MatrixCreate()
; Parameters ....:
; Return values .: Success      - Handle to a Matrix object
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the matrix, call _GDIPlus_MatrixDispose to release the resources
; Related .......: _GDIPlus_MatrixDispose
; Link ..........: @@MsdnLink@@ GdipCreateMatrix
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_MatrixCreate()
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateMatrix", "ptr*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[1])
EndFunc   ;==>_GDIPlus_MatrixCreate

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_MatrixDispose
; Description ...: Release a matrix object
; Syntax.........: _GDIPlus_MatrixDispose($hMatrix)
; Parameters ....: $hMatrix     - Handle to a Matrix object
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_MatrixCreate
; Link ..........: @@MsdnLink@@ GdipDeleteMatrix
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_MatrixDispose($hMatrix)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeleteMatrix", "handle", $hMatrix)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_MatrixDispose

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_MatrixRotate
; Description ...: Updates a matrix with the product of itself and a rotation matrix
; Syntax.........: _GDIPlus_MatrixRotate($hMatrix, $fAngle[, $bAppend = False])
; Parameters ....: $hMatrix     - Handle to a Matrix object
;                  $fAngle      - The angle of rotation in degrees. Positive values specify clockwise rotation.
;                  $bAppend     - Specifies the order of the multiplication:
;                  |True  - Specifies that the rotation matrix is on the left
;                  |False - Specifies that the rotation matrix is on the right
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipRotateMatrix
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_MatrixRotate($hMatrix, $fAngle, $bAppend = False)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipRotateMatrix", "handle", $hMatrix, "float", $fAngle, "int", $bAppend)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_MatrixRotate

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_MatrixScale
; Description ...: Updates a matrix with the product of itself and a scaling matrix
; Syntax.........: _GDIPlus_MatrixScale($hMatrix, $fScaleX, $fScaleY[, $bOrder = False])
; Parameters ....: $hMatrix     - Handle to a Matrix object
;                  $fScaleX     - Multiplyier to scale the x-axis
;                  $fScaleY     - Multiplyier to scale the y-axis
;                  $bOrder      - Specifies the order of the multiplication:
;                  |True  - Specifies that the scaling matrix is on the left
;                  |False - Specifies that the scaling matrix is on the right
; Return values .: Success      - True
;                  Failure      - False
; Author ........: monoceres
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipScaleMatrix
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_MatrixScale($hMatrix, $fScaleX, $fScaleY, $bOrder = False)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipScaleMatrix", "handle", $hMatrix, "float", $fScaleX, "float", $fScaleY, "int", $bOrder)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_MatrixScale

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_MatrixTranslate
; Description ...: Updates a matrix with the product of itself and a translation matrix
; Syntax.........: _GDIPlus_MatrixTranslate($hMatrix, $fOffsetX, $fOffsetY[, $bAppend = False])
; Parameters ....: $hMatrix     - Handle to a Matrix object
;                  $fOffsetX    - Amount of pixels to add along the x-axis
;                  $fOffsetY    - Amount of pixels to add along the y-axis
;                  $bAppend     - Specifies the order of the multiplication:
;                  |True  - Specifies that the translation matrix is on the left
;                  |False - Specifies that the translation matrix is on the right
; Return values .: Success      - True
;                  Failure      - False
; Author ........: monoceres
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........: @@MsdnLink@@ GdipTranslateMatrix
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_MatrixTranslate($hMatrix, $fOffsetX, $fOffsetY, $bAppend = False)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipTranslateMatrix", "handle", $hMatrix, "float", $fOffsetX, "float", $fOffsetY, "int", $bAppend)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_MatrixTranslate

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ParamAdd
; Description ...: Add a value to an encoder parameter list
; Syntax.........: _GDIPlus_ParamAdd(ByRef $tParams, $sGUID, $iCount, $iType, $pValues)
; Parameters ....: $tParams     - $tagGDIPPENCODERPARAMS structure returned from _GDIPlus_ParamInit
;                  $sGUID       - Encoder parameter GUID. Can be one of the following:
;                  |$GDIP_EPGCHROMINANCETABLE - Chrominance table settings
;                  |$GDIP_EPGCOLORDEPTH       - Color depth settings
;                  |$GDIP_EPGCOMPRESSION      - Compression settings
;                  |$GDIP_EPGLUMINANCETABLE   - Luminance table settings
;                  |$GDIP_EPGQUALITY          - Quality settings
;                  |$GDIP_EPGRENDERMETHOD     - Render method settings
;                  |$GDIP_EPGSAVEFLAG         - Save flag settings
;                  |$GDIP_EPGSCANMETHOD       - Scan mode settings
;                  |$GDIP_EPGTRANSFORMATION   - Transformation settings
;                  |$GDIP_EPGVERSION          - Software version settings
;                  $iCount      - Number of elements in the $pValues array
;                  $iType       - Encoder parameter value type. Can be one of the following:
;                  |$GDIP_EPTBYTE          - 8 bit unsigned integer
;                  |$GDIP_EPTASCII         - Null terminated character string
;                  |$GDIP_EPTSHORT         - 16 bit unsigned integer
;                  |$GDIP_EPTLONG          - 32 bit unsigned integer
;                  |$GDIP_EPTRATIONAL      - Two longs (numerator, denomintor)
;                  |$GDIP_EPTLONGRANGE     - Two longs (low, high)
;                  |$GDIP_EPTUNDEFINED     - Array of bytes of any type
;                  |$GDIP_EPTRATIONALRANGE - Two ratationals (low, high)
;                  $pValues     - Pointer to an array of values. Each value has the type specified by the $iType data member.
; Return values .:
; Author ........: Paul Campbell (PaulIA)
; Modified.......:
; Remarks .......:
; Related .......: _GDIPlus_ParamInit, $tagGDIPPENCODERPARAMS
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ParamAdd(ByRef $tParams, $sGUID, $iCount, $iType, $pValues)
	Local $tParam = DllStructCreate($tagGDIPENCODERPARAM, DllStructGetPtr($tParams, "Params") + (DllStructGetData($tParams, "Count") * 28))
	_WinAPI_GUIDFromStringEx($sGUID, DllStructGetPtr($tParam, "GUID"))
	DllStructSetData($tParam, "Type", $iType)
	DllStructSetData($tParam, "Count", $iCount)
	DllStructSetData($tParam, "Values", $pValues)
	DllStructSetData($tParams, "Count", DllStructGetData($tParams, "Count") + 1)
EndFunc   ;==>_GDIPlus_ParamAdd

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_ParamInit
; Description ...: Initialize an encoder parameter list
; Syntax.........: _GDIPlus_ParamInit($iCount)
; Parameters ....: $iCount      - The total number of parameters that the list will contain
; Return values .: Success      - $tagGDIPPENCODERPARAMS structure
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......:
; Remarks .......: In order to pass parameters to any of the encoder functions, you must use  an  encoder  parameter  list.  This
;                  function is used to initialize an encoder parameter list that can then be passed to _GDIPlus_Param add to add the
;                  actual parameters.
; Related .......: _GDIPlus_ParamAdd, $tagGDIPPENCODERPARAMS
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_ParamInit($iCount)
	If $iCount <= 0 Then Return SetError(-1, -1, 0)
	Return DllStructCreate("dword Count;byte Params[" & $iCount * 28 & "]")
EndFunc   ;==>_GDIPlus_ParamInit

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenCreate
; Description ...: Create a pen object
; Syntax.........: _GDIPlus_PenCreate([$iARGB = 0xFF000000[, $nWidth = 1[, $iUnit = 2]]])
; Parameters ....: $iARGB       - Alpha, Red, Green and Blue components of pen color
;                  $nWidth      - The width of the pen measured in the units specified in the $iUnit parameter
;                  $iUnit       - Unit of measurement for the pen size:
;                  |0 - World coordinates, a nonphysical unit
;                  |1 - Display units
;                  |2 - A unit is 1 pixel
;                  |3 - A unit is 1 point or 1/72 inch
;                  |4 - A unit is 1 inch
;                  |5 - A unit is 1/300 inch
;                  |6 - A unit is 1 millimeter
; Return values .: Success      - Handle to a pen object
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the pen, call _GDIPlus_PenDispose to release the resources
; Related .......: _GDIPlus_PenDispose
; Link ..........: @@MsdnLink@@ GdipCreatePen1
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_PenCreate($iARGB = 0xFF000000, $fWidth = 1, $iUnit = 2)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreatePen1", "dword", $iARGB, "float", $fWidth, "int", $iUnit, "ptr*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[4])
EndFunc   ;==>_GDIPlus_PenCreate

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenDispose
; Description ...: Release a pen object
; Syntax.........: _GDIPlus_PenDispose($hPen)
; Parameters ....: $hPen        - Handle to a pen object
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_PenCreate
; Link ..........: @@MsdnLink@@ GdipDeletePen
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_PenDispose($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeletePen", "handle", $hPen)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_PenDispose

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenGetAlignment
; Description ...: Gets the pen alignment
; Syntax.........: _GDIPlus_PenGetAlignment($hPen)
; Parameters ....: $hPen        - Handle to a pen object
; Return values .: Success      - Alignment type:
;                  |0 - Specifies that the pen is aligned on the center of the line that is drawn
;                  |1 - Specifies, when drawing a polygon, that the pen is aligned on the inside of the edge of the polygon
;                  Failure      - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_PenSetAlignment
; Link ..........: @@MsdnLink@@ GdipGetPenMode
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_PenGetAlignment($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetPenMode", "handle", $hPen, "int*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_PenGetAlignment

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenGetColor
; Description ...: Gets the pen color
; Syntax.........: _GDIPlus_PenGetColor($hPen)
; Parameters ....: $hPen        - Handle to a pen object
; Return values .: Success      - Pen color
;                  Failure      - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_PenSetColor
; Link ..........: @@MsdnLink@@ GdipGetPenColor
; Example .......:
; ===============================================================================================================================
Func _GDIPlus_PenGetColor($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetPenColor", "handle", $hPen, "dword*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_PenGetColor

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenGetCustomEndCap
; Description ...: Gets the custom end cap for the pen
; Syntax.........: _GDIPlus_PenGetCustomEndCap($hPen)
; Parameters ....: $hPen        - Handle to a pen object
; Return values .: Success      - Handle to a CustomLineCap object that specifies the pen custom end cap
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_PenSetCustomEndCap
; Link ..........: @@MsdnLink@@ GdipGetPenCustomEndCap
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_PenGetCustomEndCap($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetPenCustomEndCap", "handle", $hPen, "ptr*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_PenGetCustomEndCap

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenGetDashCap
; Description ...: Gets the pen dash cap style
; Syntax.........: _GDIPlus_PenGetDashCap($hPen)
; Parameters ....: $hPen        - Handle to a pen object
; Return values .: Success      - Dash cap style:
;                  |$GDIP_DASHCAPFLAT     - A square cap that squares off both ends of each dash
;                  |$GDIP_DASHCAPROUND    - A circular cap that rounds off both ends of each dash
;                  |$GDIP_DASHCAPTRIANGLE - A triangular cap that points both ends of each dash
;                  Failure      - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_PenSetDashCap
; Link ..........: @@MsdnLink@@ GdipGetPenDashCap197819
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_PenGetDashCap($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetPenDashCap197819", "handle", $hPen, "int*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_PenGetDashCap

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenGetDashStyle
; Description ...: Gets the pen dash style
; Syntax.........: _GDIPlus_PenGetDashStyle($hPen)
; Parameters ....: $hPen        - Handle to a pen object
; Return values .: Success      - Dash style:
;                  |$GDIP_DASHSTYLESOLID      - A solid line
;                  |$GDIP_DASHSTYLEDASH       - A dashed line
;                  |$GDIP_DASHSTYLEDOT        - A dotted line
;                  |$GDIP_DASHSTYLEDASHDOT    - An alternating dash-dot line
;                  |$GDIP_DASHSTYLEDASHDOTDOT - An alternating dash-dot-dot line
;                  |$GDIP_DASHSTYLECUSTOM     - A a user-defined, custom dashed line
;                  Failure      - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_PenSetDashStyle
; Link ..........: @@MsdnLink@@ GdipGetPenDashStyle
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_PenGetDashStyle($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetPenDashStyle", "handle", $hPen, "int*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_PenGetDashStyle

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenGetEndCap
; Description ...: Gets the pen end cap
; Syntax.........: _GDIPlus_PenGetEndCap($hPen)
; Parameters ....: $hPen        - Handle to a pen object
; Return values .: Success      - End cap type:
;                  |$GDIP_LINECAPFLAT          - Specifies a flat cap
;                  |$GDIP_LINECAPSQUARE        - Specifies a square cap
;                  |$GDIP_LINECAPROUND         - Specifies a circular cap
;                  |$GDIP_LINECAPTRIANGLE      - Specifies a triangular cap
;                  |$GDIP_LINECAPNOANCHOR      - Specifies that the line ends are not anchored
;                  |$GDIP_LINECAPSQUAREANCHOR  - Specifies that the line ends are anchored with a square
;                  |$GDIP_LINECAPROUNDANCHOR   - Specifies that the line ends are anchored with a circle
;                  |$GDIP_LINECAPDIAMONDANCHOR - Specifies that the line ends are anchored with a diamond
;                  |$GDIP_LINECAPARROWANCHOR   - Specifies that the line ends are anchored with arrowheads
;                  |$GDIP_LINECAPCUSTOM        - Specifies that the line ends are made from a CustomLineCap
;                  Failure      - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_PenSetEndCap
; Link ..........: @@MsdnLink@@ GdipGetPenEndCap
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_PenGetEndCap($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetPenEndCap", "handle", $hPen, "int*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_PenGetEndCap

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenGetWidth
; Description ...: Retrieve the width of a pen
; Syntax.........: _GDIPlus_PenGetWidth($hPen)
; Parameters ....: $hPen        - Handle to a pen object
; Return values .: Success      - Width of pen
;                  Failure      - -1 and @error is set
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_PenSetWidth
; Link ..........: @@MsdnLink@@ GdipGetPenWidth
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_PenGetWidth($hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipGetPenWidth", "handle", $hPen, "float*", 0)
	If @error Then Return SetError(@error, @extended, -1)
	Return SetExtended($aResult[0], $aResult[2])
EndFunc   ;==>_GDIPlus_PenGetWidth

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenSetAlignment
; Description ...: Sets the pen alignment
; Syntax.........: _GDIPlus_PenSetAlignment($hPen[, $iAlignment = 0])
; Parameters ....: $hPen        - Handle to a pen object
;                  $iAlignment  - Pen alignment. Can be one of the following:
;                  |0 - Specifies that the pen is aligned on the center of the line that is drawn
;                  |1 - Specifies, when drawing a polygon, that the pen is aligned on the inside of the edge of the polygon
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_PenGetAlignment
; Link ..........: @@MsdnLink@@ GdipSetPenMode
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_PenSetAlignment($hPen, $iAlignment = 0)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetPenMode", "handle", $hPen, "int", $iAlignment)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_PenSetAlignment

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenSetColor
; Description ...: Sets the pen color
; Syntax.........: _GDIPlus_PenSetColor($hPen, $iARGB)
; Parameters ....: $hPen        - Handle to a pen object
;                  $iARGB       - Alpha, Red, Green and Blue components of pen color
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_PenGetColor
; Link ..........: @@MsdnLink@@ GdipSetPenColor
; Example .......:
; ===============================================================================================================================
Func _GDIPlus_PenSetColor($hPen, $iARGB)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetPenColor", "handle", $hPen, "dword", $iARGB)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_PenSetColor

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenSetDashCap
; Description ...: Sets the pen dash cap style
; Syntax.........: _GDIPlus_PenSetDashCap($hPen[, $iDash = 0])
; Parameters ....: $hPen        - Handle to a pen object
;                  $iDash       - Dash cap style. Can be one of the following:
;                  |$GDIP_DASHCAPFLAT     - A square cap that squares off both ends of each dash
;                  |$GDIP_DASHCAPROUND    - A circular cap that rounds off both ends of each dash
;                  |$GDIP_DASHCAPTRIANGLE - A triangular cap that points both ends of each dash
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_PenGetDashCap
; Link ..........: @@MsdnLink@@ GdipSetPenDashCap197819
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_PenSetDashCap($hPen, $iDash = 0)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetPenDashCap197819", "handle", $hPen, "int", $iDash)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_PenSetDashCap

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenSetCustomEndCap
; Description ...: Sets the custom end cap for the pen
; Syntax.........: _GDIPlus_PenSetCustomEndCap($hPen, $hEndCap)
; Parameters ....: $hPen        - Handle to a pen object
;                  $hEndCap     - Handle to a CustomLineCap object that specifies the pen custom end cap
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_PenGetCustomEndCap
; Link ..........: @@MsdnLink@@ GdipSetPenCustomEndCap
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_PenSetCustomEndCap($hPen, $hEndCap)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetPenCustomEndCap", "handle", $hPen, "handle", $hEndCap)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_PenSetCustomEndCap

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenSetDashStyle
; Description ...: Sets the pen dash style
; Syntax.........: _GDIPlus_PenSetDashStyle($hPen[, $iStyle = 0])
; Parameters ....: $hPen        - Handle to a pen object
;                  $iStyle      - Dash style. Can be one of the following:
;                  |$GDIP_DASHSTYLESOLID      - A solid line
;                  |$GDIP_DASHSTYLEDASH       - A dashed line
;                  |$GDIP_DASHSTYLEDOT        - A dotted line
;                  |$GDIP_DASHSTYLEDASHDOT    - An alternating dash-dot line
;                  |$GDIP_DASHSTYLEDASHDOTDOT - An alternating dash-dot-dot line
;                  |$GDIP_DASHSTYLECUSTOM     - A a user-defined, custom dashed line
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_PenGetDashStyle
; Link ..........: @@MsdnLink@@ GdipSetPenDashStyle
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_PenSetDashStyle($hPen, $iStyle = 0)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetPenDashStyle", "handle", $hPen, "int", $iStyle)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_PenSetDashStyle

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenSetEndCap
; Description ...: Sets the pen end cap
; Syntax.........: _GDIPlus_PenSetEndCap($hPen, $iEndCap)
; Parameters ....: $hPen        - Handle to a pen object
;                  $iEndCap     - End cap type. Can be one of the following:
;                  |$GDIP_LINECAPFLAT          - Specifies a flat cap
;                  |$GDIP_LINECAPSQUARE        - Specifies a square cap
;                  |$GDIP_LINECAPROUND         - Specifies a circular cap
;                  |$GDIP_LINECAPTRIANGLE      - Specifies a triangular cap
;                  |$GDIP_LINECAPNOANCHOR      - Specifies that the line ends are not anchored
;                  |$GDIP_LINECAPSQUAREANCHOR  - Specifies that the line ends are anchored with a square
;                  |$GDIP_LINECAPROUNDANCHOR   - Specifies that the line ends are anchored with a circle
;                  |$GDIP_LINECAPDIAMONDANCHOR - Specifies that the line ends are anchored with a diamond
;                  |$GDIP_LINECAPARROWANCHOR   - Specifies that the line ends are anchored with arrowheads
;                  |$GDIP_LINECAPCUSTOM        - Specifies that the line ends are made from a CustomLineCap
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_PenGetEndCap
; Link ..........: @@MsdnLink@@ GdipSetPenEndCap
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_PenSetEndCap($hPen, $iEndCap)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetPenEndCap", "handle", $hPen, "int", $iEndCap)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_PenSetEndCap

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_PenSetWidth
; Description ...: Sets the width of a pen
; Syntax.........: _GDIPlus_PenSetWidth($hPen, $fWidth)
; Parameters ....: $hPen        - Handle to a pen object
;                  $fWidth      - Width of pen
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_PenGetWidth
; Link ..........: @@MsdnLink@@ GdipSetPenWidth
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_PenSetWidth($hPen, $fWidth)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetPenWidth", "handle", $hPen, "float", $fWidth)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_PenSetWidth

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_RectFCreate
; Description ...: Create a $tagGDIPRECTF structure
; Syntax.........: _GDIPlus_RectFCreate([$nX = 0[, $nY = 0[, $nWidth = 0[, $nHeight = 0]]]])
; Parameters ....: $nX      - X coordinate of upper left hand corner of rectangle
;                  $nY      - Y coordinate of upper left hand corner of rectangle
;                  $nWidth  - Rectangle width
;                  $nHeight - Rectangle height
; Return values .: Success      - $tagGDIPRECTF structure
; Author ........: Paul Campbell (PaulIA)
; Modified.......:
; Remarks .......:
; Related .......: $tagGDIPRECTF
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_RectFCreate($nX = 0, $nY = 0, $nWidth = 0, $nHeight = 0)
	Local $tRectF = DllStructCreate($tagGDIPRECTF)
	DllStructSetData($tRectF, "X", $nX)
	DllStructSetData($tRectF, "Y", $nY)
	DllStructSetData($tRectF, "Width", $nWidth)
	DllStructSetData($tRectF, "Height", $nHeight)
	Return $tRectF
EndFunc   ;==>_GDIPlus_RectFCreate

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_Shutdown
; Description ...: Clean up resources used by Microsoft Windows GDI+
; Syntax.........: _GDIPlus_Shutdown()
; Parameters ....:
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......:
; Remarks .......: You must dispose of all of your GDI+ objects before you call _GDIPlus_Shutdown
; Related .......: _GDIPlus_Startup
; Link ..........: @@MsdnLink@@ GdiplusShutdown
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_Shutdown()
	If $ghGDIPDll = 0 Then Return SetError(-1, -1, False)

	$giGDIPRef -= 1
	If $giGDIPRef = 0 Then
		DllCall($ghGDIPDll, "none", "GdiplusShutdown", "ptr", $giGDIPToken)
		DllClose($ghGDIPDll)
		$ghGDIPDll = 0
	EndIf
	Return True
EndFunc   ;==>_GDIPlus_Shutdown

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_Startup
; Description ...: Initialize Microsoft Windows GDI+
; Syntax.........: _GDIPlus_Startup()
; Parameters ....:
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: Call _GDIPlus_Startup before you create any GDI+ objects.  GDI+ requires a redistributable for applications  that
;                  run on the Microsoft Windows NT 4.0 SP6, Windows 2000, Windows 98, and Windows Me operating systems.
; Related .......: _GDIPlus_Shutdown
; Link ..........: @@MsdnLink@@ GdiplusStartup
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_Startup()
	$giGDIPRef += 1
	If $giGDIPRef > 1 Then Return True

	$ghGDIPDll = DllOpen("GDIPlus.dll")
	If $ghGDIPDll = -1 Then Return SetError(1, 2, False)
	Local $tInput = DllStructCreate($tagGDIPSTARTUPINPUT)
	Local $pInput = DllStructGetPtr($tInput)
	Local $tToken = DllStructCreate("ulong_ptr Data")
	Local $pToken = DllStructGetPtr($tToken)
	DllStructSetData($tInput, "Version", 1)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdiplusStartup", "ptr", $pToken, "ptr", $pInput, "ptr", 0)
	If @error Then Return SetError(@error, @extended, False)
	$giGDIPToken = DllStructGetData($tToken, "Data")
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_Startup

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_StringFormatCreate
; Description ...: Create a String Format object
; Syntax.........: _GDIPlus_StringFormatCreate([$iFormat = 0[, $iLangID = 0]])
; Parameters ....: $iFormat     - Format flags. Can be one or more of the following:
;                  |0x0001 - Specifies that reading order is right to left
;                  |0x0002 - Specifies that individual lines of text are drawn vertically on the display device
;                  |0x0004 - Specifies that parts of characters are allowed to overhang the string's layout rectangle
;                  |0x0020 - Specifies that Unicode layout control characters are displayed with a representative character
;                  |0x0400 - Specifies that an alternate font is used for characters that are not supported in the requested font
;                  |0x0800 - Specifies that the space at the end of each line is included in a string measurement
;                  |0x1000 - Specifies that the wrapping of text to the next line is disabled
;                  |0x2000 - Specifies that only entire lines are laid out in the layout rectangle
;                  |0x4000 - Specifies that characters overhanging the layout rectangle and text  extending  outside  the  layout
;                  +rectangle are allowed to show
;                  $iLangID     - The language to use
; Return values .: Success      - Handle to a string format object
;                  Failure      - 0
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......: When you are done with the String Format object, call _GDIPlus_StringFormatDispose to release the resources
; Related .......: _GDIPlus_StringFormatDispose, _GDIPlus_StringFormatSetAlign
; Link ..........: @@MsdnLink@@ GdipCreateStringFormat
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_StringFormatCreate($iFormat = 0, $iLangID = 0)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateStringFormat", "int", $iFormat, "word", $iLangID, "ptr*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return SetExtended($aResult[0], $aResult[3])
EndFunc   ;==>_GDIPlus_StringFormatCreate

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_StringFormatDispose
; Description ...: Release a String Format object
; Syntax.........: _GDIPlus_StringFormatDispose($hFormat)
; Parameters ....: $hFormat     - Handle to a String Format object
; Return values .: Success      - True
;                  Failure      - False
; Author ........: Paul Campbell (PaulIA)
; Modified.......: Gary Frost
; Remarks .......:
; Related .......: _GDIPlus_StringFormatCreate
; Link ..........: @@MsdnLink@@ GdipDeleteStringFormat
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_StringFormatDispose($hFormat)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDeleteStringFormat", "handle", $hFormat)
	If @error Then Return SetError(@error, @extended, False)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_StringFormatDispose

; #FUNCTION# ====================================================================================================================
; Name...........: _GDIPlus_StringFormatSetAlign
; Description ...: Sets the text alignment of a string format object
; Syntax.........: _GDIPlus_StringFormatSetAlign($hStringFormat,$iFlag)
; Parameters ....: $hStringFormat	- The string format object which is aligned
;                  $iFlag           - The alignment can be one of the following:
;                  |0 - The text is aligned to the left
;                  |1 - The text is centered
;                  |2 - The text is aligned to the right
; Return values .: Success      - 1
;                  Failure      - 0 and @error=1
; Author ........: Andreas Karlsson (monoceres)
; Modified.......:
; Remarks .......:
; Related .......: _GDIPlus_StringFormatCreate
; Link ..........: @@MsdnLink@@ GdipSetStringFormatAlign
; Example .......: Yes
; ===============================================================================================================================
Func _GDIPlus_StringFormatSetAlign($hStringFormat, $iFlag)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipSetStringFormatAlign", "handle", $hStringFormat, "int", $iFlag)
	If @error Then Return SetError(@error, @extended, 0)
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_StringFormatSetAlign

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __GDIPlus_BrushDefCreate
; Description ...: Create a default Brush object if needed
; Syntax.........: __GDIPlus_BrushDefCreate(ByRef $hBrush)
; Parameters ....: $hBrush      - Handle to a Brush object
; Return values .: Success      - $hBrush or a default Brush object
; Author ........: Paul Campbell (PaulIA)
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......:
; ===============================================================================================================================
Func __GDIPlus_BrushDefCreate(ByRef $hBrush)
	If $hBrush = 0 Then
		$ghGDIPBrush = _GDIPlus_BrushCreateSolid()
		$hBrush = $ghGDIPBrush
	EndIf
EndFunc   ;==>__GDIPlus_BrushDefCreate

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __GDIPlus_BrushDefDispose
; Description ...: Free default Brush object
; Syntax.........: __GDIPlus_BrushDefDispose()
; Parameters ....:
; Return values .:
; Author ........: Paul Campbell (PaulIA)
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......:
; ===============================================================================================================================
Func __GDIPlus_BrushDefDispose()
	If $ghGDIPBrush <> 0 Then
		_GDIPlus_BrushDispose($ghGDIPBrush)
		$ghGDIPBrush = 0
	EndIf
EndFunc   ;==>__GDIPlus_BrushDefDispose

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __GDIPlus_ExtractFileExt
; Description ...: Extracts the extension part of the given filename
; Syntax.........: __GDIPlus_ExtractFileExt($sFileName[, $fNoDot = True])
; Parameters ....: $sFileName   - Filename
;                  $fNoDot      - Determines whether the filename/extension separator is returned
;                  |True  - The separator is returned with the extension
;                  |False - The separator is not returned with the extension
; Return values .: Success      - Extension part
;                  Failure      - Empty string
; Author ........: Paul Campbell (PaulIA)
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......:
; ===============================================================================================================================
Func __GDIPlus_ExtractFileExt($sFileName, $fNoDot = True)
	Local $iIndex = __GDIPlus_LastDelimiter(".\:", $sFileName)
	If ($iIndex > 0) And (StringMid($sFileName, $iIndex, 1) = '.') Then
		If $fNoDot Then
			Return StringMid($sFileName, $iIndex + 1)
		Else
			Return StringMid($sFileName, $iIndex)
		EndIf
	Else
		Return ""
	EndIf
EndFunc   ;==>__GDIPlus_ExtractFileExt

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __GDIPlus_LastDelimiter
; Description ...: Returns the index of the right most whole character that matches any character in a delimiter string
; Syntax.........: __GDIPlus_LastDelimiter($sDelimiters, $sString)
; Parameters ....: $sDelimiters - Delimiters
;                  $String      - String to be searched
; Return values .: Success      - Right most whole character that matches one of the delimiters
; Author ........: Paul Campbell (PaulIA)
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......:
; ===============================================================================================================================
Func __GDIPlus_LastDelimiter($sDelimiters, $sString)
	Local $sDelimiter, $iN

	For $iI = 1 To StringLen($sDelimiters)
		$sDelimiter = StringMid($sDelimiters, $iI, 1)
		$iN = StringInStr($sString, $sDelimiter, 0, -1)
		If $iN > 0 Then Return $iN
	Next
EndFunc   ;==>__GDIPlus_LastDelimiter

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __GDIPlus_PenDefCreate
; Description ...: Create a default Pen object if needed
; Syntax.........: __GDIPlus_PenDefCreate(ByRef $hPen)
; Parameters ....: $hPen        - Handle to a pen object
; Return values .: Success      - $hPen or a default pen object
; Author ........: Paul Campbell (PaulIA)
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......:
; ===============================================================================================================================
Func __GDIPlus_PenDefCreate(ByRef $hPen)
	If $hPen = 0 Then
		$ghGDIPPen = _GDIPlus_PenCreate()
		$hPen = $ghGDIPPen
	EndIf
EndFunc   ;==>__GDIPlus_PenDefCreate

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __GDIPlus_PenDefDispose
; Description ...: Free default Pen object
; Syntax.........: __GDIPlus_PenDefDispose()
; Parameters ....:
; Return values .:
; Author ........: Paul Campbell (PaulIA)
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......:
; ===============================================================================================================================
Func __GDIPlus_PenDefDispose()
	If $ghGDIPPen <> 0 Then
		_GDIPlus_PenDispose($ghGDIPPen)
		$ghGDIPPen = 0
	EndIf
EndFunc   ;==>__GDIPlus_PenDefDispose


#endregion


;#####################TEMP#####################
Global $Start_Timer = TimerInit()
;#####################TEMP#####################

Opt('GUICloseOnESC', 0)
Opt('GUIOnEventMode', 1)
Opt("MouseCoordMode", 2) ;Wichtig für die Erkennung des MouseOvers
OnAutoItExitRegister('_Exit')


#Region Variablen deklarieren
;Gui Werte
Global $hGUI, $hGraphics, $hBitmap, $hBackbuffer
Global $Titel = ''
Global $Version = 'v0.03'
Global $Breite = 700, $Hoehe = 600
Global $Anfang_X = 2, $Anfang_Y = 2
Global $Font = 'Arial'

If @AutoItX64 Then
	$Titel = 'AutoIt Tower Defense ' & $Version & ' x64'
Else
	$Titel = 'AutoIt Tower Defense ' & $Version & ' x86'
EndIf

;Wegpunkte
Global $WegPunkte = _Wegpunkte()
Global $Weg_Neu_Zeichnen = True
Global $Weg_Neu_Zeichnen_Temp
Global $Weg_Neu_Zeichnen_Intervall = 200 ;(Takte) = 5000ms
;~ _ArrayDisplay($WegPunkte)

;Taktgeber
Global $Taktgeber = 200
Global $Taktgeber_Timer = TimerInit()
Global $Taktgeber_Intervall = 15
Global $Sleep_Timer = TimerInit()
Global $Sleep_Diff

;Backbuffer Redraw Zeiten:
Global $Redraw_Spielfeld_Temp
Global $Redraw_Spielfeld_Intervall = 2 ;(Takte) = 30ms
Global $Redraw_Liste_Oben_Temp
Global $Redraw_Liste_Oben_Intervall = 20 ;(Takte) = 300ms
Global $Redraw_FPS_Temp
Global $Redraw_FPS_Intervall = 10 ;(Takte) = 150ms
Global $Redraw_Geld_Temp
Global $Redraw_Geld_Intervall = 20 ;(Takte) = 300ms
Global $Redraw_Liste_Rechts_Temp
Global $Redraw_Liste_Rechts_Intervall = 20 ;(Takte) = 300ms

;Backbuffer Redraw FPS Anzeige:
Global $Redraw_Spielfeld_FPS_Timer = TimerInit()
Global $FPS_Durchschnitt = 30

;HoverButtons
Global $Extended_Msg
Global $MousePosX
Global $MousePosY

;Geld und Bezahlung
Global $Geld = 1000

;Turmbau
Global $Turmbau_Damage = 1
Global $Turmbau_Range = 1
Global $Turmbau_Frequenz = 1
Global $Turmbau_Preis = 1
Global $Turmbau_Aktiv = False

;Mauserkennung (Feld)
Global $MausPos_Alt[2]
Global $MausPos[2]



;~ Global $MausFeld[2] ;(XY)
;~ Global $MausFeld_Alt[2] ;(XY)

;~ Global $hDll = DllOpen("user32.dll")
;~ $iCursor = DllCall($hDll, "ptr", "LoadCursorFromFile", "str", "Cur.ani")


;######################### TEMP ##############################

;#############################################################


#EndRegion Variablen deklarieren

#Region GDIPlus starten / Bilder Laden

_GDIPlus_Startup()

;Spielfeld######################

Global $Universal_Zeichensatz[146] = ['Æ', 'Ì', 'Í', 'Î', 'Ï', 'ì', 'í', 'î', 'ï', 'æ', 'Ç', 'ç', 'Ò', 'Ó', 'Ô', 'Õ', 'ò', 'ó', 'ô', 'õ', 'ã', 'Ñ', 'ñ', 'Ã', 'Å', 'å', 'Ù', 'Ú', 'Û', 'Ý', 'ÿ', 'ý', 'ù', 'ú', 'û', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'ä', 'ö', 'ü', 'Ä', 'Ö', 'Ü', 'ß', '"', '#', '&', '*', '.', '/', ':', ';', '<', '>', '=', '@', '^', '_', '`', '~', '§', 'È', 'É', 'Ê', 'Ë', 'è', 'é', 'ê', 'ë', 'À', 'Á', 'Â', 'à', 'á', 'â', '«', '»', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']
_ArrayReverse($Universal_Zeichensatz)
Global $Kleiner_Zeichensatz[46] = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
_ArrayReverse($Kleiner_Zeichensatz)

;##########################HINTERGRUND_BILD######################################
Local $Res_Hintergrund_Bild_Key = '14008A292Í5Æ2852B40169344A5A94D29AD35Ì6853513Æ026ÍC080DÆD1045CDAÌA10ÏÌ7A034C3ç0AììíC1AÆìÏí6Î62EÔÇ7Eï0876ÕED460Ïûô2Cî7ÆBòFÓFAB8636EíæÎÅ5Ã589ÍÑÍfÌ4270DÌóójùõC3AÎÙ7çB0EÎEA7318ôiïÔBÍB9FÒ3161ECD86AE050îÚãæÓÎDí338CÏÏ6ÚM1DC9ò83A9LÌ19CAF411C4T2ìïÌïÛÍ0ÆDÎÔîÏÓ32Î884íúEÇ903ÍA08çFFÝ2ôÆÎÇ0C828Æ646DÎ4ÌÌUU'
Local $Res_Hintergrund_Bild_Comp = ''
$Res_Hintergrund_Bild_Comp &= ':EÌæ0Ò4Ô6ÌæææÌæDBÌ43Ìe0SSS6e0ÙäBe0åFë1ÌF0<<F1E1.712ë2RÃlîÃ2í2ó930í2A3lB222`2443IB3sÝÝÃIÝïãEÒ393ÁbDDBÌ43æ0äääF0D0F1Ûææó23Î3óDCÌæú8æÁæÁbæ22ÌÃÂæbÂæàÌ1Fæ05æææææææÃbÝ0>tSÙ9e0BàÌBÑ2æbbÃÝb0>5ÝÝæ7DæÃbÌÝ1úÑ221ñú.3Ñ6ú72271Æ3íëhúç2B1CÂ5îÛFÃ4`l7í209e1.7Öëh2îl7íÎ2Aç3ãIÄè9X4ç4454749Òã54555657N59ÓI656667õÇ;Ä7475q777879aè8Nõ7888O9Î3Ô959n989ËA2AXÒÓ;aÍòAB2B3ïB5B6B7H#BAC2C3Ccÿ6C7C~9ÀÕósD5D7:D9ýE1E2E3E4E5EJ7E8E9üF1F2F3ÁF5F6F7F8F9GàÌ1FæÌbææææææææææÃbÝ0>tSÙ9e0BàÌBÑ1ÌÃæÃÝÝbÝ0S5ÝÝÌæÃ77ÌæÃbÂÝ0î13ú.241Ñ0q17Â234Îh1B1Cú92`3îFæ5l72Ûe1l4çE125FÂ7Öëh2l7íÎ2A3ãIÄè9X4ç4454749Òã54555657N59ÓI656667õÇ;Ä7475q777879a8í38Nõ7888O9Î3Ô959n989ËA2AXÒÓ;aÍòAB2B3ïB5B6B7H#BAC2C3Ccÿ6C7C~9ÀÕósD5D7:D9ýE2E3E4E5EJ7E8E9üF2F3ÁF5F6F7F8F9GýÌ0å3æÌÃ1ú*1Ì3FÌF2üÒ9C<ûÓjÖQQïìÜvÕóÇõúïìÉÇÇÌ6ÏÌQ=îùì9ÒBåóÇ4ôXdÙrÇp.1ÍÒ9XÕ15&7SHÀ^Î~4ç«ìMeÏYQïìãúQQ=ÜÜÜvÕìô0ÇÕãùjÃEÅÒ>Çh0=5beVVÓÒKÅûuuÓÓ6rõúüÎgÕúüÓÅ7ÜîæÅÏ4AÏñp5oî7ÒÓÌÓÓ6_çù0ÕónçÎ1ò.1Í7Úå6îãÍGãÇÙïìÜãùjæÅÏÝiãùÓÒKÅûuu§tiîÌçO^8ÌÆ=0Íçße4;X9dïîÖfåuuûÓVVjæÇÇÏR1sïýìp7ìËÓ4ÃÚÔï«î5ípÑCÚOÓÌuÓjænçÊÕDÃ1õ2`zæAC2poãGÕ15&0IÅÏõ0ÏÙìÔïp§tiîfåuuuuíÆîóùj1ÆB1mîîF5o8:ÓíÆîùVÏYQßîáìß«ìÔ«ìô1òÓÒïAÎÏ4bBçy6óépÓÓ6ÕáÚeE1CÚèÍ7îæLíùcÕ»ÌÏÒÿEaáÚ9~5íçpÓdÔyÌ0ÙÇA4kD&YÀÓîßå§ÝiÜvÚìåuuuuLfx"ñ6õ3tmïìÙu§tiÜßvÕâÌÔïìÌìÑòÌìßîúïAÎïEÆ«ßîænçÔÉåÕFïAÎÌüÎdïpjoÌ75o1ÆkZÌËÿÑ~Õ7ÒÌ0xï6ÄDõ2íù5o99z8ÓXÛòK0ÍÒ75Ýô3ÅÿìàiÜãùVVVÝiîìCÛzÒÓ4JÆï8ÎõùjúQQfåuÒÌdßvÚ6ÅÌdßÉsîeÓ4æò7îìÙÓÓcÕDÃÌÇÇÏ4bAb9o"Ì^0îEõ1ÌçH&caì«67DW»Ìñ0çÑDõÌo7ÒñÉõmÔyÌ§tÆ6júî=åÒêÒÏYQQ=MeÏÒÌ^Ïù7Í0Úî3SwÚÜMeVjÌCÕÕìåÏdïÌÔì6ÏdÌîÛChXô1òÓÒïôríÌ0ÇÇÏ4bAÍæAñ8REn1mýÓÌX5íçb9o"4ÃzÎhÌÓÿEaÕìpÿ>ÎæwF0ÇÌ7ÓñÑòl»*mïPÌÒ^YïìÜãúQîãéKÏ5çÔåÏÎõúQî=ÌÔì5bÎÚÑî6CÆßÉÅÏtiÜÜPY6nÔÑò5oÌÔyñÔÌE<Õ6ñôTÆÛÙaÑ~ÉÄoH&6_ö«Ñ9CzÿÉÄokÏ4Ã_0z36GîæåkïEíÌm/Db0W6K71mEÄDõ1Ì3o6í2Î`Í4Ã&ÿÛ9CÕ6"gÛDÇÙî=Ìfåu§l1ÅûcPÓKöYîì=AÍÓ2A4:ÒêÒê§tiÜÜÜãùgìù0ÛChÒíÏæwF0õæhcìpqæmkh4Eíå3XÉDnÆý>x8lTEgèEDÒ4hÝí20zeò6ó812ÎÌ5í2Wè/õ2"Ìqæm98wã81zR1æwF0õå3ñù46gÕbÍ7SõÌ<»cÑòle^íùÓdI_ùÏY"Ò5m7ÓÌ§leÏqCÌÈBïGãaòÌõ05BA>CÌ3Cã:8Ñ81ÑáQfàãAÎxl:ÒÏYìîáâvâ@uÓÒû§tÆ#zÒKÅÒÿGTÆÑ~&íh3ÔvEÏæA5<ÕúÔ<DoOKDÙaìýS6zÌ12íå3Dgkp7S7ý9e9Æ9ÒÖÍÌÎå9ÆSD/Çe9ÆÙ7S7ýñý7Ã4A1BDõ<FBî1ÝvE`DÏcrEzRÌnIíÌwEWÛDaô1&4mBDgóú67DWPYyíoÜvA~B548ÇAèboüÌ0î`IA7ÓëBbDüXÌ§lejæíÂ5*>6C26g=5åÒcãAÍ6bÎnÆOÌÏñãBÙfåÒêÒVÓÒYâvãB3oÔvEæmOh6Ï7SõwÌ0nÊìå7k*ÆBChR1æAS6z4Dïô3BÌ&c1ÆÔ<CÇÌÔ<àÑÙaî1Ýô3FèEstÍ6_lÎ«9Æ97ýK7èEsÂÍÒ>xÙÎÄoS7ýIDÏÒÿGT1ò*mH&ÒtÆ67Dn3oI3_úI_mÔ#z6ÃzÌCò*CxE4ÖÆÌü466C74o~D:ã7ÖEõÌGÕÑzÿÉ3oßïåÒVjÃB6ÓÀE;3ÅÿPl1ÎL6ÃìßÎêÇÆãéñåÒgÑ540ivâ6KgÕÕ@ZH&ÈÌ"h3ÌÕæ1ç6ñãúBChñÔ#wùÎÄ9oI_1Ì24ãB20zJûqD&ÎæCãèbDÇÌ9ÒÖ8Fa3Jaîô3F1ÆÀSlÎÌã8h36ñÌ#0õwô9ÆÆÛnÆÌ7Ó*ÍÒÓÌÎÄoîvE3ÏÿGóú67DW6aPñùA7mE2D9ö`Ck*måñ6Å5GáÑDgìÌPímÌÕI_úì67ýÍÌ8*59h8ÔPYÔkxvkÎsOl1ÎÎDÍÒ6Ãâ5b1Îñï@ïãéñåÒÍÒ6æò5<ÕìÌ6Ïd#Cáì"ñp>õ<óÇõæxÔ6ÇD9CzÌ6rnëm9~ô3B7aræmÀÿáEñ5æé7ÌÙöC1BDÇ3Ýì3BÌ&ckÎCh8ù>õ<»4ÃE4hñÔyÌÎÄÍdkpÿ»ûgÕ»ÌÏÒSÆCR/ÕFÆ8õú87ýÍgGDb0GÚìåíGrÇñpñì5beXPíÌFCÏíÃhLàD0ÒÒ7ìà3ÅÓñÌÊâãÖÕvkñü86ÕãéñåÒ0ÍÓÒIÛCìãúOÒ7Ñ9zÌ6ÕrÎñåÎZÔvEæAchÎÄÍÌÒÎ720z36GvãèîkYF<Õ1îÎ*ÆÙÏÿèDWaôæ8óB20zÈÌ/aìËÿGÕú5íç6æmtÍÌqZkïÕæÇaî6ÇõúyÎXîÕùíÆEÌôÌaA4çËlÆÕ0Fã_ëIÍ71C1381D05b1X»ÏÝÆïìÌîâådìÔÌQ6§Ý47ÍÒ7PàD0È"ñÌEûÒñP6Ã6g=ÌýÒqg@ïO7ìåÈïO6Ã6KïãB1mO77æïyÿî1Æå36VÒÿGræA6bÇõýÇKC1BDõå3ïô9Æ9Ò09Æ#0aDÃ1ïöqGhc1ÆÌEDDo6æmýK:2Ïæ2Î720áîE4Íñîæ7"JÇõæÇÅÎÌy5bçæoy2C2171ÍdË0òÝ1ò4FBCSÎ3Ý9åéÆ6CÆ8.Ù8HÆ9DgE4EÅleVVíùYQQ9ïÑBÇÅCÒ1Hçksô3Ï7EíåAÌ8FÆãF6Õ6ýÌÈ/hcãÖýÎDÍcvîkDÍÒ6bxÔGc@ßEwkÙÕô1CPg@ñÔ/ÛCh6bÅqýcMÌ4ÍÿèsãÅÌqD0ahR0ÍÒS6çåÈEFÔFB>ãD0T3aãèaÕ6ñÔÌF<Õ6ýÒ>õùÎÄüga#zcìÌEEgîã8MÌÎCdîúyÎ`Íd8lóÄ9c927b93îAA8ÑEFo8lAAEÛEÁ*CFÆ13Úp^88uÓÒÓíùVÒÓKÒtivEgãé2B2ÖOÎx6KÎÎDÍÒÌÒL4Ãì"ÒÌñ9ï=Jý4DïGñå8F6ÕlAÒÂÚFåA4ýK99BÇFBÇ3Ý@OÎÌì9ÙÇDåÈA5ÇñåÒÿGÚô1ÙÇ36ÕÛ9çåJÏ7E7sÑï1mEEbgöÒ9ÆÔÌEDDo6æF;ÒíÌ2A4ì#2gEaáîÛÙaÑÌ6Çå67ý9ñïNRE*DÏgGDÃe>ÇXFBîîÖ/Õ0F98<îÌ5H1îAÙA4*557Å^ÖF;139çìÉÅÒÓÌíùñìÌQQQfæ26ÛoFaÒ`599Ó0çç6nç0õ2tGîIý9DBé77ô3gãF3Es71m0N6k*îtaîtaDæ.Oc549B7DE8:7Dõ0BÂö*îç9ïGô3Ï7ÂEsOÝ3xÔFw6íÖýÎDÍc@Îÿîk8åAñß0à_ÇÁ6Ç8ÂEñ54Ë3ÌóÃXÎE5Î36óæ#2Î720FìçOÌ5ý0Áç9Ï5ÝóæÏÑèsîEÛ:á#wEDçãú7DWÑ0TÆË`F9ÑwÌCÕACÇÌC&a2FçÙ78Ì0mï>õÖ1Å09CòïìîúïâÌQ=MeVVVjæDòÎñOC7ìýÿáÚËKÅÒÎpÓdÔvrÇïyÌÿr4óZ5æ71Z6ÇÏÃEë1m7i0ÿ4åA3Åû4DBEÁ6ý^8ÿJÀÇ4F;7Û9çC2E47BÇ36sy4EíÃ2Ch*'
$Res_Hintergrund_Bild_Comp &= 'î1Æ9C@Ô6ÇF9C2E378z30nõG»I1BF8Ñïh9ÌCÛïÉ9BdBBÎDïÛÊq1Hç67ýÔ9C7ÓRDòÝçE3B1CDçFBóB2íEKïIDÇDïh5pÄÌÍ#3@AÏ4DÔ95ÙDççCüõ13lÚ5Ï09eÓûÓReVÓûuuÎêÒêcÛòÒ2A4B172n3EsýÎÌBwFÆýÓÌÿ7BÚÔ6õæÅÒKÅdxÆ6õåAñÌîÕì«î6WáEÅÒìÑòÌÎÎW@ïîöíùcÕÕkÙtî1ÓqdHCã1:6k71Íq4ò5åEÁÿAäÊÑ71m87Í6ÃZJ&43CÕ13mà:13o*ò5mà1ï7a3Ådïp3t/4sÍO157Bóé36ÇÖF>7_2Ç0Bkb6ç9CF;4åAÿr;~CJ3DE9SÇDwFÆC`0ÇÇDw<ô3DïÑäî0äýÓ5D9EÁç0NÒÎ7Ç&30õ0äfpÒêÒêÒê6ì#Æ71îNEgvQìîáìß«îìÙ^ÏEÅû3òÏdÌì6Å4Ñ6íùÎÏÝ3Bç99ÆÌn81ý98/1ï9mbDE9Äò5b1sÕBÔDE4rDzq7ý8åA2E3äDGîIDÇCÄýò78oåJ4F;cö4òÇAA44B6ÝñîãúßîóúÔF55z15ÇÁ9Bç~aBeRõ2xý06:#CãÄò4ICÚÛ9BlÚÔ6Ç88qnçÊÕÕæDòÿódyÌqnçÊÕÕæårÇï0çÌFCÚÊrÇq0îÈÔyÃE1BÇ3Ç&ÿrõæHF;cãFçô`0Ï7<aìæ5E~ÚîÖyÿóÅÌq4ìýdÌ/PcrõæÏÿÍñÌEgvfÙÏÎ7ëmpÒÎDäÛ~5bäDwöW5ætCÛò30gGî1:5åEFCÑÙXîtòÿ6íh4Ö2õDHoBHr7DÇ0/2îkDF2F;eDb1#&`oÂÍÇAllEü4DsóÇA21B1DÇñý;8RögrZåcãÙAÌ0ÇF8åA4D9Ñ88î7Ò3oDIòÂ:`9çEXeJ;~DBeÏ8^dïÌîÕìpÓÓ6rÇ75Ï6rõæsî6WÕúüÿóÇõæZyÈÙqWónçÌyÓJWT3BçãZô454Ô"Î16iMeVVd6nëEs0NdÛïa_ÿ7Ò43E5æCrÀÒõ1DBï>n2WÍ43äDEno/*òaÑDn6»0lç7Ò5a7Ó41.BDnÆ#ÆI3DE8Öö0Eõæd5ÝöA492:BBEBbsîîã25B17ÌÕ1ÓímpRÎÎD9çS7B@ïã8Ï5D"2EîR7ÒÏRxÆ2`ò43BÕ>DE9544Dw4hcãÅ8EwÑHÛBBsïh30YÑòñvEnçýÓ4ÃÇïyÌ7ìýÓÌ7îónç8RÕóZyÌ^d#F;4Ñ9ÆÜô3ñìHç8ÕC3Åqý5ýÎÿ7ÀC6î<óF0Ï2E1À`6rÚ"ñÿqeÎxx0NÒñyÒÌÿÛBéñtîæaÛB7DE9dvEñ6õ1z5ÊíÌ0n2Î0Û8FaÌ7P6Û9çÙÓcÑBBÆJCó13.9w6Fç7Óc5ÝB.aÛÙ7B»c5Ý86ýcîÛ9çåÈ/8&3ÌFaÌ6rÎqrñÿA48c6Ï5ç9_íRxC3Có8ÕC9JE1D0ãñE3CÕhõ4:ÔÔyÒleÒÓYÔì@77h5DsýKFHh5E2AXÓÌ7EÏJÇ43h4ÃÕÕJ1DmtárÇgvÕóÇÇp^û^û^û7FÆÑïÛB6B3X35eÎ7ËÌñ"ÇçDÃH/ödrùb>CÛ~Û9wJAÌ5Dï7Ò4E4rñÌËñBHaÑ9C&ÝÆ6õDy*Í0l72nÆËÿMÚ7ÒÇ;tCqx9BCóÅ2àBlE41üÎ7ÌFaÈpqííÊõúyÿÍ4DDüíEKxO*E8nò4Ã6ýñ/_0íhRæÍRÇE7ý9BBZÍ13üÎA7òÄãxC96Cc6Ç1BC7ýl1ßüÒAúýÒqí2Yýí2ÏìßC6iîìå7ìÔÉsîìSçAÖóÎZæ2JAÎËdÙ93E8õËÿòÌ7ìDDsBHÉZîaÚæ2E/ÕÑï7Z#ÃB237FÑ*ò306Ò4DÁ;2D0qùcEí1Crý07EBîtò7Eù`mÿ2DÊJDz5<ÑCò36aDæEÙÓ93ÝóBÌî16&bs36GÛÎ39çHCôëCÚî6õæ7qí2åF;ÒÒl17èDE8Dß5Ý8tÕîE4ÛBA8æÏq41Es9Ù7BDÃ1Ï5ýÇ307_ùÏìp4Æ/ÚîÎ2Æhî4î16z43:S49w74ÆCCDÃa0/Dg75çÛCòëBBã1æ1òRgÛò09h4îkFò6ÝP7öñå6hÒ7öñåJÎñEwkÙÊâ@ÎêÒ^KWÕîóæÅÒÓÚÔ5b1Zî6ÅÌqWóZôXÍÈp9F3ò0ÎçFC81D0ÑHDIÄ5B2ü26Cz3Eì872õp4DbÁÆBó724óF6æDW81_0B3üçÃaóHÆ992Çñ0a0EDåîJCÛ7_1ü2E3DõöñïÌPd6õæñîõ0äÀÒ7Ûÿ5.ÔãB6ÛBÇÍC3ÇÎDBWÑSäýÎx6í1NcrEç6g5æ6Æ1Fì#0Çg6õ0BeÆ1E8ÇàIAãaxÔ87ätóÙåî16CDæäÕZîFÆÌXò09DåFÀ3Êónë3ò0ÍÌÒÒÿìCRÑòÿP05.dycPÌÓ4åAÎYk0ÍÓdåJÎ"930ÂÕ5485ÇBBõ0äýÎDÍc@ÏÿîÜãÌCÚß«ì5æ6ej0äf0NB5BnõEÁy4EBN1B5Båm8NÛïrÌo0FÑHCrÀÿGÑz05.3ÌîtóéíÖOLâvî=åÒê4EW»ñpdyÒñ0ÿÿÕFEÆýíÖBCÑB7DE9d6õúBBÇñe5DsÌÔ7Ò5DsBC1EsÌÀÎ:Æ9Bõ1æ3wîö1"æ89DEÄCqA41CóåCMR0EÏñ6íùÎxOÃC26gî»Ý3xãéNÇALÝ3õwEg@ïîÕ5brÇÎ85öñ6Å6æBÇñyÿT3xO7xt@"ÎDÍcvâvQEûB7Í5mÑN1ÛtLÃC1òdÔãú#Æîkïîì«ÑòdÌì6WDÃeñÌPñ6KñkÅ6ÃP7Ñwæ"ñEöñÌÔ9~óBÆkÙÊ6Ï7îÉÎZPÌd87òÿî6íPgÕÌCPdyÌcîã"í0äýÎs6í0äDwkDÍñeC3xOqgã1N66gãéNÈïOÌ4çÔüRNÈ"Ò..LN§Ý1òÿÕì5öñìEE20wknç0NJÏ7x5ælCÚÑN1D0iÜô1ÍñìeC1Íc=0NÒÎW5æ.ïãBÆkÊ5.ïîEÏÃCëç6Åí1Nd6ÅN^û^3òd«ZËÿÍÝÆÑCPÌcPÿP4Ã6g=ÌOñïÉïãAÍÌ6»7ìÌÔìô1òÏÎÌ7i@ñîÛòÌJÎñ/Õ6Ç8õ3xÔFö30N6îkFÍRÎÊ5.ßEwã0äEûÒÏYÑòû§ÝiôÓAÏ2B137eêÒL0lâÉuuuÓÒûgìMäkêÒ8u§=ô1òÇÏEnçýKDòÓÈ«îÑòÌÿì6WTÆÑòÓâîæÎêÒcîEû6Õãé2AÙJÒÝ3ÅÓ2AÙcÕ6ÇÇí0H6õEÏÒIHïkûñ6ÏdÌkÎZ6õúFÆô5òÏ2B23.ÅÏ06iÜvfpuLKuu0=Ôìp§fåÒjúQfpÓVVÓÏ4Ãfpd6ÅKZìãùÏYÔÔìÌÔÔìÌ8ÇÏYÔìãúÔì5b1§leÏYQfÙFD9'
;################################################################################

;##########################HINTERGRUND_FELD######################################
Local $Res_Hintergrund_Feld_Key = '00aaba1AE445490618012c4eB60F4140E654g424Ac50k30D820y6z2GeHAI4JlKfLgMbNbOmP9QERES7T6UDV5W7X1Y'
Local $Res_Hintergrund_Feld_Comp = '89vl7x0Ad0uxs84fww2j03ctF1dFkhv4Crfjbc6E3mA6uj7ftE53apqD866cis4or68Dq3F8nh07idipCh19oE20ddnaCBe3Z'
;################################################################################

;~ ;##############################BITMAPS_LADEN#####################################
Global $hImage_Hintergrund_Bild = Load_BMP_From_Mem('0x' & _Decompress($Res_Hintergrund_Bild_Comp, $Res_Hintergrund_Bild_Key, $Universal_Zeichensatz))
Global $hImage_Hintergrund_Feld = Load_BMP_From_Mem('0x' & _Decompress($Res_Hintergrund_Feld_Comp, $Res_Hintergrund_Feld_Key, $Kleiner_Zeichensatz))
;~ Global $hImage_Weg_1 = Load_BMP_From_Mem('0x' & _Decompress($Res_Weg_1_Comp, $Res_Weg_1_Key, $Universal_Zeichensatz))
;~ Global $hImage_Weg_2 = Load_BMP_From_Mem('0x' & _Decompress($Res_Weg_2_Comp, $Res_Weg_2_Key, $Universal_Zeichensatz))
;~ Global $hImage_Weg_3 = Load_BMP_From_Mem('0x' & _Decompress($Res_Weg_3_Comp, $Res_Weg_3_Key, $Universal_Zeichensatz))
;~ ;################################################################################

;##############################

;Leiste_Oben###################

;###################################Hintergrund_Liste_Oben#######################
Local $Res_Leiste_Oben_Hintergrund_Key = 'FF00ÆÌFEADC07FAE35B5A57D45F1F83E4975694B2BF5018A3D6BCD8D157265ABEDFC85A7032D4D81EB9563A06D9123714E618C417BAC6E43A37329FBA98EC52E89CBA125F0FD7E218B799D6CBB7C7820248060CCA29E64F4C98370F3C3F91E66D02A40681B9BF71D6A10483CE59C2C7ÎFAEE7722D31C0BAA14ììF25D6228E0997A30DD84FÌB43134ÆC7674A4F6íC90DB11ÆE'
Local $Res_Leiste_Oben_Hintergrund_Comp = ''
$Res_Leiste_Oben_Hintergrund_Comp &= 'ÆD8Ìñ046ò46ÌññÌÌñÌñÌÌÆÌuÌ02ññ02ññ0YYYYYYY2b05bbbbb0ö=4b050&ö&&&ö&&ä9â0ääiä&&i<iiB0&N<ìEâ0CÆÌuñ0YY2bbb06bb0öìä&äìCÌñÈ8Ì5FñßbñÂÌ0Q1ñbñ4Ì1Ìñ05ññññññÌÌÌÌÌÌÌÌñ02b0=50ö&äiB4Ìæ1ÌÌ2ñbb0Y4b05050=4ÌÌñçñ02bÌ0qÈ512Qq0oï1o0Ý2m1u2ekL08l4ãá1Û5c1N2u3Ý8YLomekAM2Ý8x2v4ï3hw#93Au44Ò4Ü7Éò4ÇïÒ55ÿóûgAhÜÿ;67@ô6a3óÁXS#û8@X8JÃ9x39ò59ôSJAÄvÇA6aAÃ9Aýã3æBårR_s2.C4HCUWpèÏcÅdjçÚTî:IÕn5EtPGÖAÓ*ßÑFí8/ë4Ì1FñÌbñññññññññÌÌÌÌÌÌñ02b0=50ö&äiB4ÌæÌ02ñ0Y=4b0=&50=4Ìñ02ÁÌñ02b1È=5Q3ÈoZÛÈ7om132l2e0e442kLBáÈ9l3ï2Fñ5ÝDÈLun1MÓ1mekÄÝ8x>ï3hw#93Au44Ò4Ü7Éò4ÇïÒ55ÿóûgAhÜÿ;67@ô6a3óÁXS82#û8@X8JÃ9x39ò59ôSJAÄvÇA6aAÃ9Aýã3æBårR_s2.C4HCUWpèÏcÅdjçÚTîIÕn5EtPGÖA*ßÑFí8/ëÆDAÌ0ì3ñÌ0Q1bÌ3FìÏ0ôú47î59ôD6iïÙúE96Ó027ÌVB055O4ÃæEïNûDX0údwÇ5f=FmjB097ûFWt~ÛD59n0ÜÛöí1îýóBõ7æÓûEå7rééúÅocD^9Xp8k4î0u1ÿ4Ýn/bÌ393Bå<ÏB=B1Ó06RÛDEkXïFôÊ27çLskDv4jcHB6Ú44j9jÎõî0ó3B09Û*ÔDCE:1Ó5EÙýC1cí13VÔÏÿ@ÏBç5á*ÏK3B7uCã.Î1yCÓnAND8ôNïÙDCyBKÚ4ä5B0Ç8ÑE3i2í0«óß4ÎC`Ä§Í0Æ.7i_ãÚIEï4Ó0d1iB8#6ò6U90o9ÌC8#:AÒ50VD6W7Jç0EÎ.4ýRBDFîAåç59Ad:3S8>gQóúB1géÌòÊÓ58ÕY9ç6ÿ4L1RÃB2dCÏAyDrVï6`jEnKîRf:ÑgÏfEa93X7P^Ô9W19ýåDEôDîÚ8y44w4y2hVÀù5CwB8Fbk9YÃCÏh.FSE1ÍB2OBY@Õt97&Ü8ÕÜ4FTs3~G0D`ÃB.FaERÓc1ù4Í6U3óÜA8Y4c»4Kxô5»G8òëÌ3æ54ÔEÎcÓ2f:08N2t6j0tßõòt6ÿBÒFMa0CìEÜâC~ìWi8FÇô86ÙAÏ5s9ÒI594ÏýB3òClãóVFSE9AUAÙBÍä"X0PâúÒBrwÿsÔÝ^_9I1éÀ2`ÿCúBèTe4Fö4OãlC6PâÍ8uÿBÎDj1ï5*.áETóEX8ÓG^epEXFLÏÍD9AÔÔD5AI3Î_8JãîN26ÚEM<Î1;J3Ôu4AòEFæâKûD5å1õ8P0iÃ1jCsÿò3ep92SEã4C4h»mn1üèç27ÄFr9FSå6õ97dït.T4mg_ÎæÍlHEÃFaÿNtJÇåBSPN59"ÇX4ó^L~946isBÇJ44PEAGI58rúj6JNKòNE4ùv0*Ñ^ANÙ8òM8æBuÅ.19î4C86ÿ5ó2pEQFhä58ekC4í6y7ÛMòFÙÎ7aõC^ùÙÇECuHAæùOí56yC/æW1Õ0yAÓ`ÃcR26eIANB04ô9FUh6zòCá7ÌF§ëãH<Ùi7eóù5FòàîÏæBõ7æ0tó^0e2å82I^12So42t0s5Áj04ù~ÉÙS0PC`wÕÇÓEß"AçCFwmcK"FIâ398ÿ27eà9Å2æ59ÇôE1åDó05:44ùÏÑ5^FÿAåDÀëAÒCå394ÿZÏ6xEAíbïåj2aBÙÕ*4dPâ4ñî3yIOI1ùDòì67n182yE3bBD6ÿ9W3_"C;67Ã0CFUÀ3FÇ7sFìCÔSçNÎEC6ÏAÚûÙÚgæBCÏrïü;M9u4UAQ1V^R1Q4ÑÙ7i6våaE97aÇTBEkAÙFô7ï8ãvuh0ïBdBL1yà2ùDE1#Ýòö54p7Ì6x3ÙM42aBxæ53ÙôEzEf@ë@ÑæîÓ96MaÿzEMmN26KuNËÇËÏ_fCp4Ó5Ã4d9@RÛ0HFiCù2mèE3Û5öN5ôB0IÕü1/Cúüdr9HAJÓ3Ô9WÅ67zVJMVBró8hhïCS6ÔÌ.áÝ»NÉbáE>6õÔÙTÑô3Ap7rôAçàMC6zaC1È9Ì098dÃiÕDlÊ#ÚDG8=A8867ÛxyælÑDFåBôMAc*PAÿÑJóÕ7ù4Fì1ÿXCQÏEnHn54OqÎgC;aA6dAÒq32äfCÓ<8ÑÛÑ2X3æSúdE:8ærDà1ÑÚ4cIËBó9cj2l3.198q0E136ùÝÚCäìE327Ç1A8ÔmIË9ïç4cÀÑÅn0DÅAçÕ3R4RXÑï5*gü2ìvBY5/òDC7ô6lkHElÊFÿó38ãÏ37f`jD5B7j2nC6ýÈEIüÓÆ05@RAÕû1Wid3eZ8rE4úãA8Ó6ÍCÚ5zÍDçKÆL9ÏíJ3mÛET36óàÑãxä/AFrU96FcCFÙ.»4Ì7ÌE33eè7W1s8Ó6ÍCÚ5zÍDçKÆL9îëÛBDsAÛcåzSÑJMÙ;6ç1ÒÛDE@Û9P3õñA8X6î9õÂ/R8fkÙ6Ç32XFbLEGÇí3AÌÓEAxFwñBål2Ýh6ãFkH32#=ÄÃÌÇ5ìÊ8Zr1HM»ñ2Ò12ÙQ^CÂG9VÏ0c5TC«j7ì"2aÃGg1üU19n0Ã9ôßMAç1G7eEÊÀ46Ì7Wm4Cý6Ç2Q/B0E3a^DÃU/kÝrGd4*òt8GôÏDÛ6a1ApÄÅBkkDÓÙÅÏi92ÿâ26bfFÏÅi4NE=Fm9An&íÈÇ5YÎ2l17ÒÀ6x0L1úÕCP9FT5E4m2Yo<8Ù6óHsYDC4Û~3ÖgïTEAÒtÛG0îXÑAJC1ï7JgÉ2ô3eÝÃA8ë«pj4hÑ3ÃB16FôAû/CuôQ07L>í9Öãï4;ApBA8ë46ö#Z8ÌÁïÝìBAæEÌ9Q:ù#FÇ5LNî5U9åD4"ÍA;ní5AÇ4rB2gÛD59ûÁm1Ê2"BC1ZÜh9AGÅòhe4j6év1ù56ÑDNÿE@ÉÜÿ596ñÍc13Bç4sVr7rýJ0t7k8>8Ñ26æ54vå^4ô4c6c.óÅEü1YeÝÕEAzhFÇ6æaäærE=5FÜâDP6U3PgD9X6ú336Î~Bï4Ú»ü4WFQ1*Æ0Ï>Ç08î8ãÒUG6ß4ÔãjóhÅD6vAÇC4å1òáöqtZ;éáÆ1Ch6PæÇ1WNCÂäDÁý3kDÎüv3ÍkåLB6Í9ÛA*ÎBEiÍ<26îVEMú1míâôDAÇæDE47ÝzFô56dAö2fB97ah8o9Ñ0ÅåCAÏpa4Ó0AÚ4AGI4ùÛÿj2xEçFýFZ7d0CM7ÏnÇ5ací46S26ÇNí44Ü2Fj«6se4Ý8UlÝDßONîoBò<c67r6j5ïEòõ04ÿ34=Eç3ÎÕåDÆ5CÔwÇXhHóÚÎam0DÏFô"X6ÿäVýB8UY51èpGæËí1rCxAtûzÔÝFÏEr8rfBZ6L0òñp5VýIü12ÕU82ÝíD9Ä86IÛB9çèEd4æ4Fg5BAÑËByù1Ç5ìD6Çü«ïÀÀîAO3A6OíÕCÙCNDÔ6ß6NFôkC1~E6i5B197wÜäB1ÍBFæÄcFõC67ù9Íà9aÆ~«ãôQÚÿD8Îõ1ìÝaôÕ9ÖgD5ú56NÅBX4æçÕã0òDv9ßC8tËDCÁù6j8y056æ6Äû5û1ó~ËrWÅcPÖ6oáMòD2g55jí9ùFk#FÿDéÆKËÆEñaÆ~Çy3ôhÎ5ÆàÆ8ù538cAõAçB»6Flh3û52nãwÒÔrSîX3ï~6o398ß/l8pq1RCÇ8eFIÅ33Ù3ÏMò2ó2ý4î9çTDV2yÅ59gáÅ5AîDd37víZîüÆBÕ97Í3/7ÍÔ0ô7åTÔkAÕJÕgÛüFçzC6cÜ07ÝôÓVÈ7pwEÔEOAæDUE6h2x0/3ÎBaE4ëFÇÿ7R2KùÎ1VD886h>ÅCÝ3FgUzòÆKC7Æ92ÆÂ;Acïwgy0ÔrÎ8xÏê0î2ÍE4ÃÕCÕ:ÆiA6æÆ8ãRÍ92ãAí13ú1ÉFdBÍ02ÏûDÙwåE3õå7k:44ñE1gDg5àb#B7ÝÎæB17íBïAqyÒ5AÔ2Fa9yC8ûüÁLñ6WAI58G9FS4AÎ5EæFÕFï.Müf3Ôÿc9j17ôçÖ8ëtíh3_g47ù4hBÏE4îBEdó3äy0ÔrÎ8xÏê0î2ÍE4ÃÕCÕ:ÆiA6æÆ8ãRÍ92>îav8ÎDq7n1Åùgèî16&8nh0C4ãBhe9bïúÔÇ7ÃÎåÙDsE6FUóõãÉÃòæ42õ>ãE47w86ïàJC4C6ûï56wg_8Ïvr"AõaÙûì55AÑ~t93P56ÃVúG3BECÕ:ÆiA6æÆ8ãRÍ9ÂsE9Õ1TâCuAÏî9NEÏý2õç2ÇBvÕ'
$Res_Leiste_Oben_Hintergrund_Comp &= '9mû56Ý1q3J*p9Ï2ÔEÖÌB6N4W6d5BqD:^Jcù5Eï8lZKQ1l9Fw"ïÚNF@Õ2Õ86GsG9z=ss5ÉgÝ0Ã2ÛT5.éÒ>8Ñ8*ãFIÙ7uén:X7ý2ÇÅEcAçî9èÿ»y94FIEáháN2ÃFÄnFzDJ5ÙÔóù0jùA@2Å3ú4ò0DChÙÚó9p2K#kB8ç9N&7k9ý1aåFÇ.12MAôÎ>4ÉÇ*koDÿÌòÚEÌBP^á67Ï5Í0`eÏECY5rAÒÖ7oC8og5FöãôQ1ÈC>û:.ÛCAN9òE`ÍìÇÎ;tC;ò&ïCkdÙ9ÔBÜÂqå8Ó0Q.eäDÙBEÁñC67Ï6äÁrJt1ÇÓ=Ö6pÒlZS7k47Òht4ÝX`z7oÇyD4çu0æ9OEÍüG5IAÎDWxa4F@2KH5ûCÓé&fA8Q_l1*2RW:3GÒ51RH7ÇòAöDïc7H0UTC§ïC4R6wT9W67ÕDÜNcD4dáÃsGq1Òm9hÄI9íÈYBÝ09RPßCFm8Z7fCP»ÎÇ47rÕyBDÎFg~Í8õÒD1Ê2y2rrc5lVl3yqâAÜÝb0mÔ56ÙÖæÿaEÍB3HýqEùí2Ñ05EÅ0E2IÒ6dÛ4NBdE`ÍìÇÎ6I44ôâDà04ÿ05A§q1886ãFj4C1l3#ÎýDCÎ6ôK«ôE93sAcÑq>håRÑDKee8Õ5Ì5ÿD»Îýd`ÍìÇÎoCAÚrÚ7UEùÇô6Å5ËôÓEoç4Ûp9GüWEÅfÚÓ3ÙÄÔåH1ÿA8qhîumãpõ6ë«ÒB18öN2S0r1~f6fTÔåE6ÔWõ9Qi9Û86ÅÔÎçngB9óBí8ÇÎöAãhB~uCòôýù37ôÏUyBE7§§Ôë;>åBh~RDAs3sÏB3TÙÈDÒ4l1ÑãË6ãbõBkSaq2G9ÂbFÇ4FdöE9MKÏBú52Í3337ò5ïÿD53dèL7æD55ü§Ûâ6i8ñDÌOD7Ì5dmEZæV9õCýÏCîD1/Ò9ÑC4Aí7Ý6I9ù5JÒ5çn9ÕÍÔ1õú"ùý36cÑVâÄó888l/Ã1ïÛÏpt18Rî3BD53Ó3å7ow67m7ÝÒîBDüåE6J9óÒ598ÛEq0Î51YÓ5n_é6MÚ94ßöqLztEÍÔ1õúCÂgKÎ^Ó3ôDE2ÅÂãÏÑÇ3FãÊFz2Klhp96Fã9zÑåÍùd5ttSíôgËèùDCòC6rÑî3P19nhBrV4;OEq2Ü8Ft9úHóYö7Ï»N<AtÓBE8ÏVí_Fló»ûÄÃãmû1Ò0n0Ü5ÌSÁpjÒ9ÔÖÓ»ö6ODÆçÌDOå3ãuHÁfzÔ8îAÜ"467ì2r8Ì0Îg9FqåöÄÃ2eû»«ÇDä50òÅûÅùMÃÅù»Ã9OE>=i547Ò1n8oôË54ÒéEC7Ì0EA6eÚAÌé4Ì0927iîCFuNMBD4A`uC/4*BwF>ÆÚjC1aC1§i4&C6äC2Ã0ÙDnCSËîûSSÎîDA;FçBeFÏ5C:0ù52ZM6l8fû9ÌCÎæDEßAxõ936Sû9õoxòv7ÚCodBå7rVÃ3^Ö4ö«ÅòAßç5ß88óý4@Ç5CÆóVzÑÛKÔ1ßCFlCöD1õ`ù8Õ3Gm9Oô94aLD2ÔåC^jAMBýò1AdÝ4WCE.3y7ÇUeeÒ1òvÄÃ2Äìlik0ýÌq8ÅfÃæDÛíJ4=PE9_Ùp7i2a8FìEíñæwÕïÙ8X#4ýì8íc_<ÜíJA@ôTó»bk9ÑÄAîl4c86W2FSÍ5Ñ0êeïr17JÑ26ÓBôëÛfûB0Ó16ej6p4ßÃ6K98Üë8P3Î055EòôBÕAÕ1KD8ù9î1HCìHh4I=3weÑý7î8Ó1ÔGEiÖFjæxA6æûöJBECsÇw&vA6ÑA/9ü94Ó1887Ùï:5E6f«tËåD1ýÖG4&B1èj7Ýmßô5À9ëa6Å7ó6NË<Ôæ6wâfÚï4NE4ÝDCïõ3nì1ÿÃq04yß`sCÔB7hÇWnNEÔ1tó38ÑjÍ092.bòzuáwK^0oB0ùÌU7jAã8ò7HÖï9Wõ1f0nÏOv»Õ42üc&4CS27ôñ&46nSÛ9ÍÈó3Ó9ÔFWwÿçOÏ7õBÚC4oÏ88ã2ûìYûC8FiEÅýìGÒ5çÇxCfq382æDÅ5ôZùÇDEîEîúÏD4ëxm2o39>4h19ï27r3æÖzýfA@ÏÄ*BTCúõÓDÔC6c6ï2ûèkE8ÓAÙ0cBÏvB7ÌeY6b2Õ51V3èí2îAtúçzô1Ó3BClvqZòAçùûBOAlFxò_&ÿË8phphBDS0X7W7ÆÈÑCFb47aEA8ë*4U8og26æoZRà0CH7mC8f93ÙdÕaE2ýTtCæ2Xó1åDàvÉÏËy2w1AîpjCáÜÑÛBíoDxD2Ú>Ã9I5p9@FS3Ã4AnfrýÑåV6wBEl>4a0z37SÒfj1x3t2sFåôD1ÕCkEg_ÔFÒBjå4ý0Ö*.9ó2fwé1í1ôAtLTbÛ6&4I3NC&r9ý33X8ú4Fi7ûÊ§AI92d5ßfç8FåÌ2Õöe98I0OËC1Õ87ïEwv7ÚÊmE1*wFh9ï@ÒDCÏÊAÕKB9õB1K3Ì54äòßH5ç0æÆ18X6æõýlýHwWw&Eö6w3:n5#x04S`ïT4C8FÖAnÇn57m7ýnù4AcFcD2ôïå"åÄõ4Iáò4lnÈR9ýxc3õ2ôAdIå3ôVDù16ÏBD4FhB8ÓüÕ05<ß6o6PYT2FÏ9Iÿ9sco3á*3*26úp8ÝCòl8fHXÁHxöBÆá§ÝqomA6q&E1HsÓ/Ý4r9ñ3gù92òFLÏÚlC7Õ3Ï096oå3åsFl4îAjRîEõ1ñ94û"ZÓGæ#sôBîfBA8ÙSSôzDÙüEÁòlìË9G3:Ö9H7PÒ9ÿ3ìDSD59n1AaAz6îÀEîs9ôDÀúsm6óÖ5Êÿ1Ú3#ïv4sBõ6GùfERE6ó15jÑBÔòÄ6ýÝÝDNCó~=CÏ2ÝDEòeË5Cr6*18Íä55Í0GA=ú188ÕÂ"2ñA8ôÖ1RÏ^rèE6oÕDû8yèÅ5E1ëlX*CÅåEYDÕ.4O7ùBdDSCOALÎC`ã3zcEAG0H3AñE3K6FbCÎ^õ0DX6JmÖ4æÎCFsFg3èEÙ.g07ÌE3Ã*B19k«gEÝÚ58FéAôEÍo*3èç5B93FcÚE9Óc1a0p1Hqî9ÓyAÄFç92ÃFÅCFvsWíaW1AFñX4ùE.õÓ5ôDóAU33sëÒè1é1ml0K/û86ùEòCÖT7GÔË5IùÑ0N6ÔÎEj7õVD1öB9Ó0Eg3cTü2Q9ocZ0C7Ý0Z0"MB:pãKú1Ö32ÔLNy4Ay0E9bCõå6ö9ã0_0ô513Å7@7uBí0H55BTêlÙ06i9ïBÔÃÿD5î6ãýB2Fa33Bdéÿ4CUò4ZjDý8bbäãG9&*ûòò54ûD"Õt6Á7ôz§ÏåD9ÁFÜj53ÃA8nÚÇ6òî5UANmD~EùFÿaç37Ï6zoEbBÆ19åB6FÿAÙOú9ý.05E3ôÒcDq1RÉ4A8QCíýEÝmCËBà38ÓAÔCÖ3å4Ô#Ó3Bì9zqÄå9AÜC6ùQ9tó3æ4eEÔ2K1Ûl6N7m"ìyCãÚÓDW4O2ú59SÏHEx8Ñc442OAÿd3è2dæ42îEd_09ÌÌÕ5Î;Ç8ó8Ô#Ó1PlX*CÒÿîDCÇÚúZòÅ_4mìÖ6QhäAi7Ì12çBDzË/bCMÒ5EAn126vå*3Bú1K6æAÙ5Fj7åôwéE38Ã9h3â3vd3ÃtF;v6ÔAFrDÀ9æBAõ7fhCAïZâw9Î6ÃB0D~Ká87pr0ÍÑ5ÛFÇC6Çg8/6Úõ2õ4ÎBE4Ò»ñ9Ç>47§vqÇ08d2/Pß0î8jwÖc0UWuÇDì^úB;Fníì9îk9ÃC1ÔûjEt8Âqö9ÛB2ÅÔÎBd0Fwz0Ý2ÃÏAÒ<Bù2ùEoDZp3Pg6ôÌ51Ò»2Ì«ÕMBuçiCu^9v3pFÏ5EAGùgcÜ2ÍxCO3Û4A`b9Æ0cD^9NEC=9"8J4OXÏ8î1Fì3Aô9*5G8QJì5oÎ3OãBÃAÌÄÃ2gì2k982x2nÌEòAGE6FoBc3õá=Á6öãgÓÁÚvVB;æB3MgFÂòä47iÆ1Aök_Ç7JGÚEM9î<6ÔA67jEvpzUÓ5EÚaEv0Ez6ý3q2ékBp8lFÏSÛ4Foçmÿ3bj2K1VÈÕ42q6Í1ia:C7îà2å98ùC;ò1Èíì5Ý1ÿiåFsCYDÙFõ§8SÌBoBÓbÛÝ2ÔÿtFYr__JáE4Æ5fq26ûE7ÚFõBM"VG4ÕkúEí4î6W4Æ1Ûæõ7@2Ù:1JCoTBñCymDãA6æNÕ9Re§8ÎEÍ3í3ztÊlAÿüÒ1sÏDq1pÄj3/ÃÌFéÇ4ulû505GÌb2òî#Co7jñ7ù1b3ò§n0ÀyCÍ4ÇôKéFcK0"8Î44F7zúBFT3B1n5ÿmFÇX0õÄÅDCÇòE4C6#kÔD6ÙBXudæ19b9ÆU96ýDÒ55p1ÙBDHBr3Br7ñhGbi55H4ÏÈo8ùEg0àAÒ1tCZü4Ó3Ô36ãBeA6æq1üäTAv0ZÍfD;WÅBÛBÚnò98tFQ46ÅJEÆïDGFïÙ7û3t9Ö2j4cB1äD92iÌE4P8§jhõEÚ~q38fÉPoC1iBpw4i#q2Ìö51Ò0w4äãT04ô'
$Res_Leiste_Oben_Hintergrund_Comp &= 'BÓ:3Umó1Î5k8ÆD9åÄÛCE7Ú*ôíAóD#e1"ÎöÆÚb4óFÒ2l07=.L19ÇiqÒ1Òc=ã0Õ2ÅAFTE1.YC8åSÛC1:úí5ÏFsÆÛAýXtFu1ìFx8ÎÅBÑAgBÚt5ù1tÎAd.Î5oBßý6aôÙÝDNCóHVD2Ú9VPFÏCTi`4Æf7ïDÒ5Jî#K8Åô18pmDE_Òd92Û8Ì"Aó"õå3g9Óæ509U9ìC6xhC2xY2GE7æmíÈWS0DÙAÅÚ9ÉM12méR`mEä`ÇB9ò3r19Í0Dú509AïEÅBDCÕD8t0Úslwú*FÇ7Ä8Q86qC8ïE>88Ü04ÌCÙE.3Hj6ÚE2j5BòÒÉÇüç9ÿ/äÎÄJ3É>Ò5E`Å42&ãCÀEÊÿsI0ÕDáh/Ö§ûÙHH*6tIî6UpÈDQDa8ßAÙD4Ã3I@`Å1AÍCÒhA6Q3ÅDì98ùVéíñÙÝ:Ôï4eùNEht:AqoEäó1ÔDoÇ4#ñ1í9z2ÇDÿDÈBDs5Upfÿ9Y7§oè6Õ6ýÕ446Á4LqÎEÃ2yE46J*äÏ#Îí0ýÛ3xEü2ó1VÉîÑ6YV3B9bB9aÇèòèÂFÕBÙõÒu9KB39"ÑÌÌ1eì1Ò1ÒòQÒ1ÒÌ7zCPD5qÎD4Él3Æ1ÍE3nÍ8õÑ6ÍiA6vÍe2ïCÆ86óïD5BÒ8M046ùBæ867L1H5FÏÕzuFkçC8fËÚ1Æ8õÑ6ÆiA6vÆe2ÍEMFýí<5ï1Æì97Æ1sEÄ8ëÇ0ÎÒFÝ0ËÚ1Í8õÑhÆd47Æ0MÍC§8Ô8ú67suiBAå1zC6K19Q9tA=qFîôgKúuÓ02Ò§UUKQ0ÜC1y8Å0OígïLúRÀ4ïÛwrE~údD5æ5à1i9æÚ4Aõ9eB92`n54FuèOÒ7ÒÆ09;ýÆqÅuÆ0QÍCåC4U6Î5àt9;eDvk0NÒóBa7HÿeÁUH8ó@8NíbÎ3dE8íÂykv8IC7iÍCM9«Í<4Ñ0Íì87Í1vÎ12Ù5ê828ê0uÍÚ7ñóÓ6l0a"B37h9Î37ÌPsKCÔ_AÚC12lÈ4ÌG36îÉúE9çn8ÍÂyrïD8Ñ2Æ8õï5ÆiÖLÆe0ÍEïCa8fE6aå0æÇ9f1A8SEC&MàÎEFÖä8Åå#BEÓÛF§6Ç6rzT4ÑDäíñH5>Ç#LúRÀuF;ÚCÆû9ÎMÍL8æDÍì/7ÆÃýBA@ÓÅ82gÎDT42mÙB8k88úw9î5AÃí54LúRÀ4ÕÉFhA/Î3aJË5QóõA8ÔEý3òO5Ú509ÎãÔÖE^cEQDÜíVSÂÍÂã9FÄ8ëÇ0ÎÒFÝ0EÉFhwÎ16íJê86cÁÆ0Õ5>8Æû9ÎMÍL8æDÍì/7ÆÃs3Ä8ëÇ0ÎÒFÝ0Ë8FhwÎ16íJê86cÁÆ0Õ52ýB0Ô7Õ2çPFjEõKT7ó9gòDkýDECs3Ga1VúEãüfD2P:ÈWx6ÔEH*Íç1AÕzuFkçCûîCó7Í09;ýÍqÅuÍ0Q@Í8õï5ÍiÖLÍe0ï9FÒ1Ñ4LúRÀ44ÝîC@M9«Æ<4Ñ0Æì87Æ1vÎ12Ù5ê828ê0uÆÚ6ç»ç5íÂyÝîHKAÓÕÏmåZ6ïòâAg0KÝî4ó07ïKÔlCíî"047mÏEÏékõpBDE4p47tEçý7ãRàgÆ^6vt0öò*8O0Æ5LoíÂyÇÛjGC1ïD5_Î6cz8ÆB7aÆ1vÎ12OöpÚ6ï3ÍìaÍ1sÃ7L/§ÎauFkçC8ÙZFLAvCoshÎ42FzÆ53ÆÚ3^CoÏt3Ú5æÊíDç3ÆÚ;/û5B#k4SE7Å052FzD1ÎÒFÝ06Äô0ÓîBYwAîaÍe4ïû7ÆÈïf2ÓTBzD6æm0nAÕ53S2ùCFlA6mD8Pón0ÑÛCEXÔ08MB^LD6x08ÕO08Î4ôÊM0ÎÒFÝ0p55EC7ôÆ0f1Æqj4ÍNxÍCôê13Å6qÆ9â6ÇÆe4ÍEï97tE9w0Z887ãÂ8ö7ÅwneÅd2ëÇ0ÎÒFÝlàÍ8dï8bÎ4ãz6êBE9ÍCô07Úó8ÍiîÇÍe2ïTËyDQu4ç5íÂy9bREC6ÄÔDï#Í3ÛDõÍ0MåãCjE3çÝ0<ÖÉæÏ5ÿ39õCk4ÑCÕßÑ18î5BEQf0Gz;8ìBbBE4Cí0FiO@ëÇ0ÎÒFÝïW8ùWxÓ1ó67u8ÿ3ý6iD2ñBÜÍòW8oÔ`fÔD@ÍCMDýí<4Ñ1Íì97Í1AÓENÆ8Ãí0ÑDSkWCÚFç0Ö1ýB^3ÔkaCÓbx9YUÝÇõí>ÕzuFkçCÃÑDG.Î12ù5BÎ828ÍõÍÚ1Æ09ÏÆqÅ47Æ0MÍCåpB8ÔÜÚBo8î2Ýç»ñÎï4tÕQDFnÌ8jQ87ÅRE3FgõCc05BClFÝMHcCFqÆ8õæ6ÆiÖvÆe2ÍEïCa8yEcEÏUÄCùïÚd2U#lÇà8>Å3YÑî6îÑO4ÑñJ2ÑAïÅ56QB3Ñ1Ù6ôB1IÝ1_EAå3&KEC2yk3Ùd1óÕÔ9k.0Ó0f0wÙßP5BýLàP3ÎB"0ù9aBf8ÿÎ2õAóCO47ïCóò~ECJBqÌ0YÖmÎ7ït94Ag05æïFÝ0Ag2ãLD6ÙÓDúq2î2xIÄCGâDE3BhH6WÆ16ú5Ásuå7ç02zÆ9ÿã0Ô939s1ÿ0EAqEöDÌ0ìEÌAÙD2ÇúRÀ4ÿù3B2ï4XyCuB"ÕQDSBÅBùeFLAkPÂÔû4öåDÏP3çxÍD9ý1AÃ8X§4FX2yk0FwdÎZÔk2/0í6æB~ÉÍ8Î97ÆÃzBÎ1hÔ8ê8ÅÏê06KÆH57ÅA8oÊa39FgÍCÆ2ý1n5ûvÜFkçCÃ9MÜÙ9Íû8ÎQÆiæÆeB2ÆÛ4éíÈÍ<7æAÍìD97ÆÃs6ÄaEý4íkçCpECUéíÈÍ<7æAÍìD97ÆÃvÎ1hÔ8ê8ÅÏê06KÍH56ï»ç5@ÆÂy5Ú5BCÔ8Îly3Õí5i=CÓçÆD9zÓWòÓ1ò1ã~7æ9"ÌPKÍH5h3ik0zELàèïAeOD2Ò5ç5@FìBÀ4ô6n07qÆâ1úuÍqùåÍbÿÍE>8Íû8ÎQÆiæÆeB2ÆÛ5ÚÒ4O5@ÆÂykTÚ9Íû8ÎQÆiæÆeB2ÆÛ4éíÈÍ<7æAÍìD97ÆÃs6Ä8ëÏ1ÎÒFÝâ^3Íâ1úuÆqùåÆbÿ>ÃC6Ä8ëÏ1ÎÒFÝâÔ6W4Ô7tÝ06ÔáúE9fÀÅfAy4ÓEôBw0ÀôpZ0Cgó3k/óúã98ÍûoEMÆL7óDÌ97ÍJÏENaìFì9AÍ4Ù5Yp:2lUEîDÑE38ÛDAÓ58çFTçE8ß2n^D"îPQE_0xüç1llFÖ2ý2Áwì5ÖeBv36mFiÎæDg8Wc9H0Q<À94GEjTJú4ÃBýE1~d0oKNÅÏ9ÍC>ÕB9uFTçE8G6JES38ÓÕa:1oõÿl042ù52í12òî6Ñ5NùÎ94õDÙBCALJMÎFbÑlFÏr42x«íDbó0ÆìÁÆ0AòÊQz4Cû5FõBEÿt0#UEqO2ûÚvúfEßï51lC2@îD7HÆ06ÑVÅ5eBc1óòcEí9äõò^KÅC1ì7Çÿ3úxÓ3ãù1iåcC6ÝéÇCê8ïAç7&fEßôù2ÅCEP8îJÕ12ÔgB1T0æûÑÍ4xÝ3Í~AjCW>ÓZ2ìIeÏB8lAR09xç7&FrwAy<g5#7åèOÛB9Í0sÊõÆ4IfBÆ8ñ2Æ1ã0Ó2Í<VîÍEÌõd5çt8í3AyDÛÙ:EoDÛB9Æ0sÊõÍ4IfBÍ8ñ2ÍÓã0Ó2Æ<VîÌõÍCd1ÑBLúfEFqÙ:EoDÛB9Æ0sÊõÍ4IfBÍ8ñ2ÍÓã0Ó2Æ<VîÌõÍCd1ÑBLúfEFqÙ:EoDÛB9Æ0sÊõÍ4IfBÍ8ñ2ÍÓã0Ó2Æ<VîÌõÍCd1ÑBLúfEFqÙ:EoDÁíâIúÙ26XJEh93YrÎïeÍ0sÊõÆ4IfBÆ8ñ2Æ1ïD2W36FbX#dDnó_4c6oòhyCFÿÂp8Å3ZrD1ÑBLúfEßx4vjCE9Ï0Í4Ñ5Íi;LÍäE»Â7«ÍDbï0ÍìÁÍ0AÕB7uFTçE8GÿDüëãuÎÅ5êe9A8êbBÆû1Í0JEýÍ=ÙuÍñDFÏ<Îó`iEÿDüFîuH3Æ1IÓD59nn127=8í51OÒÁÆ0JEýÍ=ÙuÍñDãÚÔgçí5~4j9jßc6ÿÈLMDéÇo92ç42Fæ1ÑBLúfEFqÙ~î@4G9Ùl4ÒÒòE1ù0WqS;zmL6æ»Ó8ñRDpÃ1OCWæAuC1FsÆ<2ó2Æì57Æ0«Fî<Îó`v1Ý8Ñì2d2û"Ï7Í8uÑp82ï3Æì57Æ0«Fwi6zåC~1óB7ÕJaCÙú9mõfBuFTçEûÿMÌr9î5BEQEAãl.§AÝ5Õ7ít.FÏ7uAÇ9XÚ94Ï9Ô6ïE7ÚFMAÌúOå9Î187Ã67kAò3=DjGò36Ý12í4Ó9uFTçER8ZÇ7U67ûú5BO9«cÀ7w=Õfñ9xùßîÖc7ÏMdKó6y4ó2Üb1Ñßî5CúIÓ3Ì02ÅîwÆn32Æ13òÍ0sÊõÆ4IfBÆ8ñ2Æ1çÝ8í3AyD1Ýp1VA67õ7Õ2OÕD4äDw^1Íhcú«ûCú47æ8FÂ2ô0G8n1qs9ÍûoEMÆL7óDÌ97ÍJvÎÛ87JêûÁÍM2@FÏ<Îó`AxFm`ÍÈtÀvÜÃ3Ã05opp9oÔÍÑý09_üüCH9J2òEòïæ'
$Res_Leiste_Oben_Hintergrund_Comp &= 'Í0sÊõÆ4IfBÆ8ñ2Æ1ã0Ó2Í<VîÍEÌõd1ÑBLúfEFÒ27ÛB3LäCùûã9`ïà1F;7ã9ßÏ54Ô6P26Ú#2Ô7æ<4íà8õdÉP~ÔAÜ6ñBqDS46R094hFMAJ6IgßAkyDx3ByÏ1ja98Z0ËFZH59ÏgÔ6Î2Û5by0ævep_xÝ7Í~vÎÛCX8ê8bÏêñõdÝK19òVB9AyDáÝ_93V;ïÛB3Í0îÊuÆ4ñDåÍÇ2@ÆûmEQoCE#Ï0EêWÇÆ0zFÏ51Îó`ÄtwB3PEæ0ÚBim8FzÍ3Ã9tMiCçEhr1ïÏ7Í0DW4Ü46fiåUCÚ<5paÆÿzYÔ6ÎZÌ9ç0óèEXÆ4xíDFïvH5â2WfEß6Ïý2k8NC;ZÌB3Ñ3nÏ9ÆûmEQÍAÌEæÍä52ÍÓã8Ó0ÆDÌóAÆìx7ÍJAÙE>8Æ3AyD1937w1A8Ï9ÍûmEQÆAÌEæÆä52Æ1ã8Ó0ÍDÌóAÍìx7ÆJAÕæ4íTçEûw06/4æýeEa=ÎÜ2Ú9"Y6åjÎ^X8Ü42aqDå04hÎÊÇ2§ã0ÔmEl1tbXí5æ>4GUÿE7Í~ýFÏ5:5ÔDçEÚ2füAã6êÛCX8ê8bÏêñõÍCd1Í0îÊuÆ4ñDåÍÇ2§Õæ4íTçEpÀ6ïÛB3Í0îÊuÆ4ñDåÍÇ2@ÆûmEQÍAÌEæÍä52ÍÓç§8Æ3Ay<5ü§8c0g9Aÿlv6í3î#ÎÛCX8ê8bÏêñõd=Õ1AÔJï0cOeÏfDP.IñÍBEç«vÃv6åTçER8æ;8ÙAã6êÛCX8ê8bÏêñõÍCd1Í0îÊuÆ4ñDåÍÇ26aEæ4íTçE8R9ÚÒUã8Ó0ÍDÌóAÍìx7ÆJí87PQq93ifíûpaÆÿAÕBíTçE8;ÅÛAÚEbÓ0zìNEfEçCôÆ13Ò5r7ÇúKEFÒ7ã39Ù:ü6vAÏB=wBÿ9Ûn0ÖåD7vp4ÉÛ46Û46ÌßAFZNOCç9óKò3yB>Í3AÑCEæEFwB6rû1ÒÛ0=51Ò»ñCEú4Cæ126ä9Õ3cj2ý0FLE3úãkAß2ÓïAçBW3`k0ìc13hÕi6åCEÏ9úK7uèÓ"AÃR44üýc1ÑÛHAÏCE3moBç2ÇAã3dÏ51Ãj3BÄÛB0JmFIÉÑÅ§Å4Y55BWAÄp:4eÃæÒ5xV94«ò3V3xYSæ188ÅÓH3irûCîèÝånýD9xGS9ÌDÅ3Ïåù_4ÙOVôBÒôs1i8õ1YFY54Ûýw1FTb2FÝ3ÃAãa4a3eeDCÑ«Aó2fDEÿD2ýóE*YÄÃãh&ý3AÕA6ëÕa0DCAÝUkOE~CP555AÃÌÑÙ2ÑÉóRÒ9i&EÚ/8Õ86sgìEAã"Ù;f4S7çCÓ1Å4b.çÒ6ýúòD51AÅLEÛ3ptpÍû2lgÖ8æÛHE.6Ã4Kém8b396öãüIú5ÚEî2õ"C8ÅgB6Í>LZÚã9;ü7z2ÝdFxE#îúÒBã0e9j5HüO0j07§y9Å0ÎÛìòrÝ*4î5Eò0À;ÅÙ47Òb4sÛ3îzzBÒüE1ç0ÉmdR"öL.xCÝìà0>/98cFIPFgHPE;ICò2ò3"2rDMÅ2béû5ÕUP1k4ÍB0dOCOÒ2Ýõ7öE7ÛVQAxÜpCn558öÃ4AÄ8ñYE4&ÒÉIè4eK1Z6m9ù9AGÃd2ôÅ"vV/KÉRQlBe4îDtC7ûgP9Ã8ÇCRLÊRÕ9kB3P3BÀÇ92ÌV0ãýB37oDAvzsÏBù12*Fó7Ï0FÒ&9r«FmÏ§ÓBAý0DÇC7ï7ö6Ú0#2hl1F>eFÏ3ó2/h4m`gB8ïonE19Y8ïC*_m4CEôD4txRÒ1d9ÇÈ4ÿG4eEgÃ4wÇç06Kóá2&Cì1Fnæ1Õa1î7ñ_àG0à9ù5ICs8õÝ0ö7æ9_KCÈE47zE2æÃ8ó36Ã8óBÉÏmZû"0EvQç0óÎ557j58ïBQ1O<8ù9ÂpAe.0C1Ñï:9î5ÏB1OD2Ò1xw47n#9"4va42H1ÒÛkä51Ò»Ì557æCÇüCFçìçÃBÛ5ÿgjAÍmEb2ÝO2î1ÏD1ÛÀk§Ã«ë«eý1Õú53Ï2õTn6x6Óý3ÜÜP7d5x0OpB7ÿÃ09ÌÜ56ûa.BD5Aßãò2Ò0AFîÎí4Ï2æÔÉ8nt6FZ7ÅI33FT5>ÅD8O9IsEoEZCÿDSFn§æÙFãd^26P42`îEIÕ1ïRH8Grí52q1FgÝP2í0D5CÔÿ9g9ZJCË18íûô1Aô1Q04Cõ3Bk8Ú5q1ú4w4çÖô1PôBáÆ0Ã9ví32ïUh&Ù3ý0EåUp39ùB2Yy0l3ÿRBÓ8/ÚÅj6ï1äRÔ8ÙòÒ2ÝçCnÝç42Ã2Ã9ZÆO9'
;################################################################################

Global $hImage_Leiste_Oben_Hintergrund = Load_BMP_From_Mem('0x' & _Decompress($Res_Leiste_Oben_Hintergrund_Comp, $Res_Leiste_Oben_Hintergrund_Key, $Universal_Zeichensatz))

;~ Global $hImage_Leiste_Oben_Hintergrund = _GDIPlus_ImageLoadFromFile('Obere_Leiste.png');#######################################NICHT ALS RESSOURCE VORHANDEN#################################################

;###############################NÄCHTE_WELLE_BUTTON##############################
Local $Res_Welle_Holen_Button_Inaktiv = ''

Local $Res_Welle_Holen_Button_Hover = ''

Local $Res_Welle_Holen_Button_Pressed = ''

$Res_Welle_Holen_Button_Hover &= '0x89504E470D0A1A0A0000000D494844520000007C0000001C08020000002C884CB3000003D34944415478DAED58FB4B544114FE42C47E088A6241C37EE8814106BD9088C2324B2C29B50229B542220D8AB2429224232C252CF3B11999B6F95C5D1FBBFB1776F92EE732B377EFBD93A122CC6158E69E993973CE3773BE9959C0CAD648D6964D2C16740BBA05DD160BBA05DD966D017A0AA8011E6C67B07242587744B9A0A78106A092BF497DBEAB408BAFE733A5123ED30C278A6D2E4CAF808B405C57BE6180B775652F9583FF12C2BA23CA057D46B9BCB7844296A4E68852D920D097806AA0795DA03FE2A44DBAB24402FCAD284F53F3790B41DF21FAB9D009268059BDB211A0FF4F8A8C48206965093DE916E59A6816B710F418A94ADDECFE0926814EA01EB8446A6B037E28ADCB401750075C015E909D3C0BF3C063E032137C54199201DED36015D0C1045AE51EAF10272BF5FDEED87C09D492F79ED0AC3FBCB48CFD269A2105F45A518EEBC91A64D9047413AF02419F93A6E97C132C05FC9DD0CFD60525855DA9D2894B9521B1D9A8EBCFD04E8EEC97CE8E7BFBF4A6424EE18FF01A5BEFC9E77331EE4A4658DE91FB5196234137F42A10F42CF7A347883913AC00656C72CE9FAF2C6DEC50C1D63BAC1F06FA8001A642B902FA6EA087EC79829FD51CB228AD9F789A3509BE711A71A40818067E8A030D543A94FD85A66EEAC8AAE51D9B0A04DF1A7E0ECA74E354D6CBD4E196234137F42A0CF494B4260252698A1BC7250497048A199B2B7F949ED30AE8493DA94B858E5C6997E3613638B6B442386E71776E593ED0BD941DE1E74E66A1E764279531D6E7A32C87836EEE5518E85EDEDDCA17794F3EAE88092714189C87399AD78A9D1B64B0A081F3014C7520E0E03ACAD6562E24B81FB3A45D47CE8BC3A50696C34137F72A02F4B4B0F3A8AE5F53AE95033CA6FAA44352A74B73D0DDC3B95586370677F3B868582F8900D0DB85A0FA59E9A2F2AD18F9C8DFBB0696C34137F72A02F4AC387A3D605557E4E2D1AB742864FD83744E30EC70D0533C429685C7D50D329B6F158B7CD7EA319E2B79411F130BEE653C2E5EB952AE7B1B623992D30DBD8A06DD29A714F6F0AE777B65FB9C05F6E81D9ECAE731E0A4707D38E81EF39E0376B152E7CB2AE74A7741BF8438728843DC3B434900E8693DDF57441F5394330696234137F4CA08F451E97650517E57B006AF283119E804F9508FB33B0AF48CDC2B5C39AEBFB6DA9555F456BD439FA234F43D59AFEC6B4FD92CCA62FDB9106439127443AF7241CF10CD295FBF04A19FF1EDA05FEC3F27979909FD9930CE17D3AA6279D237D7A4BE0CF1006A4EB029A52BD7E8405CBF2905FD571567B22FE82F3857E97FC2E4B59CE3B0DF7F43AFEC5FBBF6FF740BBA2D16740BBA2D16F46D09BA95CD95BF13B223EA3FE3B25A0000000049454E44AE426082'
$Res_Welle_Holen_Button_Pressed &= '0x89504E470D0A1A0A0000000D494844520000007C0000001C08020000002C884CB3000004254944415478DAED585B4B554114FEFE446F3DF5D283D0434F1144103D484488D4435014072CEAA10B05197423228A6E5674A1CC0AA2D40A892C28BA22459211A611DDAC4E46669DD25399967A1ABE611D66F63E7BEFC9501166311C66AF9959B3D637B3BE99398097D1919C2F23583CE81E740FBA2F1E740FBA2F6302F45EE02070612C83150861C81105411F004E00BBF8FBD39EEF005013EA79DDA8C4CFD4C58952230BD31D603790B695F718E0295BD944E5F37F0961C8110541EF322EEF35B190FDA466B5511926D07F011540F59040BFC449CFD8CA2512E01743B9999A67A308FA1C600A3009C8C64ED00174DB95E100FD7F52E40DC7CE623AE697302FF745D9CF6095F48C22E8295295B9D9C3137402B7804A600FA9AD0EF860B4F6010DC051603F7093EC94B7F01DB80CEC6382BF35860C028F68702F708509F4877B7C2B074E66FA57DB8C771B3844DEBB4AB3E1F014D6D339FCB5685E19A01F1265BB9DAC51965D4077F12A12F42CE39C087C2B3481DA2FE30BFD9DD0CAD61F460A6BD92B16A602C5867E1C51D036ABEC215B6827204BA5B3726FB1DD54CA29C2111E66EB39F9BC21C695CCE44A6B9657723EC97222E88E5E45829EE37ECC13626082DFC01A36A9F3E7254B1D3B6C65EB69D65701CDC053A642B9715A2C001AC99E1BF859C1213DB2242D3CCDCE08BE691A51321768033E8A0327A85494FD82A68EDBC89AE5219B4A04DF83FC7C2ECEB45359C97A4B92E544D01DBD8A035D65CA6CEEE84C442A7DE6C6D184A049A08CB14D63FDABD1F39B5828362E453AA997091D4DE467BD1C0FDDD1B10DF0C82922E1E8A277EE9A42A06725C637FC9CC72C1CE43607193247E32015C45B8E07DDDDAB38D0F37977B250E48D248780A484134A1CCEC380E6AE1854BFC7C8605103BF47FC57BA3CE2E05ACBD65A2E24B81F73A45D253BC4E1650E96E34177F72A01F401EE8BF13CF14C7D3FA9409FB44F794C354B077D839C21E9EC0EBA3E9C6BE5E8AB8AEED6238CDC66974C04E8F54250ADAC3450F98075756979C2CA5907CBF1A0BB7B95007A4E1C3D5268556790DCF5C5A3C9E850CAFA63E99C61D8F1A0F7F208E9131E373748B77DE8E9323774AD7EC773A520E8EF244C7D194F8B575ACA6D6F632C2772BAA357C9A0ABB249EE2A29E37AB748B6CF3660A1412FAAF59A7CAE0336726C5912E85941763B309FF5A3465615C9956EA77D0951B29243F49D614904E803C2E04A26C846C953B9962E07CB89A03B7AE504FA5B61DB1586F2BD8135784549C94015E44586A7651A9F21F1A00FCABD42CB7AFBB5556FAC627ED5AF08C5414839E63D5969ECEBBCB25A9465F67321CA7222E88E5E05411F249A9F43FD3284BE2BB4833EB17F562E331DF633A19D2FA63F86E5CED05C9DF632A423A839C3A65E5BD94F07D2F64D29EABFAA3493FD87FD82D3CAF013A6A0E580C361FF1DBDF27FEDFAFFD33DE8BE78D03DE8BE78D0C724E85E4656FE02A4868B595BBC19D70000000049454E44AE426082'
$Res_Welle_Holen_Button_Inaktiv &= '0x89504E470D0A1A0A0000000D494844520000007C0000001C080300000094342BD6000000FF504C54450000005959595555552323232F2F2F5858582828281F1F1F5454542222222E2E2E3636365151510A0A0A3939394A4A4A3C3C3C2929293F3F3F4646461212122121212D2D2D3232322B2B2B0C0C0C4F4F4F1919194545455252524D4D4D4949495757574E4E4E3838382727272020203131314C4C4C5656563B3B3B2525255353533333334040403434341A1A1A2424244848484747474B4B4B4343430D0D0D0909090202023737371313132A2A2A1111114242424444441515150707073E3E3E1717170303030101015050500E0E0E0404043A3A3A2626261D1D1D3D3D3D2C2C2C4141411818181B1B1B0808081C1C1C0606061E1E1E1010103030301616165DD23D8A000002A34944415478DAED956D53DA4010C7FF1B0C014C0C82A880111014095521F854D12AC63E5BEDD3F7FF2CDDBDC45C32751C3B7D6167CA4D86BDDCDEEE6FB3BB77002F3AE8C5C61C3E87FF737023B7F07710E5E0112F11DCCC5BF982EC2A96D4DB223F7A8F0DE7398825CB1551B6964554AC6AD6C1235E22B8CDA294600A58E1E749B8515BFD0DBE86751175A0C1A2898D3F80C34B366C7AF23C057F2C192DC0E4B0D85399A80D149E0D7716E4D3A30D9DAD6E2FB7BDC3B3FEEEA0B865F0AA3FAC2DB7A422AFBABDBD42BBB60F58F2EDC6D24171CF8F5C99C08868CC1E0F880249DD83360D4F5B24700FB0A30D467CED4EC8AF8BECD9F1C298282FB2E9ABD74322EF4826C776E4EB001CCF099A92813216B43605CF5824701A72C9D486FEE97A653CDEC63EBDC6D9F4BC77C1F037971B57A8713760525D3F24778AD968536259AB6E7411D7BF826B9372A802017539F6449B82672C349C3F388C53D338E9F6F651E73C86A2B455FD02DC501F187A9434076FB02CAB89D308CEC96BD15B31DB2207BED66A78D642C33953CB91CFCB28CB8E8FEB5477A9DF77BCFEDE7858F2E37ADCC40D748A92873CA7FF83CF6B5AABE1598B14DCACA325921BB5743E9AC229A8F6CDC0A95302BB4FCE244632C2183EC46C825DFA084CF129A5D5F0AC450A4E130CE2E8FA6456787A8CCF44E150C38D619F5C09DB8BE29AA9C3EC6EC770979B112E85C0855826DA54CD33166938DD4265E008B32F77325D642FB7A86B3833EFBF62A0B2B3F24D5A1B67F747A85372D824702EB81C1DAD4DC1331619385F13DF59047772C01C87CC1FE2ADACE1668EDF7F7A2AC3B860DA9E2A60729775D52AAD42794FB42978C622BEDB83867A0B5BEA009A9DC0A3C6A65C09C14E9BB51DB5477E6D372E70E81A22DA9D87057583B8AEDC1FFD48245A651AD9672CE6FFE773F87F057FC1F10B06C04A2F4EE05B730000000049454E44AE426082'


Global $Welle_Holen_Button_Name, $Welle_Holen_Button_Status, $Welle_Holen_Button_Klick
Global $Welle_Holen_Button = _GDIPlus_Button_Init("Welle_Holen_Button", $Res_Welle_Holen_Button_Inaktiv, $Res_Welle_Holen_Button_Hover, $Res_Welle_Holen_Button_Pressed)

;################################################################################

;################Rechte Leiste##########################################

Local $Res_Plus_Gross_Inaktiv = '0x89504E470D0A1A0A0000000D494844520000002D0000002D0802000000B57875CD000000017352474200AECE1CE90000000467414D410000B18F0BFC6105000000206348524D00007A26000080840000FA00000080E8000075300000EA6000003A98000017709CBA513C0000011C494441545847ED98BD0A834010843D50F007F42114ACB5D33656DAD8E6FD5F42B0C917630226C43BA3E10A778A03613987B939675DA594F27DDFF33CC712C6711C86C10982A0288A8B3D94651986A113C7311CAEF6D0344D9224C2E37902A2C7D28BC7E8D1F77DD775AC3F1BFD181E755DE779CE6A99479665AEEBA6692A3C2605448FA511440FD163EDD320FE38A33FC84FA28BB3D7228A22FA6B1A4C6D2505ECF999CC6B794B9493A2049816AF265F5B49017BB66DFB66FB351E0F3D48512DEEADF6A487B69282CD7A9887B8DCDB33DE5BF187B902E20FC97D73B7C8F774A9555555A428ABB9841BF2D67C53929928B7FFBF6FCEF85BE5317307E1B15F817FCCA5F6B39AFDC13C99892E0FB630CF9399AFD3E532D1B505DE0E871BC3D1FDCD2017836D0000000049454E44AE426082'
Local $Res_Plus_Gross_Hover = '0x89504E470D0A1A0A0000000D494844520000002D0000002D0802000000B57875CD000000017352474200AECE1CE90000000467414D410000B18F0BFC6105000000206348524D00007A26000080840000FA00000080E8000075300000EA6000003A98000017709CBA513C000000F4494441545847ED98B10DC23010451FA9101D82967DE81802D8801D6001A8610516A3A3E6CB08A4282236919123F2A3D3A539D93FDF77F9E71B51C11426147BEE70D3E63358C3BE9C6D02061601C1B59C1D0206E3789D80F9A8E7621E3E2E7002F9CE999E07C70E56205F18C712C6206F1C8103F3514F05F3613EDAFE0DCE8F21E687F453D2A5B38FDA3CF4D7F2D1480568CD734389DAF456522E15958045EDDDE6472315A0358F5FE110EA5EF0912EE2AEDB21D6ADF3A36BA3EB7A71BDB80F4AFF7FF4E57E2B65969437BB8AF42FC973DF4FDFEF53A471FC621EF477E7A259AE26BA4A9652B67DCE93355FD74B13DD52A6DD2B1E0D75A7C8B30F6BC20000000049454E44AE426082'
Local $Res_Plus_Gross_Pressed = '0x89504E470D0A1A0A0000000D494844520000002D0000002D0802000000B57875CD000000017352474200AECE1CE90000000467414D410000B18F0BFC6105000000206348524D00007A26000080840000FA00000080E8000075300000EA6000003A98000017709CBA513C000000F6494441545847ED98C10DC230100487167853425EF4828016E8871F45001D5003D000BC81126063894714119B28C811D96875F99CECF5F9CE6BDF88821263B27D0F386AF2056CE1940FBBC0815560F0CC8773E0601EEF1D703CAAB9D84D3CEE7005D9D699DE0D8F036C4036338F35CC40D63C420C1C8F6A2A381E8E47D3D9E0FC18627E483F255DDAFB28E63005D9A8A71C34E6ADA6444D7A2B29978A4AC0A2108949A012F59483C6BC7CC543AC7B118F741177DD0EB16E9D1F6D2FBAAE17D78BEF41E9E7475FDEB752664979FD5691BE926EDEFBE9F37DF2348F5FF483FE6E5F96A08EAE922517F6200E65735D3F75747341B317BC005070FA65663D83800000000049454E44AE426082'

Global $Plus_Gross_Button_1_Name, $Plus_Gross_Button_1_Status, $Plus_Gross_Button_1_Klick
Global $Plus_Gross_Button_1 = _GDIPlus_Button_Init("Plus_Gross_Button_1", $Res_Plus_Gross_Inaktiv, $Res_Plus_Gross_Hover, $Res_Plus_Gross_Pressed)

Global $Plus_Gross_Button_2_Name, $Plus_Gross_Button_2_Status, $Plus_Gross_Button_2_Klick
Global $Plus_Gross_Button_2 = _GDIPlus_Button_Init("Plus_Gross_Button_2", $Res_Plus_Gross_Inaktiv, $Res_Plus_Gross_Hover, $Res_Plus_Gross_Pressed)

Global $Plus_Gross_Button_3_Name, $Plus_Gross_Button_3_Status, $Plus_Gross_Button_3_Klick
Global $Plus_Gross_Button_3 = _GDIPlus_Button_Init("Plus_Gross_Button_3", $Res_Plus_Gross_Inaktiv, $Res_Plus_Gross_Hover, $Res_Plus_Gross_Pressed)

Local $Res_Minus_Gross_Inaktiv = '0x89504E470D0A1A0A0000000D494844520000002D0000002D0802000000B57875CD000000914944415478DAEDD8310AC42010856107D28CC57A880D583BA56DACB4B1DDFB5F24AFC805046102FBFE466CC60FB1328888AA7EFCC2E930042CA594CB2F338B310688B0F9F9D55A4B29D141071D74D041071D74D0F146C79CB3D67AEE0E333179C131C6C8391FBBC3CCDEFBF27D7C77B77C1F7CA774D041071D74D041071D7FE75055336B7E3DFFC9228225F985D361B801759D3A5FC10001290000000049454E44AE426082'
Local $Res_Minus_Gross_Hover = '0x89504E470D0A1A0A0000000D494844520000002D0000002D0802000000B57875CD000000834944415478DAEDD8B10980301085E187957D6AF7B17308750377D005B48E2B38A19738412070017F7810D25C3EC2554F9D14A4C12FF6BA19D2314BBB5F966C4822BB3C7E39B201070E1C3870E0C08103478B8E5BDAA4B1766C662C725CD224F5B56333CF22476CE43FD8531C3870E0C08103078EDF39426E740FBFAC5F9FDC48BFFE02DA87D21923D5D4130000000049454E44AE426082'
Local $Res_Minus_Gross_Pressed = '0x89504E470D0A1A0A0000000D494844520000002D0000002D0802000000B57875CD000000854944415478DAEDD8C10984301040D15F90ED2C9816B69FBD5984DA813DAC0DE839B6A0493A108404FCF02FB90C8F21A7A1831EBEF50A900C1931C2BF5E533164517A9CF55A8B41870E1D3A74E8D0A143478B8E0316F83D5D9A196F397618E0F37469E676CB111BD987FF54870E1D3A74E8D0A1E3758E502EBA6BBDE662C8B7EDD0C07DFD02E7333294C43E77C20000000049454E44AE426082'

Global $Minus_Gross_Button_1_Name, $Minus_Gross_Button_1_Status, $Minus_Gross_Button_1_Klick
Global $Minus_Gross_Button_1 = _GDIPlus_Button_Init("Minus_Gross_Button_1", $Res_Minus_Gross_Inaktiv, $Res_Minus_Gross_Hover, $Res_Minus_Gross_Pressed)

Global $Minus_Gross_Button_2_Name, $Minus_Gross_Button_2_Status, $Minus_Gross_Button_2_Klick
Global $Minus_Gross_Button_2 = _GDIPlus_Button_Init("Minus_Gross_Button_2", $Res_Minus_Gross_Inaktiv, $Res_Minus_Gross_Hover, $Res_Minus_Gross_Pressed)

Global $Minus_Gross_Button_3_Name, $Minus_Gross_Button_3_Status, $Minus_Gross_Button_3_Klick
Global $Minus_Gross_Button_3 = _GDIPlus_Button_Init("Minus_Gross_Button_3", $Res_Minus_Gross_Inaktiv, $Res_Minus_Gross_Hover, $Res_Minus_Gross_Pressed)

Local $Res_TurmKauf_Button_Inaktiv = '0x89504E470D0A1A0A0000000D49484452000000A70000001A0803000000E59CBC7500000078504C54450202020F0F0F1010100303035D5D5D6060601111116161613030302424242525252727272323232828282F2F2F1212121B1B1B1C1C1C1D1D1D1919191818181717171616162626265F5F5F2222221414141A1A1A1515155E5E5E0808080C0C0C0B0B0B0707071313130E0E0E0A0A0A0505050606061E1E1E8778D9F5000000F34944415468DED597D1728320104505951469EAAE0B09A925A16ACCFFFF612276A6BF70B30FE781A7335C2E0355A534FEA8BA524D8B3F8DA9F4E1C376CE39FB09CBE3D7A1AF746B8907162FB024DB164F66F2C1132CFDEEE906F2A7B2004A3997DC1D636B7A76C5F32CD89A34EC9E36606B3297F3192F82AD4972F9EF3B72F4E11DFB4E04CBBFBE77E1FB24A3FCC092BACD33F9EB4D1B957F6169C6D4BFDE4B539ED5BCDC1758E6A9D9F65334B6E6B286B4DD9FACB135EF9962F154D89A8BE2CD3351C6D69CF5EE19566C4DA5E5ADFA3E1AADF29A152CAFBEF4FDF86099020DB0F42E6EB9C7185393A0F9FA17D7A6C71F533F0104D4534FC119B75B0000000049454E44AE426082'
Local $Res_TurmKauf_Button_Hover = '0x89504E470D0A1A0A0000000D49484452000000A70000001A08020000005D20DB10000001C54944415478DAED9B4D6E1B310C469F7EECDA4E0D74D900CDFDB20B7295AE7BBB0041D1A5537B32B54565A1A1A2242728C3590D9EC00D3F89A42829C00AAE21E2DFA7F8047E67B8865F31E6102A004187ABFE3831426A45A4C06D8698D26ABFFF19E3230458A9C13F10C84EAC9020F2EDE9E9BE9498DBAA8FF131A53F9020A84181046B275648816710200F113FE9D8590D9C58223DE02F455C0BEC1104CE7081E4C42E795DEB0164080BDDC08919B2EE3BB53814F4EF869DD8237554BD0E41C05D63982CD93DABEA053224778D5D52E032AA1E20C31AAA3BCB2EA9903ED6F0C15D639AE45EC3C7A186FFB8B51727B6C822F7B27313698D9B8B86FA66306B4BCF89052222AFAA972287C33184036C86CCFF0C135C39B142CEB54E4DF80C15AAC8045B9D23CDE0043B2756480BF57F5B1F3E4280005F61ABC3DDA02F7D27FF3B99E0A4122FE93DC2172DE8DC59E6C99B2B347D46B86B2C4B3E7664DD35B6C9765CE15D75778D6DD2D2F7DC3BB255551FEB3D77963152618263BF4BD36AF8BD1EC8B4939959ABFAE8C4049961865DABE1B3DE9DFA011B2830C311BEC346EFDF38B1417670D30E60B24E8D3B4DF06DB98721F93BB1415A6FE60212600D37FE0AE233BD8278780157D2BE3B0FB205100000000049454E44AE426082'
Local $Res_TurmKauf_Button_Pressed = '0x89504E470D0A1A0A0000000D49484452000000A70000001A0803000000E59CBC7500000087504C54450000100000340000360000120905FF0B07FF0D09FF01003A02009001007002007802007601006E01006C02007A02008C01003E01005401005801005A01005001004C01004E01004A01005C01004801006A01005601004201005201004602007200002200002C00003800002A00001C00003200003000002600001801004000002800002001005ED0B45434000001004944415468DED5D6DB7283201405504122F5D254E08031D4A6152FB1EDFF7F5F15329DE91FEC9E87FDC0D39A03DB31CB18C71F96674C9C0AF4390999F1E2A92CABAA6E9E61F3FC52B4BBB354DA68B2049BAA494EAD95EB9C824D9B9CF545B93E1E8026D5D15969DBDBFD00367595F649D84C7549FB6C3A6CA6D665745E099BA9E8FADB77E817DA3DFA6EB0997FFBEE156C3EFA5E76AF3D0DF4069BFE7638857BFFE0230B136CCA41B4FBFF521B66B6ACF77501CD39B4E2D8277168E6B24E363ACD384333EFC12727C366AECC44A70FD8CC794C4E3B413317C629F67D83EFFB16F739C8E33BF5C960F3CB45E7F9DBD066BD814D57C77BFF0F23B35CB6F823F31FA8626830668C6BEB0000000049454E44AE426082'

Global $TurmKauf_Button_Name, $TurmKauf_Button_Status, $TurmKauf_Button_Klick
Global $TurmKauf_Button = _GDIPlus_Button_Init("TurmKauf_Button", $Res_TurmKauf_Button_Inaktiv, $Res_TurmKauf_Button_Hover, $Res_TurmKauf_Button_Pressed)




Local $Res_Leiste_Rechts = '0x'
$Res_Leiste_Rechts &= '89504E470D0A1A0A0000000D49484452000000C3000002260803000000D9B7CE8000000276504C54450000004E4E4E5C5C5C4242426565657878786C6C6C1515154A4A4A8E8E8E707070EFEFEFF4F4F4F9F9F9C7C7C7E4E4E4EDEDEDF2F2F2E3E3E32727279D9D9DDCDCDCB1B1B1F0F0F0626262444444F8F8F85454543535354C4C4C3A3A3A2E2E2E5252527F7F7F1C1C1CEEEEEE7171712B2B2B6969696E6E6E5050507777774646466F6F6FD2D2D26B6B6B7373736666668686864848487B7B7B8080807D7D7D7575755F5F5F8D8D8D383838B0B0B0FAFAFADADADACBCBCBC9C9C9E0E0E0838383F6F6F6BFBFBFDEDEDE5D5D5DA3A3A3949494F3F3F3CCCCCCE7E7E7E6E6E6ACACACF5F5F5ECECECFFFFFFE8E8E86A6A6A818181D9D9D9E1E1E1636363EAEAEABEBEBEE5E5E5E9E9E9A7A7A7222222B5B5B5858585959595989898FCFCFC8A8A8AC0C0C0C6C6C6DFDFDFA0A0A03D3D3D9C9C9C7C7C7C797979B8B8B8848484D5D5D5898989C8C8C88C8C8CABABABD0D0D0878787DDDDDD969696ADADADEBEBEBFBFBFBB4B4B4E2E2E29A9A9AD7D7D79E9E9E919191D4D4D4BABABAB6B6B68B8B8BFEFEFE575757C5C5C5D8D8D8B2B2B26060608F8F8F7474747E7E7EA1A1A18888889B9B9BA9A9A9595959999999BBBBBB5A5A5ACDCDCDF7F7F7BCBCBCD3D3D3AEAEAE929292D6D6D60101010909090E0E0E3131314343433232320A0A0A0F0F0F4B4B4B24242404040423232339540A0B0B0B3939390000FF000040000019000033CECECECFCFCF555555B7B7B7BDBDBD3F3F3FD1D1D1F1F1F1FDFDFDA2A2A29090909F9F9F0202021010100303031111116161613030302525252828282F2F2F1212121B1B1B1D1D1D1919191818181717171616162626261414141A1A1A5E5E5E0808080C0C0C0707071313130505050606061E1E1E744C26DA000008404944415478DAEDDC8D7B53E519C7F15BA5AF69174A0A859696F5744861E54D66148A452896301813C64B616343188A88730C863A701BCC226EEAE65E143A49ACAC221B6CBA4D57EA7084B43AEA86EC3FDA495AB7BEE4E43CE734E79CC7F2FD5CE53124DCF7951FF935ED156A44B2BBEDF63BC4B549058545CE268A4B4A4A4A25CF4265E59F733D1C9E5C3125E268A2B26CEAD469F9CE50357D46758DC8CC5A913BEA64D60CF3911199556CDEF2F9F4259B0CF54643814C2FF8C26C913B67CFA913699C5B50304BE67DD1EAE1A96C328F9AF90B16CAAC45D3CD8B8B17D52E909ACCC7E03535F3E7DF655E6F2C29F9D2DDE6BAA8528625F754DF2B4B972D6B96E5F7494BB5B122248BEE2F5F69DEB2AABAD52EC3EA07DA6E9335B150A84EC26BABAA667E79DDFAAF6CF8EA83F7576DB4CAB0A9A4E46B95A1CD5B22B1F0BA253233B4757D533A98F931784D65D5B6EA76D9DE3279EACA98C88EAF2B65288B7DC36CD4CEC66FD67EABADA8AD65EEAE8764F79EC2EA6F4BD55E852E2D6B37FF533B37F4B084DB8B428FACDAF76859A9ECDF7157DB42EB2EEDADDC64C863DB4A0E1C90C7C3D2FE6986C16B2AA718DF7942BEBBD91039B8C2D85DA4D6A5CC79A7544C37CABE7770DAA1C3F5D25056515133748B4D97E65445E450F586EFD79B97656BFD4353C247449E9C1C8BCDCFD1A5F4B133F389F1D4D39900FBD3E7E035E6851F9897D38FE3D1630F3C23EA191A7EF8A31F1F9713B11D77AF0D89FCE4D98EDB0DB50CF2F453D2B2E3645B2643B87ED591E726197262F9A9827B6D32442B9E3FF99CCCA9DEBBBB497EBAEE67AB9A86AE197C4CA2E52F9C5C507478ED24A50C9B5E4C9F2FC50EFF5C646EE891A298F9ACB1F06055D571D9F40BDBE135A5B268973CD6B2FFE5D2F4E535A5EDBF8C35342C9EB73CBC754EF68915E927A547D3C7C963CD4B450E1DDBD52445BF6A7A7EDAD035E66DE99BEFF975F3B3F29B272500BB573EF84AD94267CFB64D9637BDDC1E448653AF869B773A1B5961FDE5E2897982CF80D3673'
$Res_Leiste_Rechts &= 'A559D39ADC9EC68677EFB9AAAB3714D6647EB7CED455533129ACC92810C647098A1F1F546D7F7C38759A50C75913AD7F7C38759A50C5D6F9C737D3F7C98250319F296E1772339DAA5C92C5D220319C84006DF3234D6750DD32DF1E1BFAD6BCC793F7C9FB5C8F07AE48D61CCEB87FF36529CF37EF83E6BF9389C1B262EF1E1BFB5FDBBF47996CF693290810C64200319C840863C647833F2A6EBFBE1C3ACDAEBDEC5E378EDDAFB59FE0D850C6498D819CE9C9DA16AECBFF507343BFAB5FBD3F184AAF8694D6627E2CFCD9C774293D93119DE7AEB82E2C7EFCF6B323B3683F2AA2CF72398D93119D4575D38AFC9ACDB2E99AB5CF721DFB32EBB945EE5B60F799F75D7A5CC2A977DC8FFACAB2E0DAE72D7070F66DD74696895AB3E7831EBA24B9FAE72D3074F669D77E97FAB5CF4C19B59C75DFAFF2AE77DF068D6699786AD72DC07AF661D7669F82AA77DF06CD6599746AC72D807EF661D7569E42A677DF070D6499746AD72D4072F671D7469F42A277DF07456BD4B635639E883B7B3CA5D1ABB4ABD0F1ECFAA7629CB2AE53E783DABD8A56CAB54FBE0F9AC5A97B2AE52EC83F7B34A5DCABE4AAD0F3ECCAA74C96295521FFC9855E892D52A953EF8326BDF25CB550A7DF067D6B64BD6ABECFBE0D3AC5D9772ACB2ED835FB3365DCAB5CAAE0FBECDE6EE52CE55367DF06F36679772AFCADD071F677375C96655CE3EF8399BA34B76AB72F5C1D759EB2ED9AECAD1077F672DBB64BFCABA0F3ECF5A75496195651FFC9EB5E892CA2AAB3EF83E9BBD4B4AAB2CFAE0FF6CD62EA9ADCADE870066B375497155D63E04319BA54BAAABB2F52190D9B15D525E95A50FC1CC8EC9A0BE6AECDF6540B313F1E7352602DE6F86F79BE16712C940063290810C64200319C840063290E196CE30F27D5F4671F49E313ECC5A6418F9BE2FA3387ACF181F662D1F8773D61CBD678C0FB37C4E93810C64200319C840063290810C6420031982CEF05978BF996EBB9FD770F2BE2F01CD0A0000B8359DCF9FE03238F81FEAAD3FD2234166C853842033E42BC205DDBAE422826E5D721341B32EB98AE061976AFF70F199C5994BC5FB14BBE42E82878F4361D9EA63AF662E9D7D5CAD4B2E23789961BD9CDA20978E1CFA63CD1691E32B2FFE49269DD8F2B67597DC46F0B04B85E5EFFC79A914FEE5C01E338D6C5BB3FAA81CDEF7CE7D965D721DC1D32EED79D83C1B328F48749D794DC7B28B1BB75975C97D046FBB34749ABF2E55CF14B954BEFAAF472DBA348E08177CCA201B375FDC22CD53CC236B97C613C1C3C7E1ED7733E7D1C15F9192F75E91D925EFBD9BB54BE38AA0C7D7B8F145D0E2FBA57146D0E1FBA5F146D0A04BE38E107C97C61F21F02EE52142D05DCA478480BB949708413E0E13E0B5190000E0A5BF257AF497B89C3343A2B5437FADBD3933F4BCFFF7AE2B9148A4EB9CB6E707FF78FF6AEE0C1D5D49E39A91EA4B697B26BB3A6C331846B2AFBF2FA9EDD9679F21722DD9F761E60F6B7AA63EB2ED52C4D03B429F11B1CDF0514AEF08C96BF619BAFAF58E6018B69F0FD1ED29BD232453DBD59E9774AE53FFADF4BC944C6A7B2A3C2F5DE9FFE787A9EBA9226DCFE415BB0C037D1FFFABA737D1FD6F6DCFDEEB03576DBE6FBDD1DD99E88C7F12D7F6ECBED16AF738A47AF48E10BFD93F60F7F5C1E8D13BC227DDC9A86D8684DE11E209C32EC340B25BEF089D3DF619FA6FEA1D21D193BA259E97AEF7F624BA6F7627B43D3FEEB37D5EFAE03F46EA467FF29AB6675F246AD7A568343AD03AA0F569F3DACCE5DEABFAEBBDCC8B99000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800EFE0B630CA19310FF2F670000000049454E44AE426082'
Global $hImage_Leiste_Rechts_Hintergrund = Load_BMP_From_Mem($Res_Leiste_Rechts)

;~ Global $hImage_Leiste_Rechts_Hintergrund = _GDIPlus_ImageLoadFromFile('Rechte_Leiste.png');#######################################NICHT ALS RESSOURCE VORHANDEN#################################################

;Mausindikator

Local $Mausindikator_Res = '0x89504E470D0A1A0A0000000D49484452000000320000003208060000001E3F88B1000000464944415478DAEDCF010D000008C3B07BC2BFB6A303D22513D0E4536DE7F220202020202020202020202020202020202020202020202020202020202020202020202057201F5A9A5CB1A500B3A81D0000000049454E44AE426082'
Global $hImage_Mausindikator = Load_BMP_From_Mem($Mausindikator_Res)



Global $hPen_Schwarz_Transparent[3] = [_GDIPlus_PenCreate(0x33000000), _GDIPlus_PenCreate(0x55000000), _GDIPlus_PenCreate(0x77000000)]
Global $hBrush_Weiss_Transparent[3] = [_GDIPlus_BrushCreateSolid(0x20FFFFFF), _GDIPlus_BrushCreateSolid(0x25FFFFFF), _GDIPlus_BrushCreateSolid(0x2AFFFFFF)]

;################################################################################

Global $hBrush_Schwarz = _GDIPlus_BrushCreateSolid('0xFF000000')
Global $hBrush_Weiss = _GDIPlus_BrushCreateSolid('0xFFFFFFFF')
Global $hBrush_Gold = _GDIPlus_BrushCreateSolid('0xFFFFEE55')

Global $hPen_Turm = _Turm_Pen_Create()
Global $hPen_Schwarz = _GDIPlus_PenCreate('0xFF000000', 3)

Global $hFamily_Calibri = _GDIPlus_FontFamilyCreate($Font)

Global $hFormat = _GDIPlus_StringFormatCreate()
_GDIPlus_StringFormatSetAlign($hFormat, 1)
Global $hFont_Big = _GDIPlus_FontCreate($hFamily_Calibri, 20, 1)
Global $tLayout_Big = _GDIPlus_RectFCreate(10, 10, 680, 100)
;FPS_Anzeige##########################################
Global $hFont_FPS = _GDIPlus_FontCreate($hFamily_Calibri, 12, 1)
Global $tLayout_FPS = _GDIPlus_RectFCreate(0, 2, 195, 20)
;##########################FPS_ANZEIGE##################

;Geld_Anzeige#####
Global $hFont_Geld = _GDIPlus_FontCreate($hFamily_Calibri, 12, 1)
Global $tLayout_Geld = _GDIPlus_RectFCreate(0, 2, 195, 20)
;#################

;Turmbau_Werte Anzeige#####
Global $hFont_Turmbau = _GDIPlus_FontCreate($hFamily_Calibri, 25, 1)
Global $tLayout_Turmbau_1 = _GDIPlus_RectFCreate(15, 58, 45, 45)
Global $tLayout_Turmbau_2 = _GDIPlus_RectFCreate(75, 58, 45, 45)
Global $tLayout_Turmbau_3 = _GDIPlus_RectFCreate(135, 58, 45, 45)
Global $tLayout_Turmbau_Preis = _GDIPlus_RectFCreate(76, 161, 73, 21)
;~ Global $tLayout_Turmbau_1_Relative = _GDIPlus_RectFCreate(15 + 505 ,58 + 25 ,45,45)
;~ Global $tLayout_Turmbau_2_Relative = _GDIPlus_RectFCreate(75 + 505,58+25,45,45)
;~ Global $tLayout_Turmbau_3_Relative = _GDIPlus_RectFCreate(135 + 505,58+25,45,45)
;##########################

#EndRegion GDIPlus starten / Bilder Laden

#Region GUI

$hGUI = GUICreate($Titel, $Breite, $Hoehe, _Abstand_X($Breite), _Abstand_Y($Hoehe))
GUISetOnEvent(-3, '_ExitBox')
GUISetState(@SW_SHOW, $hGUI)
;~ GUIRegisterMsg($WM_SETCURSOR, 'WM_SETCURSOR')

;Temp##############################################################
;################################TEMP##############################



$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
$hBitmap_Spielfeld = _GDIPlus_BitmapCreateFromGraphics(505, 505, $hGraphics)
$hBackbuffer_Spielfeld = _GDIPlus_ImageGetGraphicsContext($hBitmap_Spielfeld)
$hBitmap_Spielfeld_2 = _GDIPlus_BitmapCreateFromGraphics(505, 505, $hGraphics)
$hBackbuffer_Spielfeld_2 = _GDIPlus_ImageGetGraphicsContext($hBitmap_Spielfeld_2)

$hBitmap_Leiste_Oben = _GDIPlus_BitmapCreateFromGraphics(505, 95, $hGraphics)
$hBackbuffer_Leiste_Oben = _GDIPlus_ImageGetGraphicsContext($hBitmap_Leiste_Oben)

$hBitmap_FPS = _GDIPlus_BitmapCreateFromGraphics(195, 25, $hGraphics)
$hBackbuffer_FPS = _GDIPlus_ImageGetGraphicsContext($hBitmap_FPS)

$hBitmap_Geld = _GDIPlus_BitmapCreateFromGraphics(195, 25, $hGraphics)
$hBackbuffer_Geld = _GDIPlus_ImageGetGraphicsContext($hBitmap_Geld)

$hBitmap_Leiste_Rechts = _GDIPlus_BitmapCreateFromGraphics(195, 550, $hGraphics)
$hBackbuffer_Leiste_Rechts = _GDIPlus_ImageGetGraphicsContext($hBitmap_Leiste_Rechts)

$hBitmap_Leiste_Rechts_2 = _GDIPlus_BitmapCreateFromGraphics(195, 550, $hGraphics)
$hBackbuffer_Leiste_Rechts_2 = _GDIPlus_ImageGetGraphicsContext($hBitmap_Leiste_Rechts_2)


;Alle Pens vorbereiten für das Turmzeichnen.
;~ _GDIPlus_GraphicsDrawStringEx($hGraphics, 'Spiel wird gestartet', $hFont_Big, $tLayout_Big, $hFormat, $hBrush_Schwarz)



;~ Sleep(500)

;Leiste_Oben Vorbereiten

_GDIPlus_GraphicsDrawImage($hBackbuffer_Leiste_Oben, $hImage_Leiste_Oben_Hintergrund, 2, 2)
_GDIPlus_GraphicsDrawRect($hBackbuffer_Leiste_Oben, 0, 0, 503, 95, $hPen_Schwarz)


;Leiste_Rechts Vorbereiten
_GDIPlus_GraphicsDrawImage($hBackbuffer_Leiste_Rechts, $hImage_Leiste_Rechts_Hintergrund, 0, 0)
_GDIPlus_GraphicsDrawStringEx($hBackbuffer_Leiste_Rechts, $Turmbau_Damage, $hFont_Turmbau, $tLayout_Turmbau_1, $hFormat, $hBrush_Weiss)
_GDIPlus_GraphicsDrawStringEx($hBackbuffer_Leiste_Rechts, $Turmbau_Range, $hFont_Turmbau, $tLayout_Turmbau_2, $hFormat, $hBrush_Weiss)
_GDIPlus_GraphicsDrawStringEx($hBackbuffer_Leiste_Rechts, $Turmbau_Frequenz, $hFont_Turmbau, $tLayout_Turmbau_3, $hFormat, $hBrush_Weiss)
_GDIPlus_GraphicsDrawStringEx($hBackbuffer_Leiste_Rechts, $Turmbau_Preis, $hFont_Geld, $tLayout_Turmbau_Preis, $hFormat, $hBrush_Gold)


;FPS_Leiste Vorbereiten
_GDIPlus_GraphicsFillRect($hBackbuffer_FPS, 0, 0, 195, 25, $hBrush_Schwarz)


;########################

;Spielfeld Vorbereiten
_GDIPlus_GraphicsDrawRect($hBackbuffer_Spielfeld, 0, 0, 503, 503, $hPen_Schwarz)
_GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld, $hImage_Hintergrund_Bild, 2, 2)

For $i = 0 To 9 Step 1
	For $o = 0 To 9 Step 1
		_GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld, $hImage_Hintergrund_Feld, 2 + $i * 50, 2 + $o * 50)
	Next
Next

_Pfad_Zeichnen($WegPunkte, $Taktgeber)

;


;Fenster Zeichnen
_Redraw_Backbuffer($Taktgeber)
;#####################TEMP#####################
ToolTip('Startzeit: ' & Round(TimerDiff($Start_Timer), 0) / 1000 & ' Sekunden')
;#####################TEMP#####################



;#######################

#EndRegion GUI

_Warteschleife()

#Region UDF´s
Func _Warteschleife()

	While 1
;~ 		ToolTip('Takt: ' & $Taktgeber)
		If TimerDiff($Taktgeber_Timer) >= $Taktgeber_Intervall Then
			$Taktgeber += 1
;~ 			If $Taktgeber >= 1000 Then _Reset()
			$Taktgeber_Timer = TimerInit()
		EndIf

		_Pfad_Zeichnen($WegPunkte, $Taktgeber)
		_Redraw_Backbuffer($Taktgeber)

		;############################ Temp #########################
;~ 		If TimerDiff($Start_Timer) >= 5000 Then
;~ 			ToolTip('')
;~ 		EndIf
;~ ToolTip($Taktgeber)
		If $Taktgeber / 300 = Round($Taktgeber / 300) Then ToolTip('') ;Tooltip Alle 300Takte (300*15ms = 0,45sek) löschen
		;#########################Temp#############################

		$Extended_Msg = ''
		$MousePos = MouseGetPos()
		$MausFeld = _Felderkennung($MousePos)
		_GDIPlus_Button($MousePos, $hGraphics, $hGUI, 374, 6, 124, 28, $Welle_Holen_Button, $Welle_Holen_Button_Name, $Welle_Holen_Button_Status, $Welle_Holen_Button_Klick, $hBackbuffer_Leiste_Oben, 0, 0)

		_GDIPlus_Button($MousePos, $hGraphics, $hGUI, 15, 12, 45, 45, $Plus_Gross_Button_1, $Plus_Gross_Button_1_Name, $Plus_Gross_Button_1_Status, $Plus_Gross_Button_1_Klick, $hBackbuffer_Leiste_Rechts, 505, 25)
		_GDIPlus_Button($MousePos, $hGraphics, $hGUI, 75, 12, 45, 45, $Plus_Gross_Button_2, $Plus_Gross_Button_2_Name, $Plus_Gross_Button_2_Status, $Plus_Gross_Button_2_Klick, $hBackbuffer_Leiste_Rechts, 505, 25)
		_GDIPlus_Button($MousePos, $hGraphics, $hGUI, 135, 12, 45, 45, $Plus_Gross_Button_3, $Plus_Gross_Button_3_Name, $Plus_Gross_Button_3_Status, $Plus_Gross_Button_3_Klick, $hBackbuffer_Leiste_Rechts, 505, 25)

		_GDIPlus_Button($MousePos, $hGraphics, $hGUI, 15, 104, 45, 45, $Minus_Gross_Button_1, $Minus_Gross_Button_1_Name, $Minus_Gross_Button_1_Status, $Minus_Gross_Button_1_Klick, $hBackbuffer_Leiste_Rechts, 505, 25)
		_GDIPlus_Button($MousePos, $hGraphics, $hGUI, 75, 104, 45, 45, $Minus_Gross_Button_2, $Minus_Gross_Button_2_Name, $Minus_Gross_Button_2_Status, $Minus_Gross_Button_2_Klick, $hBackbuffer_Leiste_Rechts, 505, 25)
		_GDIPlus_Button($MousePos, $hGraphics, $hGUI, 135, 104, 45, 45, $Minus_Gross_Button_3, $Minus_Gross_Button_3_Name, $Minus_Gross_Button_3_Status, $Minus_Gross_Button_3_Klick, $hBackbuffer_Leiste_Rechts, 505, 25)

		_GDIPlus_Button($MousePos, $hGraphics, $hGUI, 14, 193, 167, 26, $TurmKauf_Button, $TurmKauf_Button_Name, $TurmKauf_Button_Status, $TurmKauf_Button_Klick, $hBackbuffer_Leiste_Rechts, 505, 25)

		If _IsPressed('01') Then _KlickAktion()


		Switch $Extended_Msg
			Case 'Welle_Holen_Button'
				ToolTip('Noch eine Weile außer Funktion. Zuerst wird die Upgradefunktion implementiert :P')
			Case 'TurmKauf_Button'
				$Turmbau_Aktiv = True
;~ 				ToolTip('So das is der Button um Türmchen zu kaafe !')
			Case 'Plus_Gross_Button_1'
				If $Turmbau_Damage < 9 Then $Turmbau_Damage += 1
				$Turmbau_Preis = $Turmbau_Damage * $Turmbau_Frequenz * $Turmbau_Range
				_Turmbau_Labels_Draw()
			Case 'Plus_Gross_Button_2'
				If $Turmbau_Range < 9 Then $Turmbau_Range += 1
				$Turmbau_Preis = $Turmbau_Damage * $Turmbau_Frequenz * $Turmbau_Range
				_Turmbau_Labels_Draw()
			Case 'Plus_Gross_Button_3'
				If $Turmbau_Frequenz < 9 Then $Turmbau_Frequenz += 1
				$Turmbau_Preis = $Turmbau_Damage * $Turmbau_Frequenz * $Turmbau_Range
				_Turmbau_Labels_Draw()
			Case 'Minus_Gross_Button_1'
				If $Turmbau_Damage > 1 Then $Turmbau_Damage -= 1
				$Turmbau_Preis = $Turmbau_Damage * $Turmbau_Frequenz * $Turmbau_Range
				_Turmbau_Labels_Draw()
			Case 'Minus_Gross_Button_2'
				If $Turmbau_Range > 1 Then $Turmbau_Range -= 1
				$Turmbau_Preis = $Turmbau_Damage * $Turmbau_Frequenz * $Turmbau_Range
				_Turmbau_Labels_Draw()
			Case 'Minus_Gross_Button_3'
				If $Turmbau_Frequenz > 1 Then $Turmbau_Frequenz -= 1
				$Turmbau_Preis = $Turmbau_Damage * $Turmbau_Frequenz * $Turmbau_Range
				_Turmbau_Labels_Draw()
		EndSwitch





		;########################## Timer Kontrolle #################################
		$Sleep_Diff = TimerDiff($Sleep_Timer)
		Switch $Sleep_Diff
			Case 0 To 8
				Sleep(9 - $Sleep_Diff)
				$Sleep_Timer = TimerInit()
			Case 9 To 100000
				$Sleep_Timer = TimerInit()
				ContinueLoop
		EndSwitch
		;############################################################################
		; Wenn die Berechnungen zu lange dauern wird nicht gewartet
		; Wenn Leerlauf ist wird die CPU geschont. (Bei mir nur 3-5%)
		;############################################################################

;~ Sleep(10)

	WEnd
EndFunc   ;==>_Warteschleife

Func _KlickAktion()
	If $Turmbau_Aktiv = True And $MausPos[0] <> -1 Then
	_Turmbau()
Else
	If $MausPos[0] <> -1 And  StringLeft($WegPunkte[$MausPos[0]][$MausPos[1]], 1) <> '0' Then _TurmAuswahl()
	EndIf


EndFunc   ;==>_KlickAktion

Func _TurmAuswahl()
	ToolTip($WegPunkte[$MausPos[0]][$MausPos[1]])
EndFunc


Func _Turmbau()
;~ 	If Not _IsPressed('10') Then
	$Turmbau_Aktiv = False
;~ EndIf
	If StringLeft($WegPunkte[$MausPos[0]][$MausPos[1]], 1) = '0' And $Geld >= $Turmbau_Preis And StringRight($WegPunkte[$MausPos[0]][$MausPos[1]],1) <> 'X' Then
		$WegPunkte[$MausPos[0]][$MausPos[1]] = $Turmbau_Damage & $Turmbau_Frequenz & $Turmbau_Range & StringRight($WegPunkte[$MausPos[0]][$MausPos[1]], 6)
		$Geld -= $Turmbau_Preis
	EndIf

;~ _GDIPlus_GraphicsFillRect($hBackbuffer_Spielfeld, $MausPos[0] * 50 + 3, $MausPos[1] * 50 + 3, 49, 49, $hBrush_Gold)

EndFunc   ;==>_Turmbau

Func _Felderkennung($Pos)
	Local $X = Floor($Pos[0] / 50)
	Local $Y = Floor(($Pos[1] - 95) / 50)

	If $Y >= 0 And $X <= 9 And $Y <= 9 And $X >= 0 Then
		If $MausPos[0] <> $X Or $MausPos[1] <> $Y Then
;~ 	_GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld, $hImage_Mausindikator, $X*50+2, $Y*50+2)
			$MausPos[0] = $X
			$MausPos[1] = $Y
;~ 	ToolTip('Position: X: ' & $X & '  Y: ' & $Y & ' Inhalt: ' & $WegPunkte[$X][$Y])
		EndIf
	Else
		If $MausPos[0] <> $X Or $MausPos[1] <> $Y Then
;~ 	_GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld, $hImage_Mausindikator, $X*50+2, $Y*50+2)
			$MausPos[0] = -1
;~ 			$MausPos[1] = -1
;~ 	ToolTip('Position: X: ' & $X & '  Y: ' & $Y & ' Inhalt: ' & $WegPunkte[$X][$Y])
		EndIf
	EndIf



	Return
EndFunc   ;==>_Felderkennung

Func _Turmbau_Labels_Draw()
	_GDIPlus_GraphicsDrawImage($hBackbuffer_Leiste_Rechts_2, $hImage_Leiste_Rechts_Hintergrund, 0, 0)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer_Leiste_Rechts_2, $Turmbau_Damage, $hFont_Turmbau, $tLayout_Turmbau_1, $hFormat, $hBrush_Weiss)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer_Leiste_Rechts_2, $Turmbau_Range, $hFont_Turmbau, $tLayout_Turmbau_2, $hFormat, $hBrush_Weiss)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer_Leiste_Rechts_2, $Turmbau_Frequenz, $hFont_Turmbau, $tLayout_Turmbau_3, $hFormat, $hBrush_Weiss)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer_Leiste_Rechts_2, $Turmbau_Preis, $hFont_Geld, $tLayout_Turmbau_Preis, $hFormat, $hBrush_Gold)
	_GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap_Leiste_Rechts_2, 505, 25)
	_GDIPlus_GraphicsDrawImage($hBackbuffer_Leiste_Rechts, $hImage_Leiste_Rechts_Hintergrund, 0, 0)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer_Leiste_Rechts, $Turmbau_Damage, $hFont_Turmbau, $tLayout_Turmbau_1, $hFormat, $hBrush_Weiss)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer_Leiste_Rechts, $Turmbau_Range, $hFont_Turmbau, $tLayout_Turmbau_2, $hFormat, $hBrush_Weiss)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer_Leiste_Rechts, $Turmbau_Frequenz, $hFont_Turmbau, $tLayout_Turmbau_3, $hFormat, $hBrush_Weiss)
	_GDIPlus_GraphicsDrawStringEx($hBackbuffer_Leiste_Rechts, $Turmbau_Preis, $hFont_Geld, $tLayout_Turmbau_Preis, $hFormat, $hBrush_Gold)
EndFunc   ;==>_Turmbau_Labels_Draw




;~ Func _Reset()
;~ 	Local $Taktgeber_Old = $Taktgeber
;~ 	$Taktgeber = 0
;~ 	$Redraw_FPS_Temp -= $Taktgeber_Old
;~ 	$Redraw_Liste_Oben_Temp -= $Taktgeber_Old
;~ 	$Redraw_Spielfeld_Temp -= $Taktgeber_Old
;~ 	$Weg_Neu_Zeichnen_Temp -= $Taktgeber_Old
;~ EndFunc

Func _Pfad_Zeichnen($Temp_WegPunkte, $Takt)
	If $Takt - $Weg_Neu_Zeichnen_Temp >= $Weg_Neu_Zeichnen_Intervall Then
		$Weg_Neu_Zeichnen_Temp = $Takt
		_Redraw('Spielfeld', 'Alle')
		For $X = 0 To 9 Step 1
			For $Y = 0 To 9 Step 1
				If StringRight($Temp_WegPunkte[$X][$Y], 1) = 'X' Then
					Switch Random(0, 2, 1)
						Case 0
							_GDIPlus_GraphicsFillRect($hBackbuffer_Spielfeld, 5 + $X * 50, 5 + $Y * 50, 45, 45, $hBrush_Weiss_Transparent[0])
;~ 							_GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld, $hImage_Weg_1, $Anfang_X + 1 + $X * 50, $Anfang_Y + 1 + $Y * 50)
						Case 1
							_GDIPlus_GraphicsFillRect($hBackbuffer_Spielfeld, 5 + $X * 50, 5 + $Y * 50, 45, 45, $hBrush_Weiss_Transparent[1])
;~ 							_GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld, $hImage_Weg_2, $Anfang_X + 1 + $X * 50, $Anfang_Y + 1 + $Y * 50)
						Case 2
							_GDIPlus_GraphicsFillRect($hBackbuffer_Spielfeld, 5 + $X * 50, 5 + $Y * 50, 45, 45, $hBrush_Weiss_Transparent[2])
;~ 							_GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld, $hImage_Weg_3, $Anfang_X + 1 + $X * 50, $Anfang_Y + 1 + $Y * 50)
					EndSwitch
				EndIf
			Next
		Next
	EndIf
EndFunc   ;==>_Pfad_Zeichnen

;~ [TurmRGB][UpgradesRGB][FeldNr]
;~ bsp:
;~ 000000015 = Kein Turm Feld 15
;~ 999999011 = Turm alles auf Max. Upgrades auf Max. Feld 11

Func _Wegpunkte()
	Local $Temp[10], $Temp_WegPunkte[10][10]
	$Temp[0] = 'o,o,o,o,o,o,o,o,o,o'
	$Temp[1] = 'X,X,X,X,X,X,X,X,X,o'
	$Temp[2] = 'o,o,o,o,o,o,o,o,X,o'
	$Temp[3] = 'X,X,X,X,o,o,o,o,X,o'
	$Temp[4] = 'X,o,o,X,X,X,X,X,X,o'
	$Temp[5] = 'X,o,o,o,o,o,o,o,o,o'
	$Temp[6] = 'X,o,o,o,X,X,X,X,X,o'
	$Temp[7] = 'X,o,o,o,X,o,o,o,X,o'
	$Temp[8] = 'X,X,X,X,X,o,o,o,X,o'
	$Temp[9] = 'o,o,o,o,o,o,o,o,X,X'
	Local $Part
	For $Y = 0 To 9
		$Part = StringSplit($Temp[$Y], ",")
		For $X = 0 To 9
			$Temp_WegPunkte[$X][$Y] = '000000' & $Y & $X & $Part[$X + 1]
		Next
	Next
	Return $Temp_WegPunkte
EndFunc   ;==>_Wegpunkte

Func _Redraw($Feld, $Grafiken = 'Alle')

	If $Feld = 'Spielfeld' Then
		If $Grafiken = 'Alle' Then
			_GDIPlus_GraphicsDrawRect($hBackbuffer_Spielfeld, 0, 0, 503, 503, $hPen_Schwarz)
			_GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld, $hImage_Hintergrund_Bild, 2, 2)
			For $i = 0 To 9 Step 1
				For $o = 0 To 9 Step 1
					_GDIPlus_GraphicsDrawRect($hBackbuffer_Spielfeld, 2 + $i * 50, 2 + $o * 50, 50, 50, $hPen_Schwarz_Transparent[2])
;~ 					_GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld, $hImage_Hintergrund_Feld, 2 + $i * 50, 2 + $o * 50)
				Next
			Next
		EndIf
	EndIf

EndFunc   ;==>_Redraw

Func _Turm_Pen_Create()
	Local $hPen_Turm[9][9][9]
	For $i1 = 0 To 8 Step 1
		For $i2 = 0 To 8 Step 1
			For $i3 = 0 To 8 Step 1
				$hPen_Turm[$i1][$i2][$i3] = _GDIPlus_PenCreate('0xFF' & Hex($i1 * 25, 2) & Hex($i2 * 25, 2) & Hex($i3 * 25, 2), 4)
;~ 				_GDIPlus_GraphicsDrawRect($hGraphics, $i1*65 + 10, $i2*65 +10, 50,50, $hPen_Turm[$i1][$i2][$i3])
;~ 				Sleep(10)
			Next
		Next
	Next
	Return $hPen_Turm
EndFunc   ;==>_Turm_Pen_Create

Func _Turm_Pen_Dispose($hPen_Turm)
	For $i1 = 0 To 8 Step 1
		For $i2 = 0 To 8 Step 1
			For $i3 = 0 To 8 Step 1
				_GDIPlus_PenDispose($hPen_Turm[$i1][$i2][$i3])
			Next
		Next
	Next
EndFunc   ;==>_Turm_Pen_Dispose


Func _Turm_Zeichnen($hBack)
	For $Y = 0 To 9 Step 1
		For $X = 0 To 9 Step 1
			If StringLeft($WegPunkte[$X][$Y], 1) <> '0' And StringRight($WegPunkte[$X][$Y], 1) = 'o' Then __TurmZeichnen($hBack, $X, $Y)
		Next
	Next
EndFunc   ;==>_Turm_Zeichnen

Func __TurmZeichnen($hBack, $X, $Y)
;~ 	Local $Color = '0xFF' & Hex(StringLeft($WegPunkte[$X][$Y], 1) * 25, 2) & Hex(StringMid($WegPunkte[$X][$Y], 2, 1) * 25, 2) & Hex(StringMid($WegPunkte[$X][$Y], 3, 1) * 25, 2)
;~ 	ToolTip($Color)


;~ 	Local $hBrush_Turm = _GDIPlus_BrushCreateSolid($Color)
;~ 	Local $hPen_Turm = _GDIPlus_PenCreate($Color, 4)

;~ 	ToolTip($X & $Y)
;~ 	_GDIPlus_GraphicsFillRect($hBack, $X * 50 + 3, $Y * 50 + 3, 49, 49, $hBrush_Turm)

	Local $r = StringLeft($WegPunkte[$X][$Y], 1)
	Local $g = StringMid($WegPunkte[$X][$Y], 2, 1)
	Local $b = StringMid($WegPunkte[$X][$Y], 3, 1)

;~ ToolTip($r & $g & $b)

	_GDIPlus_GraphicsDrawRect($hBack, $X * 50 + 6 + 15, $Y * 50 + 6 + 15, 43 - 30, 43 - 30, $hPen_Turm[$r - 1][$g - 1][$b - 1])
	_GDIPlus_GraphicsDrawRect($hBack, $X * 50 + 6, $Y * 50 + 6, 43, 43, $hPen_Turm[$r - 1][$g - 1][$b - 1])



;~ 	_GDIPlus_PenDispose($hPen_Turm)
;~ 	_GDIPlus_BrushDispose($hBrush_Turm)
EndFunc   ;==>__TurmZeichnen

Func _Redraw_Backbuffer($Takt)

	;Spielfeld Neu Zeichnen
	If $Takt - $Redraw_Spielfeld_Temp >= $Redraw_Spielfeld_Intervall Then
		$Redraw_Spielfeld_Temp = $Takt

		;#########################Temp#############################
		Local $FPS_Local = 1000 / TimerDiff($Redraw_Spielfeld_FPS_Timer)
		$FPS_Durchschnitt = ($FPS_Durchschnitt * 1 + $FPS_Local) / 2
		$Redraw_Spielfeld_FPS_Timer = TimerInit()
		;#########################Temp#############################

;~ If $MausPos[0] <> $MausPos_Alt[0] Or $MausPos[1] <> $MausPos_Alt[1] Then
;~ 	$MausPos_Alt = $MausPos

;~ 	_GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld_2, $hBitmap_Spielfeld, 0,0) ;Spielfeld kopieren Ohne Maus

;~ _GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld, $hImage_Mausindikator, $MausPos[0]*50+2, $MausPos[1]*50+2)

;~ 	_GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap_Spielfeld, 0, 95)

;~ 	_GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld, $hBitmap_Spielfeld_2, 0,0)

;~ Else
;~ 	_GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld, $hImage_Mausindikator, $MausPos[0]*50+2, $MausPos[1]*50+2)
;~ 		_GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap_Spielfeld, 0, 95)

		_GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld_2, $hBitmap_Spielfeld, 0, 0) ;Spielfeld kopieren Ohne Maus

		If $MausPos[0] <> -1 Then
		Switch $Turmbau_Aktiv
			Case True
				_GDIPlus_GraphicsFillRect($hBackbuffer_Spielfeld, $MausPos[0] * 50 + 3, $MausPos[1] * 50 + 3, 49, 49, $hBrush_Gold)
			Case Else
				_GDIPlus_GraphicsFillRect($hBackbuffer_Spielfeld, $MausPos[0] * 50 + 3, $MausPos[1] * 50 + 3, 49, 49, $hBrush_Weiss_Transparent[2])
		EndSwitch
		EndIf

		_Turm_Zeichnen($hBackbuffer_Spielfeld)

;~ 		_GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld, $hImage_Mausindikator, $MausPos[0] * 50 + 2, $MausPos[1] * 50 + 2)

		_GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap_Spielfeld, 0, 95)

		_GDIPlus_GraphicsDrawImage($hBackbuffer_Spielfeld, $hBitmap_Spielfeld_2, 0, 0)

;~ 		EndIf


	EndIf

	;Leiste_Oben Neu Zeichnen
	If $Takt - $Redraw_Liste_Oben_Temp >= $Redraw_Liste_Oben_Intervall Then
		$Redraw_Liste_Oben_Temp = $Takt
		_GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap_Leiste_Oben, 0, 0)

		;#########################Temp#############################
;~ 		ToolTip('FPS: ' & Round($FPS_Durchschnitt, 1))
		;#########################Temp#############################

	EndIf

	;FPS_Leiste neu zeichnen
	If $Takt - $Redraw_FPS_Temp >= $Redraw_FPS_Intervall Then
		$Redraw_FPS_Temp = $Takt
		_GDIPlus_GraphicsFillRect($hBackbuffer_FPS, 0, 0, 195, 25, $hBrush_Schwarz)
		_GDIPlus_GraphicsDrawStringEx($hBackbuffer_FPS, 'FPS: ' & Round($FPS_Durchschnitt, 1), $hFont_FPS, $tLayout_FPS, $hFormat, $hBrush_Weiss)
		_GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap_FPS, 505, 575)
	EndIf

	;Geld Leiste neu zeichnen
	If $Takt - $Redraw_Geld_Temp >= $Redraw_Geld_Intervall Then
		$Redraw_Geld_Temp = $Takt
		_GDIPlus_GraphicsFillRect($hBackbuffer_Geld, 0, 0, 195, 25, $hBrush_Schwarz)
		_GDIPlus_GraphicsDrawStringEx($hBackbuffer_Geld, 'Geld: ' & $Geld, $hFont_Geld, $tLayout_Geld, $hFormat, $hBrush_Gold)
		_GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap_Geld, 505, 0)
	EndIf

	;Leiste_Rechts Neu Zeichnen
	If $Takt - $Redraw_Liste_Rechts_Temp >= $Redraw_Liste_Rechts_Intervall Then
		$Redraw_Liste_Rechts_Temp = $Takt
		_GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap_Leiste_Rechts, 505, 25)
	EndIf

EndFunc   ;==>_Redraw_Backbuffer

Func _Exit()
	OnAutoItExitUnregister('_Exit')

	_GDIPlus_PenDispose($hPen_Schwarz)

	_GDIPlus_BrushDispose($hBrush_Schwarz)
	_GDIPlus_BrushDispose($hBrush_Weiss)
	_GDIPlus_BrushDispose($hBrush_Gold)

	_GDIPlus_StringFormatDispose($hFormat)
	_GDIPlus_FontDispose($hFont_FPS)

	_GDIPlus_FontFamilyDispose($hFamily_Calibri)
	_GDIPlus_FontDispose($hFont_Geld)

	_GDIPlus_FontDispose($hFont_Turmbau)

	_GDIPlus_FontDispose($hFont_Big)
	;Spielfeld########
;~ 	_GDIPlus_ImageDispose($hImage_Weg_1)
;~ 	_GDIPlus_ImageDispose($hImage_Weg_1)
;~ 	_GDIPlus_ImageDispose($hImage_Weg_1)
	_GDIPlus_ImageDispose($hImage_Hintergrund_Feld)
	_GDIPlus_ImageDispose($hImage_Hintergrund_Bild)

	;Leiste_Oben######
	_GDIPlus_ImageDispose($hImage_Leiste_Oben_Hintergrund)

	;Leiste_Rechts
	_GDIPlus_ImageDispose($hImage_Leiste_Rechts_Hintergrund)


	;Backbuffer########
	_GDIPlus_GraphicsDispose($hBackbuffer_Spielfeld)
	_GDIPlus_BitmapDispose($hBitmap_Spielfeld)
	_GDIPlus_GraphicsDispose($hBackbuffer_Spielfeld_2)
	_GDIPlus_BitmapDispose($hBitmap_Spielfeld_2)
	_GDIPlus_GraphicsDispose($hBackbuffer_Leiste_Oben)
	_GDIPlus_BitmapDispose($hBitmap_Leiste_Oben)
	_GDIPlus_GraphicsDispose($hBackbuffer_FPS)
	_GDIPlus_BitmapDispose($hBitmap_FPS)
	_GDIPlus_GraphicsDispose($hBackbuffer_Geld)
	_GDIPlus_BitmapDispose($hBitmap_Geld)
	_GDIPlus_GraphicsDispose($hBackbuffer_Leiste_Rechts)
	_GDIPlus_BitmapDispose($hBitmap_Leiste_Rechts)
	_GDIPlus_GraphicsDispose($hBackbuffer_Leiste_Rechts_2)
	_GDIPlus_BitmapDispose($hBitmap_Leiste_Rechts_2)

	;Hover_Buttons:
	For $i = 0 To 2 Step 1
		_GDIPlus_ImageDispose($Plus_Gross_Button_1[$i][0])
		_GDIPlus_ImageDispose($Plus_Gross_Button_2[$i][0])
		_GDIPlus_ImageDispose($Plus_Gross_Button_3[$i][0])
		_GDIPlus_ImageDispose($Minus_Gross_Button_1[$i][0])
		_GDIPlus_ImageDispose($Minus_Gross_Button_2[$i][0])
		_GDIPlus_ImageDispose($Minus_Gross_Button_3[$i][0])
		_GDIPlus_ImageDispose($Welle_Holen_Button[$i][0])
		_GDIPlus_ImageDispose($TurmKauf_Button[$i][0])

		_GDIPlus_BrushDispose($hBrush_Weiss_Transparent[$i])
		_GDIPlus_PenDispose($hPen_Schwarz_Transparent[$i])
	Next

	_Turm_Pen_Dispose($hPen_Turm)

	;Mausindikator

	_GDIPlus_ImageDispose($hImage_Mausindikator)


	;hGraphics##########
	_GDIPlus_GraphicsDispose($hGraphics)

	_GDIPlus_Shutdown()

;~ 	DllCall($hDll, "none", "DestroyCursor", "ptr", $iCursor[0])
;~ 	DllClose($hDll)

;~ 	DllCall($hDll, "none", "DestroyCursor", "ptr", $iCursor[0])
;~ 	_Crypt_Shutdown()
;~ 	DllClose($hDll)




	Exit
EndFunc   ;==>_Exit

Func _ExitBox()
	_Exit()
EndFunc   ;==>_ExitBox

Func _Abstand_X($a)
	Return @DesktopWidth / 2 - $a / 2
EndFunc   ;==>_Abstand_X

Func _Abstand_Y($a)
	Return @DesktopHeight / 2 - $a / 2
EndFunc   ;==>_Abstand_Y

Func _GDIPlus_Button_Init($sName, $Pic1, $Pic2, $Pic3)
	Local $a = Assign($sName & "_Name", $sName)
	Local $b = Assign($sName & "_Status", -1)
	Local $c = Assign($sName & "_Klick", 0)
	If $a + $b + $c <> 3 Then Return -1
	Local $Array[3][2], $Error = 0 ; Array: enthält 3 Bilder je in 2 Ausführungen. 100% Alpha, 1x 15% Alpha
	$Array[0][0] = Load_BMP_From_Mem($Pic1)
	If @error Then $Error += 1
	$Array[1][0] = Load_BMP_From_Mem($Pic2)
	If @error Then $Error += 1
	$Array[2][0] = Load_BMP_From_Mem($Pic3)
	If @error Then $Error += 1
	If $Error <> 0 Then Return -2
	$Error = 0
;~ 	$Array[0][1] = Load_BMP_From_Mem($Pic1)
;~ 	_TBmpFromBmp($Array[0][1], 30)
;~ 	$Array[1][1] = Load_BMP_From_Mem($Pic2)
;~ 	_TBmpFromBmp($Array[1][1], 30)
;~ 	$Array[2][1] = Load_BMP_From_Mem($Pic3)
;~ 	_TBmpFromBmp($Array[2][1], 30)
	Return $Array
EndFunc   ;==>_GDIPlus_Button_Init

Func _GDIPlus_Button_Dispose($hButton)
	Local $a = _GDIPlus_ImageDispose($hButton[0][0])
	Local $b = _GDIPlus_ImageDispose($hButton[1][0])
	Local $c = _GDIPlus_ImageDispose($hButton[2][0])
	Local $d = _GDIPlus_ImageDispose($hButton[0][1])
	Local $e = _GDIPlus_ImageDispose($hButton[1][1])
	Local $f = _GDIPlus_ImageDispose($hButton[2][1])
	If $a = False Or $b = False Or $c = False Or $d = False Or $e = False Or $f = False Then
		Return -1
	Else
		Return 1
	EndIf
EndFunc   ;==>_GDIPlus_Button_Dispose

Func _GDIPlus_Button($mPos, $hGraphic, $hGUI, $PosX, $PosY, $Breite, $Hoehe, $hButton, $sName, $Status, $bKlick, $hBackbuffer_Used, $Relative_X, $Relative_Y)
	If WinActive($hGUI) Then
		Local $PosX2 = $PosX + $Breite
		Local $PosY2 = $PosY + $Hoehe
		Local $Klick
		If _IsPressed("01") Then $Klick = 1
		If $Status = -1 Then
;~ 			__GDIPlus_GraphicsDrawImageRect($hGraphic, $hButton[0][1], $PosX, $PosY, $Breite, $Hoehe)
			_GDIPlus_GraphicsDrawImageRect($hGraphic, $hButton[0][0], $PosX + $Relative_X, $PosY + $Relative_Y, $Breite, $Hoehe)
			_GDIPlus_GraphicsDrawImageRect($hBackbuffer_Used, $hButton[0][0], $PosX, $PosY, $Breite, $Hoehe)
			Assign($sName & "_Status", 1)
		EndIf
		If $mPos[0] > $PosX + $Relative_X And $mPos[1] > $PosY + $Relative_Y And $mPos[0] < $PosX2 + $Relative_X And $mPos[1] < $PosY2 + $Relative_Y Then
			If $Status = 0 Then
;~ 				__GDIPlus_GraphicsDrawImageRect($hGraphic, $hButton[1][1], $PosX, $PosY, $Breite, $Hoehe)
				_GDIPlus_GraphicsDrawImageRect($hGraphic, $hButton[1][0], $PosX + $Relative_X, $PosY + $Relative_Y, $Breite, $Hoehe)
				_GDIPlus_GraphicsDrawImageRect($hBackbuffer_Used, $hButton[1][0], $PosX, $PosY, $Breite, $Hoehe)
				Assign($sName & "_Status", 1)
			EndIf
			If $Klick = 1 And $bKlick = 0 Then
				Assign($sName & "_Klick", 1)
;~ 				__GDIPlus_GraphicsDrawImageRect($hGraphic, $hButton[2][1], $PosX, $PosY, $Breite, $Hoehe)
				_GDIPlus_GraphicsDrawImageRect($hGraphic, $hButton[2][0], $PosX + $Relative_X, $PosY + $Relative_Y, $Breite, $Hoehe)
				_GDIPlus_GraphicsDrawImageRect($hBackbuffer_Used, $hButton[2][0], $PosX, $PosY, $Breite, $Hoehe)
			EndIf
			If $bKlick = 1 And $Klick = 0 Then
				Assign($sName & "_Klick", 0)
;~ 				__GDIPlus_GraphicsDrawImageRect($hGraphic, $hButton[1][1], $PosX, $PosY, $Breite, $Hoehe)
				_GDIPlus_GraphicsDrawImageRect($hGraphic, $hButton[1][0], $PosX + $Relative_X, $PosY + $Relative_Y, $Breite, $Hoehe)
				_GDIPlus_GraphicsDrawImageRect($hBackbuffer_Used, $hButton[1][0], $PosX, $PosY, $Breite, $Hoehe)
				Assign($sName & "_Status", 1)
				$Extended_Msg = $sName
			EndIf
		Else
			Assign($sName & "_Klick", 0)
			If $Status = 1 Then
;~ 				__GDIPlus_GraphicsDrawImageRect($hGraphic, $hButton[0][1], $PosX, $PosY, $Breite, $Hoehe)
				_GDIPlus_GraphicsDrawImageRect($hGraphic, $hButton[0][0], $PosX + $Relative_X, $PosY + $Relative_Y, $Breite, $Hoehe)
				_GDIPlus_GraphicsDrawImageRect($hBackbuffer_Used, $hButton[0][0], $PosX, $PosY, $Breite, $Hoehe)
				Assign($sName & "_Status", 0)
			EndIf
		EndIf
	EndIf
EndFunc   ;==>_GDIPlus_Button

;~ Func __GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, $PosX, $PosY, $Breite, $Hoehe)
;~ 	For $i = 0 To 3 Step 1
;~ 	_GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, $PosX, $PosY, $Breite, $Hoehe)
;~ 	Sleep(5)
;~ Next
;~ EndFunc

Func _Decompress($Res_Comp, $Key, $ZeichenVorrat) ;Zum Dekomprimieren der Bilder
	Local $Laenge = StringLen($Key) / 2
	For $i = 0 To $Laenge - 1
		$Res_Comp = StringReplace($Res_Comp, $ZeichenVorrat[$i], StringRight($Key, 2), 0, 1)
		$Key = StringTrimRight($Key, 2)
	Next
	Return $Res_Comp
EndFunc   ;==>_Decompress

Func _GDIPlus_GraphicsDrawImage($hGraphics, $hImage, $iX, $iY)
	DllCall($ghGDIPDll, "int", "GdipDrawImageI", "handle", $hGraphics, "handle", $hImage, "int", $iX, "int", $iY)
EndFunc   ;==>_GDIPlus_GraphicsDrawImage

Func _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, $iX, $iY, $iW, $iH)
	DllCall($ghGDIPDll, "int", "GdipDrawImageRectI", "handle", $hGraphics, "handle", $hImage, "int", $iX, "int", $iY, "int", $iW, "int", $iH)
EndFunc   ;==>_GDIPlus_GraphicsDrawImageRect

Func _GDIPlus_GraphicsDrawRect($hGraphics, $iX, $iY, $iWidth, $iHeight, $hPen)
	Local $aResult = DllCall($ghGDIPDll, "int", "GdipDrawRectangleI", "handle", $hGraphics, "handle", $hPen, "int", $iX, "int", $iY, "int", $iWidth, "int", $iHeight)
EndFunc   ;==>_GDIPlus_GraphicsDrawRect

#EndRegion UDF´s

#Region Kopierte UDF´s / Externe Funktionen

Func Load_BMP_From_Mem($pic)
	Local $memBitmap, $len, $tMem, $hImage, $hData, $pData, $hStream, $hBitmapFromStream
	$memBitmap = Binary($pic)
	$len = BinaryLen($memBitmap)

	$hData = _MemGlobalAlloc($len, 0x0002)
	$pData = _MemGlobalLock($hData)
	$tMem = DllStructCreate("byte[" & $len & "]", $pData)
	DllStructSetData($tMem, 1, $memBitmap)
	_MemGlobalUnlock($hData)

	$hStream = _WinAPI_CreateStreamOnHGlobal($pData)
	$hBitmapFromStream = _GDIPlus_BitmapCreateFromStream($hStream)
	$tMem = ""
	Return $hBitmapFromStream
EndFunc   ;==>Load_BMP_From_Mem

Func _WinAPI_CreateStreamOnHGlobal($hGlobal = 0, $fDeleteOnRelease = True)
	Local $aResult = DllCall("ole32.dll", "int", "CreateStreamOnHGlobal", "hwnd", $hGlobal, "int", $fDeleteOnRelease, "ptr*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return $aResult[3]
EndFunc   ;==>_WinAPI_CreateStreamOnHGlobal

Func _GDIPlus_BitmapCreateFromStream($pStream)
	Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromStream", "ptr", $pStream, "int*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	Return $aResult[2]
EndFunc   ;==>_GDIPlus_BitmapCreateFromStream

Func _TBmpFromBmp($hImage, $Alpha = 100, $px = 0, $py = 0, $Breite = -1, $Hoehe = -1)
	If $hImage = 0 Then Return 0
	Local $Bild_Breite = _GDIPlus_ImageGetWidth($hImage)
	Local $h = _GDIPlus_ImageGetHeight($hImage)
	Local $Alpha_old, $Alpha_new
	If $Hoehe <> -1 Then $h = $Hoehe
	If $Breite <> -1 Then $Bild_Breite = $Breite
	For $X = $px To $Bild_Breite + $px
		For $Y = $py To $h + $py
			$pixel = _gdiplus_Bitmapgetpixel($hImage, $X, $Y)
			$hex = Hex($pixel)
			$Alpha_old = StringLeft(StringRight($hex, 8), 2)
			$Alpha_new = Hex(Dec($Alpha_old) / 255 * Dec($Alpha) / 255, 2)
			$npixel = "0x" & $Alpha_new & StringRight($hex, 6)
			_gdiplus_Bitmapsetpixel($hImage, $X, $Y, $npixel)
		Next
	Next
	Return $hImage
EndFunc   ;==>_TBmpFromBmp

Func _GDIPlus_BitmapGetPixel($hBitmap, $iX, $iY)
	Local $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapGetPixel", "hwnd", $hBitmap, "int", $iX, "int", $iY, "uint*", 0)
	If @error Then Return SetError(@error, @extended, 0)
	$GDIP_STATUS = $aResult[0]
	Return $aResult[4]
EndFunc   ;==>_GDIPlus_BitmapGetPixel

Func _GDIPlus_BitmapSetPixel($hBitmap, $iX, $iY, $iARGB)
	Local $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapSetPixel", "hwnd", $hBitmap, "int", $iX, "int", $iY, "uint", $iARGB)
	If @error Then Return SetError(@error, @extended, False)
	$GDIP_STATUS = $aResult[0]
	Return $aResult[0] = 0
EndFunc   ;==>_GDIPlus_BitmapSetPixel

;~ Func WM_SETCURSOR($hWnd, $iMsg, $iWParam, $iLParam)
;~ 	If Not ($hWnd = $hGui) Then Return 0
;~ 	If WinActive($Titel) Then DllCall($hDll, "int", "SetCursor", "ptr", $iCursor[0])
;~ 	Return 0
;~ EndFunc   ;==>WM_SETCURSOR

#EndRegion Kopierte UDF´s / Externe Funktionen