Search the Community
Showing results for tags 'warp'.
-
So I've been playing with some code I've got, most of which was ripped from UEZ and created some miscellaneous useless scripts and suddenly I felt compelled to find a way to add en effect to an image that would make it look like if there is a black hole in your desktop. I've searched and searched to no avail and now I'm here. Anyone know how to add an effect to an image as picture related? #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/so #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%%scriptfile%_Obfuscated.au3" #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #Include <WindowsConstants.au3> #include <ScreenCapture.au3> #include <WinAPI.au3> #include <GDIPlus.au3> HotKeySet("{ESC}","close") Global $Img = @ScriptDir&"test.png" Global $aM_Mask, $GUI, $hwnd Global $IMAGE_BITMAP = 0 Global $STM_SETIMAGE = 0x0172 Init() Func Init() _GDIPlus_Startup() Local $hwnd = GUICreate("Test", 300, 300, -1, -1,$WS_POPUP,-1,GUICreate("ghost"));$WS_EX_TOPMOST GUICtrlCreatePic("",0,0,400,400,-1,0x00100000); only for enable dragging of the gui GUISetBkColor(0x000000,$hwnd) _ScreenCapture_CaptureWnd($Img,$hwnd);leaving the courser... GUISetState() Local $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd) Local $bitmap = _GDIPlus_BitmapCreateFromGraphics(300, 300, $graphics) Local $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap) Local $Pos = WinGetPos($hwnd) Local $TmpPos = $Pos Local $image = _GDIPlus_ImageLoadFromFile($Img) Local $matrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($matrix, 150, 150);True) setTrans($hwnd) Do $Pos = WinGetPos($hwnd) If ($Pos[0] <> $TmpPos[0]) Or ($Pos[1] <> $TmpPos[1]) Then GUISetState(@SW_HIDE) _GDIPlus_BitmapDispose($image) Sleep(100) _ScreenCapture_CaptureWnd($Img,$hwnd);leaving the courser.. $graphics = _GDIPlus_GraphicsCreateFromHWND($hwnd) $bitmap = _GDIPlus_BitmapCreateFromGraphics(300, 300, $graphics) $backbuffer = _GDIPlus_ImageGetGraphicsContext($bitmap) $image = _GDIPlus_ImageLoadFromFile($Img) $matrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($matrix, 150, 150);True) GUISetState(@SW_SHOW) $Pos = WinGetPos($hwnd) $TmpPos = $Pos EndIf ;_GDIPlus_MatrixRotate($matrix, 0.01) _GDIPlus_GraphicsSetTransform($backbuffer, $matrix) _GDIPlus_GraphicsDrawImageRect($backbuffer, $image, -150, -150, 300, 300);-150,-150) _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, 300, 300) Sleep(20) Until 0 Return EndFunc Func close() Exit EndFunc ;==>close Func setTrans($hW) Local $x, $Startx, $Endx $aM_Mask = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", 0, "long", 0, "long", 460, "long", 460) For $y = 0 To 300 $x = Abs((150 * 150 - (150 - $y) * (150 - $y)) ^ 0.5) $Startx = 150 + $x $Endx = 300 addRegion($Startx, $y, $Endx, $y) $Startx = 0 $Endx = 150 - $x addRegion($Startx, $y, $Endx, $y) Next DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hW, "long", $aM_Mask[0], "int", 1) EndFunc ;==>setTrans Func addRegion($a, $b, $c, $d) Local $aMask = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $a, "long", $b, "long", $c + 1, "long", $d + 1) DllCall("gdi32.dll", "long", "CombineRgn", "long", $aM_Mask[0], "long", $aMask[0], "long", $aM_Mask[0], "int", 3) EndFunc ;==>addRegion Edit: forgot to explain the script, the script basically takes a snapshot of the background area of where the gui is going to appear and then loads the image to the gui, which is a big circle really, I want to find a way of making the picture look a little warped before adding it to the gui so it will have a black hole effect or something.