#include <GuiConstantsEx.au3>
#include <array.au3>
#include <string.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <Timers.au3>
_GDIPlus_Startup()
$hwnd = GUICreate("Mathe", 800, 900)
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hwnd)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics(800, 900, $hGraphics)
$hBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsSetSmoothingMode($hBuffer, 2)
_GDIPlus_GraphicsClear($hGraphics, 0xFFFFFFFF)
GUISetState(@SW_SHOW)
Opt("GuiOnEventMode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Close")
$hTimer = _Timer_SetTimer($hWnd, 100, "WM_PAINT")
$hPen_All=_GDIPlus_PenCreate(0xFF000000, 2)
$hPen_Arrow=_GDIPlus_PenCreate(0xFF000000, 2)
$hCap = _GDIPlus_ArrowCapCreate (3, 6)
_GDIPlus_PenSetCustomEndCap ($hPen_Arrow, $hCap)
;~ _GDIPlus_PenSetCustomCap ($hPen_Arrow, $hCap)
While 1

WEnd
Func WM_PAINT($hWnd, $Msg, $iIDTimer, $dwTime)
	_GDIPlus_GraphicsClear($hBuffer, 0xFFFFFFFF)

	_GDIPlus_GraphicsDrawRect($hBuffer, 250, 300, 25, 600, $hPen_All)
	_GDIPlus_GraphicsDrawRect($hBuffer, 350, 100, 25, 800, $hPen_All)
	_GDIPlus_GraphicsDrawLine($hBuffer, 350, 880, 275, 880, $hPen_Arrow)
	_GDIPlus_GraphicsDrawLine($hBuffer, 275, 880, 350, 880, $hPen_Arrow)
	_GDIPlus_GraphicsDrawString($hBuffer, "100 Fuß", 275, 860, "Arial", 12)
	_GDIPlus_GraphicsDrawLine($hBuffer, 225, 300, 225, 900, $hPen_Arrow)
	_GDIPlus_GraphicsDrawLine($hBuffer, 225, 900, 225, 300, $hPen_Arrow)
	_DrawSpinnedText($hBuffer, "60 Fuß", 200, 425, 270)

	_GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
EndFunc
Func _DrawSpinnedText($hGraphics_s, $hText,$x, $y, $nAngle)
	$hMatrix = _GDIPlus_MatrixCreate()
	$hBMP = _GDIPlus_BitmapCreateFromGraphics(StringLen($hText)*12, 16, $hGraphics_s)
	$hG = _GDIPlus_ImageGetGraphicsContext($hBMP)
	_GDIPlus_GraphicsSetSmoothingMode($hG, 2)
	_GDIPlus_GraphicsDrawString($hG, $hText, 0, 0, "Arial", 12)
	_GDIPlus_MatrixRotate($hMatrix, $nAngle, "False")
	_GDIPlus_GraphicsSetTransform($hG, $hMatrix)
	_GDIPlus_GraphicsDrawImage($hGraphics_s, $hBMP, $x, $y)




EndFunc










Func _Close()
	_GDIPlus_Shutdown()
	exit 0
EndFunc
