Welche Sprache ist denn dafür geeignet?
Jeden Code kann man reversen, ob nun AutoIt, C/C++, Delphi, Assembler, etc. und z.B. einen Keygenerator erstellen!
Mag sein, dass es in AutoIt etwas leichter geht...
Gruß,
UEZ
Welche Sprache ist denn dafür geeignet?
Jeden Code kann man reversen, ob nun AutoIt, C/C++, Delphi, Assembler, etc. und z.B. einen Keygenerator erstellen!
Mag sein, dass es in AutoIt etwas leichter geht...
Gruß,
UEZ
Die Darstellung der Spiegelung mittel GDI+:
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
Opt("MustDeclareVars", 1)
Opt("GUIOnEventMode", 1)
Local $hGUI, $hGraphics, $hBackbuffer, $hBitmap, $hBrush, $hPen
Local $iX = 800, $iY = 600
; Initialize GDI+
_GDIPlus_Startup()
$hGUI = GUICreate("Spiegeln von P1 an der Achse P2 von UEZ 2010", $iX, $iY)
GUISetState()
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($iX, $iY, $hGraphics)
$hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
; Using antialiasing
_GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)
; Create a Pen object
$hBrush = _GDIPlus_BrushCreateSolid(0)
$hPen = _GDIPlus_PenCreate(0xFF000000)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
[/autoit] [autoit][/autoit] [autoit]Local $deg = ACos(-1) / 180
Local $rad = 180 / ACos(-1)
Local $P1_x = 300
Local $P1_y = 100
Local $P2_x = 150
Local $P2_y = 500
Local $alpha = 60
Local $P3_x, $P3_y
Local $radius = Pixel_Distance($P1_x, $P1_y, $P2_x, $P2_y)
;Winkel von Punkt1 berechnen
Local $mwx = $P1_x - $P2_x
Local $mwy = $P2_y - $P1_y
Local $P1angle = -ATan($mwy / $mwx) * $rad
If $mwx < 0 Then
$P1angle = -180 + $P1angle
ElseIf $mwx >= 0 And $mwy < 0 Then
$P1angle = -360 + $P1angle
EndIf
;Spiegel berechnen
Local $PT_x = $P2_x + Cos(($alpha / 2 + $P1angle) * $deg) * $radius * 1.25
Local $PT_y = $P2_y + Sin(($alpha / 2 + $P1angle) * $deg) * $radius * 1.25
While Sleep(40)
_GDIPlus_GraphicsClear($hBackbuffer, 0xFFFFFFFF)
$P3_x = $P2_x + Cos(($alpha + $P1angle) * $deg) * $radius
$P3_y = $P2_y + Sin(($alpha + $P1angle) * $deg) * $radius
_GDIPlus_PenSetColor($hPen, 0xFF000000)
_GDIPlus_GraphicsDrawLine($hBackbuffer, $P1_x, $P1_y, $P2_x, $P2_y, $hPen)
_GDIPlus_GraphicsDrawLine($hBackbuffer, $P2_x, $P2_y, $P3_x, $P3_y, $hPen)
;~ _GDIPlus_GraphicsDrawEllipse($hBackbuffer, $P2_x - $radius, $P2_y - $radius, 2 * $radius, 2 * $radius, $hPen)
_GDIPlus_PenSetColor($hPen, 0xFF0000FF)
_GDIPlus_GraphicsDrawLine($hBackbuffer, $P2_x, $P2_y, $PT_x, $PT_y, $hPen)
;Punkt 1
_GDIPlus_BrushSetSolidColor($hBrush, 0xFFFF0000)
_GDIPlus_GraphicsFillEllipse($hBackbuffer, $P1_x - 5, $P1_y - 5, 10, 10, $hBrush)
;Punkt 2
_GDIPlus_BrushSetSolidColor($hBrush, 0xFF00FF00)
_GDIPlus_GraphicsFillEllipse($hBackbuffer, $P2_x - 5, $P2_y - 5, 10, 10, $hBrush)
;Punkt 3 (Spiegel von Punkt 1)
_GDIPlus_BrushSetSolidColor($hBrush, 0xFF0000FF)
_GDIPlus_GraphicsFillEllipse($hBackbuffer, $P3_x - 5, $P3_y - 5, 10, 10, $hBrush)
_GDIPlus_GraphicsDrawString($hBackbuffer, "P1" & @CRLF & "(" & Int($P1_x) & "," & Int($P1_y) & ")", $P1_x - 25, $P1_y - 40)
_GDIPlus_GraphicsDrawString($hBackbuffer, "P2" & @CRLF & "(" & Int($P2_x) & "," & Int($P2_y) & ")", $P2_x - 25, $P2_y - 40)
_GDIPlus_GraphicsDrawString($hBackbuffer, "Winkel alpha = " & $alpha, $P2_x - 45, $P2_y + 10)
_GDIPlus_GraphicsDrawString($hBackbuffer, "P3" & @CRLF & "(" & Int($P3_x) & "," & Int($P3_y) & ")", $P3_x - 25, $P3_y - 40)
_GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $iX, $iY)
WEnd
Func Pixel_Distance($x1, $y1, $x2, $y2) ;Pythagoras theorem
Local $a, $b, $c
If $x2 = $x1 And $y2 = $y1 Then
Return 0
Else
$a = $y2 - $y1
$b = $x2 - $x1
$c = Sqrt($a * $a + $b * $b)
Return $c
EndIf
EndFunc ;==>Pixel_Distance
Func _Exit()
; Clean up
_GDIPlus_PenDispose($hPen)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hBackbuffer)
_GDIPlus_GraphicsDispose($hGraphics)
; Uninitialize GDI+
_GDIPlus_Shutdown()
Exit
EndFunc
Gruß,
UEZ
Zitatich brauch nur den rechenweg, nix mit GDI+.. trotzdem thx..
GDI+ ist doch nicht der Rechner, sondern die Projektion des Gerechneten! Der Rechenweg steht doch dort geschrieben!
Du musst nur beachten, dass hier P(0,0) oben links in der Ecke ist - in der Schule ist ja der Mittelpunkt i.d.R. wo anders. ![]()
Gruß,
UEZ
So?
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
Opt("MustDeclareVars", 1)
Opt("GUIOnEventMode", 1)
Local $hGUI, $hGraphics, $hBackbuffer, $hBitmap, $hBrush, $hPen
Local $iX = 800, $iY = 600
; Initialize GDI+
_GDIPlus_Startup()
$hGUI = GUICreate("Spiegeln", $iX, $iY)
GUISetState()
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($iX, $iY, $hGraphics)
$hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
; Using antialiasing
_GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)
; Create a Pen object
$hBrush = _GDIPlus_BrushCreateSolid(0)
$hPen = _GDIPlus_PenCreate(0xFF000000)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
[/autoit] [autoit][/autoit] [autoit]Local $P1_x = 100
Local $P1_y = 100
Local $P2_x = 300
Local $P2_y = 400
Local $P3_x, $P3_y, $PT_x, $PT_y
While Sleep(20)
_GDIPlus_GraphicsClear($hBackbuffer, 0xFFFFFFFF)
$P3_x = $P1_x + 2 * ($P2_x - $P1_x)
$P3_y = $P1_y - 5
_GDIPlus_PenSetColor($hPen, 0xFF000000)
_GDIPlus_GraphicsDrawLine($hBackbuffer, $P1_x, $P1_y, $P2_x, $P2_y, $hPen)
_GDIPlus_GraphicsDrawLine($hBackbuffer, $P2_x, $P2_y, $P3_x, $P3_y, $hPen)
_GDIPlus_PenSetColor($hPen, 0xFF0000FF)
_GDIPlus_GraphicsDrawLine($hBackbuffer, $P2_x, $P1_y - 40, $P2_x, $P2_y + 40, $hPen)
;Punkt 1
_GDIPlus_BrushSetSolidColor($hBrush, 0xFFFF0000)
_GDIPlus_GraphicsFillEllipse($hBackbuffer, $P1_x - 5, $P1_y - 5, 10, 10, $hBrush)
;Punkt 2
_GDIPlus_BrushSetSolidColor($hBrush, 0xFF00FF00)
_GDIPlus_GraphicsFillEllipse($hBackbuffer, $P2_x - 5, $P2_y - 5, 10, 10, $hBrush)
;Punkt 3 (Spiegel von Punkt 1)
_GDIPlus_BrushSetSolidColor($hBrush, 0xFF0000FF)
_GDIPlus_GraphicsFillEllipse($hBackbuffer, $P3_x - 5, $P3_y - 5, 10, 10, $hBrush)
_GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $iX, $iY)
WEnd
Func _Exit()
; Clean up
_GDIPlus_PenDispose($hPen)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hBackbuffer)
_GDIPlus_GraphicsDispose($hGraphics)
; Uninitialize GDI+
_GDIPlus_Shutdown()
Exit
EndFunc
Gruß,
UEZ
Der Punkt P3 lässt sich nicht eindeutig berechnen, da er ja auf der Geraden P2 -> P3 irgendwo liegen kann!
Gruß,
UEZ
Nette Seite über Dreiecke: http://de.wikipedia.org/wiki/Dreieck
Gruß,
UEZ
In der Tat ist der Code mit _GDIPlus_BitmapCloneArea() kürzer:
#include <GDIPlus.au3>
Opt("GUIOnEventMode", 1)
_GDIPlus_Startup ()
[/autoit] [autoit][/autoit] [autoit]$hIFile = _GDIPlus_ImageLoadFromFile("c:\Program Files\AutoIt3\Examples\GUI\mslogo.jpg")
$iW = _GDIPlus_ImageGetWidth($hIFile)
$iH = _GDIPlus_ImageGetHeight($hIFile)
$crop_x1 = 46
$crop_y1 = 4
$crop_x2 = 88
$crop_y2 = 13
$width = $crop_x2 - $crop_x1
$height = $crop_y2 - $crop_y1
$hgui = GUICreate("GDI+ Image Cropping by UEZ", $iW, $iH)
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
$hClone = _GDIPlus_BitmapCloneArea($hIFile, $crop_x1, $crop_y1, $width, $height)
GUISetOnEvent(-3, "_Exit")
GUISetBkColor($hgui, 0)
GUISetState()
_GDIPlus_GraphicsDrawImage($hGraphic, $hClone, $iW / 2 - $width / 2, $iH / 2 - $height / 2)
;~ _GDIPlus_ImageSaveToFile ($hClone, "Cropped.jpg")
While Sleep(1000)
[/autoit] [autoit][/autoit] [autoit]WEnd
[/autoit] [autoit][/autoit] [autoit]Func _Exit()
_GDIPlus_BitmapDispose($hClone)
_GDIPlus_ImageDispose($hIFile)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
Exit
EndFunc
Danke autoBert! ![]()
Gruß,
UEZ
Vielleicht so:
#include <GDIPlus.au3>
Opt("GUIOnEventMode", 1)
_GDIPlus_Startup ()
[/autoit] [autoit][/autoit] [autoit]$hIFile = _GDIPlus_ImageLoadFromFile("c:\Program Files\AutoIt3\Examples\GUI\mslogo.jpg")
$iW = _GDIPlus_ImageGetWidth($hIFile)
$iH = _GDIPlus_ImageGetHeight($hIFile)
$crop_x1 = 46
$crop_y1 = 4
$crop_x2 = 88
$crop_y2 = 13
$width = $crop_x2 - $crop_x1
$height = $crop_y2 - $crop_y1
$hgui = GUICreate("GDI+ Image Cropping by UEZ", $iW, $iH)
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic)
$hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
GUISetOnEvent(-3, "_Exit")
GUISetState()
_GDIPlus_GraphicsDrawImageRectRect($hBackbuffer, $hIFile, $crop_x1, $crop_y1, $width, $height, 0, 0, $width, $height)
_GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, $iW / 2 - $width / 2, $iH / 2 - $height / 2)
;~ _GDIPlus_ImageSaveToFile ($hBitmap, "Cropped.jpg")
While Sleep(1000)
[/autoit] [autoit][/autoit] [autoit]WEnd
[/autoit] [autoit][/autoit] [autoit]Func _Exit()
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hBackbuffer)
_GDIPlus_ImageDispose($hIFile)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
Exit
EndFunc
Gruß,
UEZ
Super! ![]()
Hast Andy's Favorite Bild genommen... ![]()
Gruß,
UEZ
ZitatKlasse! Dazu noch nen Musikplayer reinhauen, und dann WMP Konkurrenz machen
Da fehlt noch viel, um WMP Konkrrenz zu machen. ![]()
ZitatBoooa, das sieht echt super aus. Eventuell könnte man den Zoomeffekt noch an die BPM oder die Lautstärke anpassen?
Gute Idee, vielleicht implementiere ich deine Ideen noch!
ZitatSaubere Arbeit,
sieht wie immer spitze aus
. Wenn du WMP übertreffen möchtest(wozu wahrscheinlich in der Lage bist)musste noch mehr Abwechselung machen.
Grüße Moritz
War nie als Konkurrenz für WMP oder WinAMP gedacht, sondern nur um den Effekt zu zeigen. ![]()
Danke allen für das Feedback ![]()
Ihr könnt, wenn ihr wollt, den Code modifizieren oder erweitern und hier posten!
Gruß,
UEZ
Hi,
nach dem ich eukalyptus mit Zoomer inspiriert habe, hat der mich mit seinem WaveOsziloskop auch inspiriert und entstanden ist
GDI+ Visualizer Oscilloscope Farbrausch!
Danke an BrettF, Eukalyptus und progandy für die Bass*.au3 Dateien!
Viel Spaß,
UEZ
PS: da einige Dateien nötig sind, nur als Anhang! Der Begriff Farbrausch hat gut dazu gepasst und hat keinen Bezug zu der Demo Gruppe Farbrausch (so was würde ich mir nie anmaßen wollen) ![]()
Kleines Update1: Musik spielt jetzt unendlich und Anzeige der Musikposition in der Titelleiste
Schau' mal hier rein: Integer <=> Binary Converter v1.0 Build 2010-01-15
Vielleicht hilft's dir ja...
Gruß,
UEZ
Das funzt leider mit GDI+ nur begrenzt, sprich volle Transparenz wird leider nicht unterstützt! -> _GUICtrlMenu_CreateBitmap() v0.5 Build 2010-06-12 - Erstellt Icons für GUI Menüs
Gruß,
UEZ
Auch von mir herzlichen Glückwunsch!
Gruß,
UEZ
In meiner VM unter Win7 x64 werden beide Exe erstellt!
Ich hatte heute morgen noch eine Zeile hinzugefügt, die ich nachts vergessen hatte, genau um dein beschriebenes Problem zu umgehen! ![]()
Gruß,
UEZ
So sollte es gehen:
[autoit]
#AutoIt3Wrapper_Run_Before=del /f /q %scriptfile%_x64.exe
#AutoIt3Wrapper_Run_Before=del /f /q %scriptfile%_x86.exe
#AutoIt3Wrapper_Run_Before="%autoitdir%\aut2exe\aut2exe.exe" /in %in% /out %scriptfile%_x64.exe /nopack /x64
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Run_After=ren %out% %scriptfile%_x86.exe
If @OSArch = "X86" Then
MsgBox(0, "CPU", "CPU is x86", 10)
Else
MsgBox(0, "CPU", "CPU is x64", 10)
EndIf
Gruß,
UEZ
Edit: Da mich UEZ gestern mit diesem Script: GDI+ Zoomer
inspiriert hat, hab ich ein paar weiter Beispiele in "Vizualizing.zip" gepackt...
![]()
You ![]()
Gruß,
UEZ