|
You last visited: Today at 07:29
Advertisement
[AutoIT Frage] Anstatt Gui Fenster ein Tranparentes Bild nehmen?
Discussion on [AutoIT Frage] Anstatt Gui Fenster ein Tranparentes Bild nehmen? within the AutoIt forum part of the Coders Den category.
10/28/2010, 14:19
|
#1
|
elite*gold: 0
Join Date: Jul 2010
Posts: 62
Received Thanks: 4
|
[AutoIT Frage] Anstatt Gui Fenster ein Tranparentes Bild nehmen?
Hey Leute,
Vorweg diese Frage gibts hier noch nicht oder wurde noch nicht beantwortet hab bereits alles durchsucht -.-"
Gut nun zu meiner Frage ist es möglich anstatt des normalen Fensters (Also wenn man mit Koda einfach ne Gui ohne alles erstellt) ein Bild zu verwenden und darauf Buttons usw zu setzen, Aber jetzt kommt das Problem das Bild soll transparent sein, also so wie der Patcher von Heavenmt2 also der neue natürlich
Ist sowas in AutoIt zu machen wenn ja wie?
Wenns nicht geht kann man eine Dll oder sowas in der Art programmieren und in AutoIt einfügen?
Lg .Pancake
|
|
|
10/28/2010, 17:19
|
#2
|
elite*gold: 0
Join Date: May 2008
Posts: 23
Received Thanks: 10
|
Dafür musst du auf die GDI+ Bibliothek/API zurückgreifen (#include <GDIPlus.au3>) und 2 Fenster erstellen.
Fenster 1 = Hauptfenster und nur für den Hintergrund
Fenster 2 = child-Fenster von Fenster 1 und für labels/buttons etc.
Fenster 2 muss transparent gemacht werden, damit die labels/buttons/... direkt auf dem Hintergrund liegen.
... ein Beispiel:
(zur besseren Lesbarkeit am Besten nach SciTE kopieren)
PHP Code:
#include <GUIConstants.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #include <WinAPI.au3>
Global $pngSrcGUIBK = "C:\bkg.png"
; Hauptfenster für den Hintergrund $GUI = GUICreate("", 942, 528, -1, -1, $WS_POPUP, BitOR($WS_EX_CONTROLPARENT, $WS_EX_LAYERED)) _GDIPlus_Startup() ; lade und aktiviere GDI+ Global $hImageGUIBK = _GDIPlus_ImageLoadFromFile($pngSrcGUIBK) ; lade Hintergrunddatei per GDI+ SetBitmap($GUI, $hImageGUIBK, 255) ; setze Alpha vom Fenster des Bildes auf 255 (transparent)
; => Fenster für buttons etc. $GUIsub = GUICreate("", 942, 528, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $GUI) GUISetBkColor(0x585858) ; => hintergrund ebenfalls durchsichtig, damit die buttons direkt auf das Hintergrundbild gesetzt werden _WinAPI_SetLayeredWindowAttributes($GUIsub, 0x585858)
Func SetBitmap($hGUI, $hImage, $iOpacity) ; lade hintergrundbild und mache den hintergrund transparent Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
$hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC($hMemDC) EndFunc
GDI+ zu meistern ist aber schon deutlich höhere Kunst als einfach nur ein 0815 GUI per Koda zu erstellen.
Damit kannst du auch Animationen usw. einbinden.
|
|
|
10/28/2010, 17:19
|
#3
|
elite*gold: 0
Join Date: Jul 2010
Posts: 450
Received Thanks: 78
|
würde mich auch interresieren...
So könnte man auch ne Transparente Uhr programmieren.
|
|
|
10/28/2010, 18:10
|
#4
|
elite*gold: 0
Join Date: Jul 2010
Posts: 62
Received Thanks: 4
|
@Fuii
Danke dir für deine Hilfe, sowas hab ich gesucht^^
Nur dein Skript funktioniert bei mir nicht so ganz -.-"
## Fehlermeldung ##
PHP Code:
WARNING: $AC_SRC_ALPHA: possibly used before declaration ERROR: $AC_SRC_ALPHA: undeclared global variable
Wenn ich die Variable ganz am Anfang als Globale Variable deklariere passiert gar nicht
Vllt. könntest du mir da auch weiterhelfen^^
@eagly200
Nicht nur ne Uhr kannste damit machen^^
Dir steht die ganze Welt damit offen :P (Naja net ganz^^)
Die Programme kommen dann net ganz so billig rüber xD
Greetz
|
|
|
10/28/2010, 18:26
|
#5
|
elite*gold: 0
Join Date: May 2008
Posts: 23
Received Thanks: 10
|
Ah, mein Fehler.
Die muss vorher natürlich deklariert werden und zwar als Konstante mit dem Wert 1.
Einfach nach den includes, bzw. bei deinen Variablen noch hinzufügen:
PHP Code:
Global Const $AC_SRC_ALPHA = 1
Und du musst natürlich den Pfad zur Hintergrunddatei (pngSrcGUIBK = "C:\bkg.png") ändern.
|
|
|
10/28/2010, 20:19
|
#6
|
elite*gold: 0
Join Date: Jul 2010
Posts: 62
Received Thanks: 4
|
Irgenwie funktionierts noch nicht =(
Liegt daran das keine While Schleife drin ist da sich dann das Programm sofort schließt oder?
Aber wenn ich eine rein bau funktionierts auch noch nicht, kannst du das mal bei dir ausprobieren bitte?^^
|
|
|
10/28/2010, 20:23
|
#7
|
elite*gold: 0
Join Date: Jul 2010
Posts: 450
Received Thanks: 78
|
wie würde das mit ner Uhr gehen???, dann muss ich net extra nen thread aufmachen.
|
|
|
10/28/2010, 20:25
|
#8
|
elite*gold: 0
Join Date: May 2008
Posts: 23
Received Thanks: 10
|
Naja, etwas Vorwissen hätte ich schon vorrausgesetzt.
So musst du neben der while Schleife die beiden Fenster auch noch einblenden (GUISetState()) du Nase.
Voller Code:
PHP Code:
#include <GUIConstants.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #include <WinAPI.au3>
Global $pngSrcGUIBK = "Pfad\zu\Hintergrunddatei" Global Const $AC_SRC_ALPHA = 1
; Hauptfenster für den Hintergrund $GUI = GUICreate("", 942, 528, -1, -1, $WS_POPUP, BitOR($WS_EX_CONTROLPARENT, $WS_EX_LAYERED)) _GDIPlus_Startup() ; lade und aktiviere GDI+ Global $hImageGUIBK = _GDIPlus_ImageLoadFromFile($pngSrcGUIBK) ; lade Hintergrunddatei per GDI+ SetBitmap($GUI, $hImageGUIBK, 255) ; setze Alpha vom Fenster des Bildes auf 255 (transparent)
; => Fenster für buttons etc. $GUIsub = GUICreate("", 942, 528, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $GUI) GUISetBkColor(0x585858) ; => hintergrund ebenfalls durchsichtig, damit die buttons direkt auf das Hintergrundbild gesetzt werden _WinAPI_SetLayeredWindowAttributes($GUIsub, 0x585858)
GUISetState(@SW_SHOW, $GUI) GUISetState(@SW_SHOW, $GUIsub)
While 1 Sleep(100) WEnd
Func SetBitmap($hGUI, $hImage, $iOpacity) ; lade hintergrundbild und mache den hintergrund transparent Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
$hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC($hMemDC) EndFunc
|
|
|
10/28/2010, 20:38
|
#9
|
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,254
|
Quote:
Originally Posted by eagly200
würde mich auch interresieren...
So könnte man auch ne Transparente Uhr programmieren.
|
geh mal in dein autoit ordner..---
C:\Program Files (x86)\AutoIt3\Examples\GUI\Advanced
da findeste eine Clock.au3...
PHP Code:
#include <GDIPlus.au3> #include <WinAPI.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> Opt("MustDeclareVars", 1) ; =============================================================================================================================== ; Description ...: Simple clock using layered windows ; Author ........: Paul Campbell (PaulIA) ; Notes .........: ; =============================================================================================================================== ; =============================================================================================================================== ; Global constants ; =============================================================================================================================== Global Const $iCenter = 200 Global Const $iDotOpacity = 250 Global Const $iHourRad = 140 Global Const $iMinRad = 200 Global Const $iOpacity = 128 Global Const $nPI = 3.1415926535897932384626433832795 Global Const $iRadius = 200 Global Const $iSecRad = 200 Global Const $iTickLen = 0.02 Global Const $AC_SRC_ALPHA = 1 Global Enum $eScrDC=0, $eMemDC, $eBitmap, $eWidth, $eHeight, $eGraphic, $ePen, $eCap, $eBrush, $eFormat, $eFamily, $eFont, $eLayout, $eLast ; =============================================================================================================================== ; Global variables ; =============================================================================================================================== Global $hDial, $hTime, $hHour, $hMin, $hSec, $hDot, $aTime, $aHour, $aMin, $aSec, $aCurr[3][2], $aLast[3][2] ; =============================================================================================================================== ; Main ; =============================================================================================================================== ClockInit() DialDraw () Draw () DotDraw () ClockLoop() ClockDone() ; =============================================================================================================================== ; Finalize clock ; =============================================================================================================================== Func ClockDone() ; Finalize GDI+ resources TimeDone() HourDone() MinDone () SecDone () ; Finalize GDI+ library _GDIPlus_Shutdown() EndFunc ; =============================================================================================================================== ; Initialize clock ; =============================================================================================================================== Func ClockInit() Local $iX, $iY ; Calculate the dial frame caption size $iX = -(_WinAPI_GetSystemMetrics($SM_CXFRAME)) $iY = -(_WinAPI_GetSystemMetrics($SM_CYCAPTION) + _WinAPI_GetSystemMetrics($SM_CYFRAME)) ; Allocate the window resources $hDial = GUICreate("Clock", $iRadius * 2, $iRadius * 2, -1, -1, 0, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) GUISetState() $hTime = GUICreate("Time" , $iRadius * 2, $iRadius * 2, $iX, $iY, 0, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hDial) GUISetState() $hHour = GUICreate("Hour" , $iRadius * 2, $iRadius * 2, $iX, $iY, 0, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hDial) GUISetState() $hMin = GUICreate("Min" , $iRadius * 2, $iRadius * 2, $iX, $iY, 0, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hDial) GUISetState() $hSec = GUICreate("Sec" , $iRadius * 2, $iRadius * 2, $iX, $iY, 0, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hDial) GUISetState() $hDot = GUICreate("Dot" , $iRadius * 2, $iRadius * 2, $iX, $iY, 0, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hDial) GUISetState() ; Initialize GDI+ library _GDIPlus_Startup() ; Initialize GDI+ resources TimeInit() HourInit() MinInit () SecInit () ; Hook non client hit test message so we can move the clock GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") EndFunc ; =============================================================================================================================== ; Loop until user exits ; =============================================================================================================================== Func ClockLoop() do Draw() until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ; =============================================================================================================================== ; Draw the center dot ; =============================================================================================================================== Func DotDraw() Local $aDot $aDot = ResourceInit($iRadius * 2, $iRadius * 2) _GDIPlus_GraphicsFillEllipse($aDot[$eGraphic], $iRadius-10, $iRadius-10, 20, 20) ResourceSet ($hDot, $aDot, $iDotOpacity) ResourceDone($aDot) EndFunc ; =============================================================================================================================== ; Draw the clock elements ; =============================================================================================================================== Func Draw() ; Calculate current time element position $aLast = $aCurr $aCurr[0][0] = $iCenter + Cos(TimeToRadians("sec" )) * $iSecRad $aCurr[0][1] = $iCenter - Sin(TimeToRadians("sec" )) * $iSecRad $aCurr[1][0] = $iCenter + Cos(TimeToRadians("min" )) * $iMinRad $aCurr[1][1] = $iCenter - Sin(TimeToRadians("min" )) * $iMinRad $aCurr[2][0] = $iCenter + Cos(TimeToRadians("hour")) * $iHourRad $aCurr[2][1] = $iCenter - Sin(TimeToRadians("hour")) * $iHourRad ; Draw time elements TimeDraw() HourDraw() MinDraw () SecDraw () EndFunc ; =============================================================================================================================== ; Draw the clock dial ; =============================================================================================================================== Func DialDraw() Local $aDial, $hPen1, $hPen2, $iI, $iN, $iX1, $iY1, $iX2, $iY2 $aDial = ResourceInit($iRadius * 2, $iRadius * 2) $hPen1 = _GDIPlus_PenCreate() $hPen2 = _GDIPlus_PenCreate(0xFF0000FF, 4) for $iI = 0 to 2 * $nPI Step $nPI / 30 $iX1 = $iCenter + Cos($iI) * ($iRadius * (1.00 - $iTickLen)) $iY1 = $iCenter - Sin($iI) * ($iRadius * (1.00 - $iTickLen)) $iX2 = $iCenter + Cos($iI) * $iRadius $iY2 = $iCenter - Sin($iI) * $iRadius if Mod($iN, 5) = 0 then _GDIPlus_GraphicsDrawLine($aDial[$eGraphic], $iX1, $iY1, $iX2, $iY2, $hPen2) else _GDIPlus_GraphicsDrawLine($aDial[$eGraphic], $iX1, $iY1, $iX2, $iY2, $hPen1) endif $iN += 1 next _GDIPlus_PenDispose($hPen2) _GDIPlus_PenDispose($hPen1) ResourceSet ($hDial, $aDial) ResourceDone($aDial) EndFunc ; =============================================================================================================================== ; Finalize resources for the hour hand ; =============================================================================================================================== Func HourDone() _GDIPlus_PenDispose($aHour[$ePen]) _GDIPlus_ArrowCapDispose($aHour[$eCap]) ResourceDone($aHour) EndFunc ; =============================================================================================================================== ; Draw the hour hand ; =============================================================================================================================== Func HourDraw() if ($aLast[2][0] = $aCurr[2][0]) and ($aLast[2][1] = $aCurr[2][1]) then Return _GDIPlus_GraphicsDrawLine($aHour[$eGraphic], $iCenter, $iCenter, $aCurr[2][0], $aCurr[2][1], $aHour[$ePen]) ResourceSet($hHour, $aHour) EndFunc ; =============================================================================================================================== ; Initialize resources for the hour hand ; =============================================================================================================================== Func HourInit() $aHour = ResourceInit($iRadius * 2, $iRadius * 2) $aHour[$ePen] = _GDIPlus_PenCreate(0xFFFF00FF) $aHour[$eCap] = _GDIPlus_ArrowCapCreate($iHourRad / 2, 8) _GDIPlus_PenSetCustomEndCap($aHour[$ePen], $aHour[$eCap]) EndFunc ; =============================================================================================================================== ; Finalize resources for the minute hand ; =============================================================================================================================== Func MinDone() _GDIPlus_PenDispose($aMin[$ePen]) _GDIPlus_ArrowCapDispose($aMin[$eCap]) ResourceDone($aMin) EndFunc ; =============================================================================================================================== ; Draw the minute hand ; =============================================================================================================================== Func MinDraw() if ($aLast[1][0] = $aCurr[1][0]) and ($aLast[1][1] = $aCurr[1][1]) then Return _GDIPlus_GraphicsFillRect($aMin[$eGraphic], 0, 0, $iRadius * 2, $iRadius * 2) _GDIPlus_GraphicsDrawLine($aMin[$eGraphic], $iCenter, $iCenter, $aCurr[1][0], $aCurr[1][1], $aMin[$ePen]) ResourceSet($hMin, $aMin) EndFunc ; =============================================================================================================================== ; Initialize resources for the minute hand ; =============================================================================================================================== Func MinInit() $aMin = ResourceInit($iRadius * 2, $iRadius * 2) $aMin[$ePen] = _GDIPlus_PenCreate(0xFFFF0000) $aMin[$eCap] = _GDIPlus_ArrowCapCreate($iMinRad / 2, 8) _GDIPlus_PenSetCustomEndCap($aMin[$ePen], $aMin[$eCap]) EndFunc ; =============================================================================================================================== ; Finalize resources for the second hand ; =============================================================================================================================== Func SecDone() _GDIPlus_PenDispose($aSec[$ePen]) ResourceDone($aSec) EndFunc ; =============================================================================================================================== ; Draw the second hand ; =============================================================================================================================== Func SecDraw() if ($aLast[0][0] = $aCurr[0][0]) and ($aLast[0][1] = $aCurr[0][1]) then Return _GDIPlus_GraphicsFillRect($aSec[$eGraphic], 0, 0, $iRadius * 2, $iRadius * 2) _GDIPlus_GraphicsDrawLine($aSec[$eGraphic], $iCenter, $iCenter, $aCurr[0][0], $aCurr[0][1], $aSec[$ePen]) ResourceSet($hSec, $aSec) EndFunc ; =============================================================================================================================== ; Initialize resources for the second hand ; =============================================================================================================================== Func SecInit() $aSec = ResourceInit($iRadius * 2, $iRadius * 2) $aSec[$ePen] = _GDIPlus_PenCreate(0xFF000000) EndFunc ; =============================================================================================================================== ; Finalize drawing resources ; =============================================================================================================================== Func ResourceDone(ByRef $aInfo) _GDIPlus_GraphicsDispose($aInfo[$eGraphic]) _WinAPI_ReleaseDC (0, $aInfo[$eScrDC]) _WinAPI_DeleteObject($aInfo[$eBitmap]) _WinAPI_DeleteDC ($aInfo[$eMemDC ]) EndFunc ; =============================================================================================================================== ; Initialize bitmap resources ; =============================================================================================================================== Func ResourceInit($iWidth, $iHeight) Local $aInfo[$eLast + 1] $aInfo[$eScrDC ] = _WinAPI_GetDC(0) $aInfo[$eMemDC ] = _WinAPI_CreateCompatibleDC($aInfo[$eScrDC]) $aInfo[$eBitmap ] = _WinAPI_CreateCompatibleBitmap($aInfo[$eScrDC], $iWidth, $iHeight) _WinAPI_SelectObject($aInfo[$eMemDC], $aInfo[$eBitmap]) $aInfo[$eWidth ] = $iWidth $aInfo[$eHeight ] = $iHeight $aInfo[$eGraphic] = _GDIPlus_GraphicsCreateFromHDC($aInfo[$eMemDC]) _GDIPlus_GraphicsFillRect($aInfo[$eGraphic], 0, 0, $iRadius * 2, $iRadius * 2) Return $aInfo EndFunc ; =============================================================================================================================== ; Update layered window with resource information ; =============================================================================================================================== Func ResourceSet($hGUI, ByRef $aInfo, $iAlpha=-1) Local $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend if $iAlpha = -1 then $iAlpha = $iOpacity $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize ) DllStructSetData($tSize, "X", $aInfo[$eWidth ]) DllStructSetData($tSize, "Y", $aInfo[$eHeight]) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend ) DllStructSetData($tBlend, "Alpha" , $iAlpha ) DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA) _WinAPI_UpdateLayeredWindow($hGUI, $aInfo[$eScrDC], 0, $pSize, $aInfo[$eMemDC], $pSource, 0, $pBlend, $ULW_ALPHA) EndFunc ; =============================================================================================================================== ; Finalize resources for the digital time ; =============================================================================================================================== Func TimeDone() _GDIPlus_FontDispose ($aTime[$eFont ]) _GDIPlus_FontFamilyDispose ($aTime[$eFamily]) _GDIPlus_StringFormatDispose($aTime[$eFormat]) _GDIPlus_BrushDispose ($aTime[$eBrush ]) ResourceDone($aTime) EndFunc ; =============================================================================================================================== ; Draw the digital time ; =============================================================================================================================== Func TimeDraw() Local $sString, $aSize if ($aLast[0][0] = $aCurr[0][0]) and ($aLast[0][1] = $aCurr[0][1]) then Return $sString = StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC) $aSize = _GDIPlus_GraphicsMeasureString($aTime[$eGraphic], $sString, $aTime[$eFont], $aTime[$eLayout], $aTime[$eFormat]) DllStructSetData($aTime[$eLayout], "X", $iRadius - (DllStructGetData($aSize[0], "Width") / 2)) DllStructSetData($aTime[$eLayout], "Y", $iRadius / 3) _GDIPlus_GraphicsFillRect($aTime[$eGraphic], 0, 0, $iRadius * 2, $iRadius * 2) _GDIPlus_GraphicsDrawStringEx($aTime[$eGraphic], $sString, $aTime[$eFont], $aTime[$eLayout], $aTime[$eFormat], $aTime[$eBrush]) ResourceSet($hTime, $aTime) EndFunc ; =============================================================================================================================== ; Initialize resources for the digital time ; =============================================================================================================================== Func TimeInit() $aTime = ResourceInit($iRadius * 2, $iRadius * 2) $aTime[$eBrush ] = _GDIPlus_BrushCreateSolid(0xFF008080) $aTime[$eFormat] = _GDIPlus_StringFormatCreate() $aTime[$eFamily] = _GDIPlus_FontFamilyCreate("Arial") $aTime[$eFont ] = _GDIPlus_FontCreate($aTime[$eFamily], 24, 1) $aTime[$eLayout] = _GDIPlus_RectFCreate(0, 0, $iRadius * 2, 40) EndFunc ; =============================================================================================================================== ; Convert time value to radians ; =============================================================================================================================== Func TimeToRadians($sTimeType) Switch $sTimeType case "sec" Return ($nPI / 2) - (@SEC * ($nPI / 30)) case "min" Return ($nPI / 2) - (@MIN * ($nPI / 30)) - (Int(@SEC / 10) * ($nPI / 180)) case "hour" Return ($nPI / 2) - (@HOUR * ($nPI / 6 )) - (@MIN / 12) * ($nPI / 30) EndSwitch EndFunc ; =============================================================================================================================== ; Handle the WM_NCHITTEST message so our window can be dragged ; =============================================================================================================================== Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam) if $hWnd = $hDial then Return $HTCAPTION EndFunc
|
|
|
10/28/2010, 20:40
|
#10
|
elite*gold: 0
Join Date: Jul 2010
Posts: 62
Received Thanks: 4
|
@eagly200
Du brauchst erstmal ne Gui also Bilder wo der Zeiger an allen Stellen steht auser du machst 3 Bilder:
1, Ziffernblatt
2, Stundenzeiger
3, Minutenzeiger
evtl. 4, Sekundenzeiger
Dann lässt du diese Bilder einfach nur rotieren also des heißt so z.b:
Wenn eine Sekunde um ist drehe Sekundenzeiger um 1 Grad oder so ähnlich...
@Fuii
Du bist genial
Achja ich fang in den Ferien wieder mit AutoIt an will nur so n paar Sachen nochmal wissen bevor ich Anfang ^^
Greetz
|
|
|
|
Similar Threads
|
Autoit: Firefox anstatt Internet Explorer
08/01/2010 - General Coding - 1 Replies
Hi :)
ich hab das problem IE läuft bei mir net gut und es gibt ja UDF´s für FF und ich wollte fragen, wie ich die Befehle von der FF.au3 in Autoit benutzen kann :confused:
mfg crossi xD
schomma danke im vorraus:handsdown::handsdown::handsdown:
|
Sura Fenster Bild Ändern ?
05/11/2010 - Metin2 Private Server - 3 Replies
Hallo arbeite grade sehr schön an meinem Clienten jetzt stört mich das Sura Fenster ganz am anfang kann man das auch irgendwie ändern ?
wenn ja so ?
|
Fenster verschiben mit autoit
01/21/2010 - AutoIt - 4 Replies
so ich hab mal eine frage wie mach ich das autoit die linke maustaste halten soll und ein Fenster in eine bestimte position bringen soll ???
|
Fenster machen in autoit
01/13/2010 - AutoIt - 3 Replies
Leute also ich habe schon 2 bots und wollte mal fragen
wie ich mein Bot in ein Fenster mache und dann nen Button
für meine Bot functionen mache pls helft mir !!!
______________________________________
ihr kriegt auch ein THX!!!
______________________________________
:handsdown::handsdown::handsdown:
|
[AutoIT-Frage] Bildschrim absuchen nach Bild und Mausklick
10/19/2009 - Metin2 - 3 Replies
Wie Oben schon genannt. Ich suche den Befehl für AutoIT, das er den Bildschirm nach einem Bild absucht, und wenn er es gefunden hat (das Bild ist öfters da), dann soll er die Maus dahin bewegen und drauf klicken. Und dann soll er nach einem anderem Bild suchen, und da auch draufklicken. Ich hoffe mir kann hier jemand helfen.
Zweck: Ich möchte einen Bot programmieren, der alle PN's in Metin2 schließt, da wenn man Rufen möchte, sofort (auf Sertain) dich 17 Spammer anschreiben. -.- Und das nervt....
|
All times are GMT +2. The time now is 07:29.
|
|