Alles anzeigenNaja ich weiß nicht genau, was das sein soll und das als free autoit Objekt zu bezeichnen ist denke ich mal nicht richtig. das es keine Objekte sind, sondern nur etwas auf eine gui gezeichnet wird.
Das ist die einige Funktion aus eurer UDF die wirklich wichtig ist und die es im Web so, oder so ähnlich schon 1000 mal gibt.Spoiler anzeigen
[autoit]Func _StartUp($title, $width, $height, $X, $Y)
[/autoit] [autoit][/autoit] [autoit]
$hWnd = GUICreate($title, $width, $height, $X, $Y, 0x80000000, BitOR(0x00000080, 0x00080000, 0x00000008))
GUISetOnEvent(-3, "_ShutDown")
GUISetState()_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic)
$backbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsSetSmoothingMode($backbuffer, 4)$ScreenDc = _WinAPI_GetDC($hWnd)
[/autoit] [autoit][/autoit] [autoit]
$dc = _WinAPI_CreateCompatibleDC($ScreenDc)$tSize = DllStructCreate($tagSIZE)
[/autoit]
$pSize = DllStructGetPtr($tSize)
DllStructSetData($tSize, "X", $width)
DllStructSetData($tSize, "Y", $height)
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", 255)
DllStructSetData($tBlend, "Format", 1)
$tPoint = DllStructCreate($tagPOINT)
$pPoint = DllStructGetPtr($tPoint)
DllStructSetData($tPoint, "X", 0)
DllStructSetData($tPoint, "Y", 0)
EndFunc ;==>_StartUp
diese funktion:
Spoiler anzeigen
[autoit]Func _AutoIt_FreeObject_StringDraw($String, $WindowTitle, $WindowX, $WindowY, $iSize = 15, $brush = 0xA50029)
[/autoit]
Local $WinPosition = WinGetPos($WindowTitle)
$State = WinGetState($WindowTitle)
If BitAND($State, Then
$Family = _GDIPlus_FontFamilyCreate("Arial")
$Font = _GDIPlus_FontCreate($Family, $iSize, 1)
$Layout = _GDIPlus_RectFCreate($WinPosition[0] + $WindowX + 1, $WinPosition[1] + $WindowY + 27, @DesktopWidth, @DesktopHeight)
$Format = _GDIPlus_StringFormatCreate()
$brush = _GDIPlus_BrushCreateSolid($brush + 0xFF000000)
$Info = _GDIPlus_GraphicsMeasureString($backbuffer, $String, $Font, $Layout, $Format)
_GDIPlus_GraphicsDrawStringEx($backbuffer, $String, $Font, $Info[0], $Format, $brush)
EndIf
EndFunc ;==>_AutoIt_FreeObject_StringDraw
ist nichts anderes als die hier aus der gdi+Spoiler anzeigen
[autoit]Func _GDIPlus_GraphicsDrawString($hGraphics, $sString, $nX, $nY, $sFont = "Arial", $nSize = 10, $iFormat = 0)
[/autoit]
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_GraphicsDrawStringund solch eine funktion:
Spoiler anzeigen
[autoit]Func _GDIPlus_GraphicsDrawRoundedRect($hGraphics, $iX, $iY, $iWidth, $iHeight, $iRadius = 30, $Pen = "")
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsDrawArc($hGraphics, $iX, $iY, $iRadius, $iRadius, 180, 90, $Pen)
_GDIPlus_GraphicsDrawArc($hGraphics, $iX + $iWidth - $iRadius, $iY, $iRadius, $iRadius, 270, 90, $Pen)
_GDIPlus_GraphicsDrawArc($hGraphics, $iX, $iY + $iHeight - $iRadius, $iRadius, $iRadius, 90, 90, $Pen)
_GDIPlus_GraphicsDrawArc($hGraphics, $iX + $iWidth - $iRadius, $iY + $iHeight - $iRadius, $iRadius, $iRadius, 360, 90, $Pen)_GDIPlus_GraphicsDrawLine($hGraphics, $iX + $iRadius / 2, $iY, $iX + $iWidth - $iRadius / 2, $iY, $Pen)
[/autoit]
_GDIPlus_GraphicsDrawLine($hGraphics, $iX, $iY + $iRadius / 2, $iX, $iY + $iHeight - $iRadius / 2, $Pen)
_GDIPlus_GraphicsDrawLine($hGraphics, $iX + $iRadius / 2, $iY + $iHeight, $iX + $iWidth - $iRadius / 2, $iY + $iHeight, $Pen)
_GDIPlus_GraphicsDrawLine($hGraphics, $iX + $iWidth, $iY + $iRadius / 2, $iX + $iWidth, $iY + $iHeight - $iRadius / 2, $Pen)
EndFunc ;==>_GDIPlus_GraphicsDrawRoundedRect
hat letztens jemand hier im forum veröffentlicht.
Ich hab die _StartUp() selbst erstellt, und nur die DllStructs übernommen.
Und derjenige, der die _GDIPlus_GraphicsDrawRoundedRect() veröffentlicht hat, war auch ich (Obwohl das keine schwierige Sache war :S).
Und nun zum Thema:
Ich find die Idee nicht schlecht, und man kann sicher noch viel daraus machen.
Idee: * * * * *
Umsetzung: * * * *