Von diesem Thread kannst du dir einiges abschauen.
Und hier hast du ein gutes GDI+ Tutorial.
Von diesem Thread kannst du dir einiges abschauen.
Und hier hast du ein gutes GDI+ Tutorial.
Probier es mit der For-Schleife.
[autoit]For $i = 0 To 10 Step +1
MsgBox(0, "For-Schleife", "$i = " & $i)
Next
Versuchs mal so:
[autoit]$Split = StringSplit(IniRead("INI.ini", "LuxCAD", "Version", "Error"), "")
MsgBox(0, "", "Version: " & $Split[1] & "." & $Split[2] & _
" vom " & $Split[7] & $Split[8] & "." & $Split[5] & $Split[6] & ".20" & $Split[3] & $Split[4])
MfG,
H2112.
Schau mal wie alt der Thread ist, du Leichenschänder.
Edit:
Zu deiner Frage: Ja gibt es.
Wurzel: Sqrt
Hochzahl: Zahl² = Zahl * Zahl Edit BugFix: x hoch y in AutoIt: x^y
Edit:
Ich wusste, dass es mit einem Zeichen geht, aber nicht mehr mit welchem. Danke.
Bitte.
Wenn das die Antwort war, kannst den Thread doch auf gelöst stellen.
#Update. Siehe 1. Post
ToDo-Liste angelegt
Beispiel hinzugefügt
Danke für das umfangreiche Feedback.
Wirklich super gemacht!
Gerademal die CPU-Auslastung ist ein Minus, ansonsten !
Ich hatte da noch sowas in Erinnerung, und es dann gesucht.
Hier bitte:
https://autoit.de/index.php?page=Thread&threadID=20242
#Update. Siehe 1. Post
#Update. Siehe 1. Post
Da hier vorgeschlagen wurde, einen GDI+ Live Editor zu machen, wollte ich versuchen, den Vorschlag zu realisieren.
#include <GDIPlus.au3>
#include <GDIPlusConstants.au3>
#include <Misc.au3>
Opt("GUIOnEventMode", 1)
Opt("MouseCoordMode", 2)
Global $MainGUI[10], $CodeGUI[10], $CtrlGUI[10], $Code[10]
Global $GDIPForm = "", $Direction[2]
Global $Line[100][4], $Elli[100][4], $Rect[100][4]
$MainGUI[0] = GUICreate("GDI+ LiveEditor", 300, 300, -1, -1)
GUISetOnEvent(-3, "_Exit")
GUISetCursor(16)
GUISetState()
_GDIPlus_Startup()
$MainGUI[1] = _GDIPlus_GraphicsCreateFromHWND($MainGUI[0])
$MainGUI[2] = _GDIPlus_BitmapCreateFromGraphics(300, 300, $MainGUI[1])
$MainGUI[3] = _GDIPlus_ImageGetGraphicsContext($MainGUI[2])
$CtrlGUI[0] = GUICreate("Controls", 290, 120, -1, -1, 0, 0x00000080, $MainGUI[0])
$CtrlGUI[1] = GUICtrlCreateButton("None", 10, 10, 50, 50)
GUICtrlSetOnEvent(-1, "_ChangeForm")
$CtrlGUI[2] = GUICtrlCreateButton("Line", 70, 10, 50, 50)
GUICtrlSetOnEvent(-1, "_ChangeForm")
$CtrlGUI[3] = GUICtrlCreateButton("Ellipse", 130, 10, 50, 50)
GUICtrlSetOnEvent(-1, "_ChangeForm")
$CtrlGUI[4] = GUICtrlCreateButton("Rect", 190, 10, 50, 50)
GUICtrlSetOnEvent(-1, "_ChangeForm")
GUISetState()
$CodeGUI[0] = GUICreate("Code Box", 400, 500, -1, -1, 0x00040000, 0x00000080, $MainGUI[0])
$CodeGUI[1] = GUICtrlCreateEdit($Code[0], 0, 0, 398, 480)
GUICtrlSetFont(-1, 9.5, 400, 0, "Courier New")
GUICtrlSetResizing(-1, 102)
GUISetState()
While 1
Sleep(10)
_Update()
If WinActive($MainGUI[0]) And $GDIPForm And _IsPressed(01) Then _NewForm()
WEnd
Func _Update()
Local $MousePos = MouseGetPos()
_GDIPlus_GraphicsClear($MainGUI[3], 0xFFFFFFFF)
If WinActive($MainGUI[0]) Then
_GDIPlus_GraphicsDrawLine($MainGUI[3], $MousePos[0] - 3, $MousePos[1], $MousePos[0] + 3, $MousePos[1])
_GDIPlus_GraphicsDrawLine($MainGUI[3], $MousePos[0], $MousePos[1] - 3, $MousePos[0], $MousePos[1] + 3)
EndIf
If Not $Line[0][0] = 0 Then
For $i = 1 To $Line[0][0]
_GDIPlus_GraphicsDrawLine($MainGUI[3], $Line[$i][0], $Line[$i][1], $Line[$i][2], $Line[$i][3])
Next
EndIf
If Not $Elli[0][0] = 0 Then
For $i = 1 To $Elli[0][0]
_GDIPlus_GraphicsDrawEllipse($MainGUI[3], $Elli[$i][0], $Elli[$i][1], $Elli[$i][2] - $Elli[$i][0], $Elli[$i][3] - $Elli[$i][1])
Next
EndIf
If Not $Rect[0][0] = 0 Then
For $i = 1 To $Rect[0][0]
_GDIPlus_GraphicsDrawRect($MainGUI[3], $Rect[$i][0], $Rect[$i][1], $Rect[$i][2] - $Rect[$i][0], $Rect[$i][3] - $Rect[$i][1])
Next
EndIf
_GDIPlus_GraphicsDrawImageRect($MainGUI[1], $MainGUI[2], 0, 0, 300, 300)
EndFunc ;==>_Update
Func _Exit()
_GDIPlus_GraphicsDispose($MainGUI[3])
_GDIPlus_BitmapDispose($MainGUI[2])
_GDIPlus_GraphicsDispose($MainGUI[1])
_GDIPlus_Shutdown()
GUIDelete($MainGUI[0])
Exit
EndFunc ;==>_Exit
Func _NewForm()
Local $MousePos = MouseGetPos()
If $GDIPForm = 1 Then
$Line[0][0] += 1
$Line[$Line[0][0]][0] = $MousePos[0]
$Line[$Line[0][0]][1] = $MousePos[1]
While _IsPressed(01)
$MousePos = MouseGetPos()
$Line[$Line[0][0]][2] = $MousePos[0]
$Line[$Line[0][0]][3] = $MousePos[1]
_Update()
Sleep(10)
WEnd
If $Line[$Line[0][0]][0] = $Line[$Line[0][0]][2] And $Line[$Line[0][0]][1] = $Line[$Line[0][0]][3] Then $Line[0][0] -= 1
ElseIf $GDIPForm = 2 Then
$Elli[0][0] += 1
$Elli[$Elli[0][0]][0] = $MousePos[0]
$Elli[$Elli[0][0]][1] = $MousePos[1]
While _IsPressed(01)
$MousePos = MouseGetPos()
$Elli[$Elli[0][0]][2] = $MousePos[0]
$Elli[$Elli[0][0]][3] = $MousePos[1]
_Update()
Sleep(10)
WEnd
If $Elli[$Elli[0][0]][0] = $Elli[$Elli[0][0]][2] And $Elli[$Elli[0][0]][1] = $Elli[$Elli[0][0]][3] Then $Elli[0][0] -= 1
$Direction[0] = 0
$Direction[1] = 0
ElseIf $GDIPForm = 3 Then
$Rect[0][0] += 1
$Rect[$Rect[0][0]][0] = $MousePos[0]
$Rect[$Rect[0][0]][1] = $MousePos[1]
While _IsPressed(01)
$MousePos = MouseGetPos()
If $Rect[$Rect[0][0]][0] > $MousePos[0] Or $Direction[0] = 1 Then
If Not $Direction[0] Then
$Rect[$Rect[0][0]][2] = $Rect[$Rect[0][0]][0]
$Rect[$Rect[0][0]][0] = $MousePos[0]
$Direction[0] = 1
ElseIf $Rect[$Rect[0][0]][0] < $MousePos[0] Then
$Rect[$Rect[0][0]][0] = $Rect[$Rect[0][0]][2]
$Rect[$Rect[0][0]][2] = $MousePos[0]
$Direction[0] = 0
Else
$Rect[$Rect[0][0]][0] = $MousePos[0]
EndIf
Else
$Rect[$Rect[0][0]][2] = $MousePos[0]
EndIf
If $Rect[$Rect[0][0]][1] > $MousePos[1] Or $Direction[1] = 1 Then
If Not $Direction[1] Then
$Rect[$Rect[0][0]][3] = $Rect[$Rect[0][0]][1]
$Rect[$Rect[0][0]][1] = $MousePos[1]
$Direction[1] = 1
ElseIf $Rect[$Rect[0][0]][1] < $MousePos[1] Then
$Rect[$Rect[0][0]][1] = $Rect[$Rect[0][0]][3]
$Rect[$Rect[0][0]][3] = $MousePos[1]
$Direction[1] = 0
Else
$Rect[$Rect[0][0]][1] = $MousePos[1]
EndIf
Else
$Rect[$Rect[0][0]][3] = $MousePos[1]
EndIf
_Update()
Sleep(10)
WEnd
If $Rect[$Rect[0][0]][0] = $Rect[$Rect[0][0]][2] And $Rect[$Rect[0][0]][1] = $Rect[$Rect[0][0]][3] Then $Rect[0][0] -= 1
$Direction[0] = 0
$Direction[1] = 0
EndIf
_UpdateCode()
EndFunc ;==>_NewForm
Func _ChangeForm()
If @GUI_CtrlId = $CtrlGUI[1] Then $GDIPForm = 0
If @GUI_CtrlId = $CtrlGUI[2] Then $GDIPForm = 1
If @GUI_CtrlId = $CtrlGUI[3] Then $GDIPForm = 2
If @GUI_CtrlId = $CtrlGUI[4] Then $GDIPForm = 3
EndFunc ;==>_ChangeForm
Func _UpdateCode()
$Code[0] = "#include <GDIPlus.au3>" & @CRLF & _
"#include <GDIPlusConstants.au3>" & @CRLF & _
@CRLF & _
'Opt("GUIOnEventMode", 1)' & @CRLF & _
@CRLF & _
"Global $hWnd, $hGraphic, $hBitmap, $backbuffer" & @CRLF & _
'Global $title = "GDI+ LiveEditor", _' & @CRLF & _
" $width = 300, _ " & @CRLF & _
" $height = 300" & @CRLF & _
@CRLF & _
"_Startup()" & @CRLF & _
@CRLF
$Code[1] = "While 1" & @CRLF & _
" Sleep(100)" & @CRLF & _
" _Update()" & @CRLF & _
"WEnd" & @CRLF & _
@CRLF
$Code[2] = "Func _Startup()" & @CRLF & _
" $hWnd = GUICreate($title, $width, $height, -1, -1)" & @CRLF & _
' GUISetOnEvent(-3, "_Shutdown")' & @CRLF & _
" GUISetState()" & @CRLF & _
@CRLF & _
" _GDIPlus_Startup()" & @CRLF & _
" $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)" & @CRLF & _
" $hBitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic)" & @CRLF & _
" $backbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)" & @CRLF & _
"EndFunc" & @CRLF & _
@CRLF
$Code[3] = "Func _Shutdown()" & @CRLF & _
" _GDIPlus_GraphicsDispose($backbuffer)" & @CRLF & _
" _GDIPlus_BitmapDispose($hBitmap)" & @CRLF & _
" _GDIPlus_GraphicsDispose($hGraphic)" & @CRLF & _
" _GDIPlus_Shutdown()" & @CRLF & _
" GUIDelete($hWnd)" & @CRLF & _
" Exit" & @CRLF & _
"EndFunc" & @CRLF & _
@CRLF
$Code[4] = "Func _Update()" & @CRLF & _
" _GDIPlus_GraphicsClear($backbuffer, 0xFFFFFFFF)" & @CRLF
For $i = 1 To $Line[0][0]
$Code[4] &= @TAB & "_GDIPlus_GraphicsDrawLine($backbuffer, " & $Line[$i][0] & ", " & $Line[$i][1] & ", " & $Line[$i][2] & ", " & $Line[$i][3] & ")" & @CRLF
Next
For $i = 1 To $Elli[0][0]
$Code[4] &= @TAB & "_GDIPlus_GraphicsDrawEllipse($backbuffer, " & $Elli[$i][0] & ", " & $Elli[$i][1] & ", " & $Elli[$i][2] - $Elli[$i][0] & ", " & $Elli[$i][3] - $Elli[$i][1] & ")" & @CRLF
Next
For $i = 1 To $Rect[0][0]
$Code[4] &= @TAB & "_GDIPlus_GraphicsDrawRect($backbuffer, " & $Rect[$i][0] & ", " & $Rect[$i][1] & ", " & $Rect[$i][2] - $Rect[$i][0] & ", " & $Rect[$i][3] - $Rect[$i][1] & ")" & @CRLF
Next
$Code[4] &= " _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $width, $height)" & @CRLF & _
"EndFunc" & @CRLF
GUICtrlSetData($CodeGUI[1], $Code[0] & $Code[1] & $Code[2] & $Code[3] & $Code[4] & $Code[5] & $Code[6] & $Code[7] & $Code[8] & $Code[9])
EndFunc ;==>_UpdateCode
v0.11.01 Fadenkreuz und Maussteuerung hinzugefügt, sowie kleinere Fehler beseitigt.
v0.12.01 Neue Formen hinzugefügt
v0.13.01 In alle Richtungen zeichnen hinzugefügt
Verbesserungsvorschläge und konstruktive Kritik sind natürlich gerne gesehen.
MfG,
H2112.
Also ich finde das eine sehr gute Idee.
Und mir ist da auch gleich eine Idee gekommen.
Ich versuch mich mal dran.
MfG,
H2112.
Es ist zwar eine gute Idee, aber für AutoIt ungeeignet, da es wie bereits gesagt einen Decompiler gibt. Nach wie vor.
Jeder der das Wissen hat, nach etwas zu googeln kommt leicht an diesen ran.
Auch obfuscatede Skripte kann der Decompiler in die Originalversion zurückversetzen, was den Ofuscator eigentlich nutzlos bzw. überflüssig macht.
Eine mit AutoIt erstellte *.exe ist daher immer unsicher, es sei denn, man verändert die *.exe.
Danke für die vielen Antworten.
Da ich es jetzt mal selbst probiert habe, komme ich leider zum selben Ergebniss wie UEZ.
Beim umwandeln in GDI+ geht die ganze transparents verlorern.
[autoit]Func _GDIPlus_ConvertIcon($mPath)
Local $Icon, $Ret
$Icon = _WinAPI_PrivateExtractIcon($mPath, 0, 256, 256)
$Ret = DllCall($ghGDIPDll, "int", "GdipCreateBitmapFromHICON", "ptr", $Icon, "int*", 0)
Return $Ret[2]
EndFunc
Gibt es nicht irgendwo eine Funktion, die hier Abhilfe schaffen kann?
Schönen Nachmittag.
Die Überschrift sagt ja eigentlich schon alles, aber ich erklär das Problem nochmal:
Ich habe eine *.exe Datei, von der ich das Icon extrahieren will, und es anschließend mit GDI+ in eine GUI zeichnen will.
Und ich finde einfach keine Lösung für das Problem, und hoffe ihr könnt mir hierbei helfen.
Danke schonmal im Voraus.
MfG,
h2112.
Und natürlich auch alles Gute von mir.
So würd ichs mit GDI+ machen.
#include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit]Global $hWnd, $hGraphic, $hBitmap, $backbuffer
Global $ScreenDc, $dc, $tSize, $pSize, $tSource, $pSource, $tBlend, $pBlend, $tPoint, $pPoint, $gdibitmap
Global $title = "GDI+ Beispiel: Transparentes Fenster", _
$width = 150, _
$height = 150
_StartUp()
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsDrawRoundedRect($backbuffer, 0, 0, $width - 1, $height - 1, 15)
[/autoit] [autoit][/autoit] [autoit]_UpDate()
[/autoit] [autoit][/autoit] [autoit]While 1
Sleep(100)
WEnd
Func _StartUp()
$hWnd = GUICreate($title, $width, $height, -1, -1, 0x80000000, BitOR(0x00000080, 0x00080000, 0x00000008))
GUISetOnEvent(-3, "_ShutDown")
GUISetState()
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic)
$backbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsSetSmoothingMode($backbuffer, 4)
$ScreenDc = _WinAPI_GetDC($hWnd)
$dc = _WinAPI_CreateCompatibleDC($ScreenDc)
$tSize = DllStructCreate($tagSIZE)
$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
Func _ShutDown()
_WinAPI_DeleteDC($dc)
_WinAPI_ReleaseDC($hWnd, $ScreenDc)
_GDIPlus_GraphicsDispose($backbuffer)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
GUIDelete($hWnd)
Exit
EndFunc
Func _UpDate()
$gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
_WinAPI_SelectObject($dc, $gdibitmap)
_WinAPI_UpdateLayeredWindow($hWnd, $ScreenDc, 0, $pSize, $dc, $pSource, 0, $pBlend, 2)
_WinAPI_DeleteObject($gdibitmap)
EndFunc
Func _GDIPlus_GraphicsDrawRoundedRect($hGraphics, $iX, $iY, $iWidth, $iHeight, $iRadius = 30, $Pen = "")
_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)
_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
Edit:
Buttons kannst du auch darauf erstellen, wenn du es mit Childs machst.
Decompilieren ist illegal, und wird in diesem Forum nicht unterstützt.
Mit Shift+Del
xDDDDD