Jump to content

Search the Community

Showing results for tags 'effect'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 9 results

  1. Since I disovered FreeBasic I decided to create a DLL to implement much faster image processing functionality to AutoIt. Following functions are implemented yet: _GDIPlus_BitmapApplyFilter_BWJJNDithering _GDIPlus_BitmapApplyFilter_BWBayerOrderedDithering _GDIPlus_BitmapApplyFilter_Cartoon1 _GDIPlus_BitmapApplyFilter_ColorAccent _GDIPlus_BitmapApplyFilter_Convolution_AnotherBlur _GDIPlus_BitmapApplyFilter_Convolution_BoxBlur _GDIPlus_BitmapApplyFilter_Convolution_EdgeDetection1 _GDIPlus_BitmapApplyFilter_Convolution_EdgeDetection2 _GDIPlus_BitmapApplyFilter_Convolution_EdgeDetection3 _GDIPlus_BitmapApplyFilter_Convolution_EdgeDetection4 _GDIPlus_BitmapApplyFilter_Convolution_EdgeDetection5 _GDIPlus_BitmapApplyFilter_Convolution_EdgeDetection6 _GDIPlus_BitmapApplyFilter_Convolution_Emboss1 _GDIPlus_BitmapApplyFilter_Convolution_Emboss45Degree _GDIPlus_BitmapApplyFilter_Convolution_EmbossTopLeftBottomRight _GDIPlus_BitmapApplyFilter_Convolution_Gaussian3x3 _GDIPlus_BitmapApplyFilter_Convolution_Gaussian5x5_1 _GDIPlus_BitmapApplyFilter_Convolution_Gaussian5x5_2 _GDIPlus_BitmapApplyFilter_Convolution_GaussianBlur _GDIPlus_BitmapApplyFilter_Convolution_IntenseEmboss _GDIPlus_BitmapApplyFilter_Convolution_Kirsch _GDIPlus_BitmapApplyFilter_Convolution_Laplace1 _GDIPlus_BitmapApplyFilter_Convolution_Laplace2 _GDIPlus_BitmapApplyFilter_Convolution_Laplace3 _GDIPlus_BitmapApplyFilter_Convolution_LaplacianOfGaussian _GDIPlus_BitmapApplyFilter_Convolution_ManualMatrix _GDIPlus_BitmapApplyFilter_Convolution_MotionBlur _GDIPlus_BitmapApplyFilter_Convolution_Outline3x3 _GDIPlus_BitmapApplyFilter_Convolution_Prewitt _GDIPlus_BitmapApplyFilter_Convolution_Sharpen1 _GDIPlus_BitmapApplyFilter_Convolution_Sharpen2 _GDIPlus_BitmapApplyFilter_Convolution_Sobel _GDIPlus_BitmapApplyFilter_Convolution_SovelVsPrewitt _GDIPlus_BitmapApplyFilter_Convolution_TriangleBlur _GDIPlus_BitmapApplyFilter_Convolution_Unsharp _GDIPlus_BitmapApplyFilter_Convolution_Unsharp5x5 _GDIPlus_BitmapApplyFilter_Delaunay _GDIPlus_BitmapApplyFilter_Dilatation _GDIPlus_BitmapApplyFilter_DistortionBlur _GDIPlus_BitmapApplyFilter_Edges _GDIPlus_BitmapApplyFilter_Erosion _GDIPlus_BitmapApplyFilter_FakeGreyscale _GDIPlus_BitmapApplyFilter_FishEye _GDIPlus_BitmapApplyFilter_Indexed _GDIPlus_BitmapApplyFilter_Jitter _GDIPlus_BitmapApplyFilter_Kuwahara _GDIPlus_BitmapApplyFilter_Linellism _GDIPlus_BitmapApplyFilter_Median _GDIPlus_BitmapApplyFilter_Median2 _GDIPlus_BitmapApplyFilter_Mosaic _GDIPlus_BitmapApplyFilter_OilPainting _GDIPlus_BitmapApplyFilter_Open _GDIPlus_BitmapApplyFilter_PenSketch _GDIPlus_BitmapApplyFilter_PenSketch2 _GDIPlus_BitmapApplyFilter_Pixelate _GDIPlus_BitmapApplyFilter_Pointillism _GDIPlus_BitmapApplyFilter_RadialBlur _GDIPlus_BitmapApplyFilter_Raster _GDIPlus_BitmapApplyFilter_Spiral _GDIPlus_BitmapApplyFilter_Swirl _GDIPlus_BitmapApplyFilter_SymmetricNearestNeighbour _GDIPlus_BitmapApplyFilter_TiltShift _GDIPlus_BitmapApplyFilter_TimeWarp _GDIPlus_BitmapApplyFilter_Ver _GDIPlus_BitmapApplyFilter_Wave _GDIPlus_BitmapApplyFilter_XRay Since I am absolutely a newbie in FreeBasic, the DLL may contain errors. Please report any bug. FreeBasic source code can be found here: https://pastebin.com/Lugp6rCR To do: add function headers with descriptions speed-up FB code -> partly done add more filters -> ongoing Credits to: Jakub Szymanowski rdc Dewald Esterhuizen Santhosh G_ Christian Graus www.gutgames.com Have fun. You can compare the speed with AutoIt version: #AutoIt3Wrapper_Version=b #include <Array.au3> #include <GDIPlus.au3> Global $sFile = FileOpenDialog("Select an image", "", "Images (*.jpg;*.png;*.gif;*.bmp)") If @error Then Exit _GDIPlus_Startup() Global Const $STM_SETIMAGE = 0x0172 Global Const $hImage = _GDIPlus_ImageLoadFromFile($sFile) Global Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage) Global Const $hGUI = GUICreate("GDI+ Image Filters", $iW * 2, $iH) Global $fProg = 0, $iEnd = $iW * $iH - 1 AdlibRegister("Progress", 490) Global $t = TimerInit() Global Const $hGDIBitmap = _GDIPlus_BitmapApplyFilter_Median($hImage, 4) ConsoleWrite(Round(TimerDiff($t) / 1000, 2) & " s / " & Round(TimerDiff($t) / 60000, 2) & " min" & @CRLF) Global Const $iPic = GUICtrlCreatePic("", 0, 0, $iW - 1, $iH - 1) Global Const $iPic_o = GUICtrlCreatePic("", $iW, 0, $iW - 1, $iH - 1) _WinAPI_DeleteObject(GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hGDIBitmap)) Global Const $hGDIBitmap2 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($iPic_o, $STM_SETIMAGE, $IMAGE_BITMAP, $hGDIBitmap2)) GUISetState() AdlibUnRegister("Progress") ToolTip("") Do Until GUIGetMsg() = -3 _GDIPlus_ImageDispose($hImage) _WinAPI_DeleteObject($hGDIBitmap) _WinAPI_DeleteObject($hGDIBitmap2) _GDIPlus_Shutdown() Exit Func Progress() ToolTip(Int($fProg / $iEnd * 100) & " % / " & Round(TimerDiff($t) / 60000, 2) & " min", MouseGetPos(0) + 30, MouseGetPos(1) + 30) EndFunc #Region Symmetric Nearest Neighbour Func _GDIPlus_BitmapApplyFilter_SymmetricNearestNeighbour($hImage, $fRadius = 2, $bGDI = True) ;no alpha channel implemented yet Local Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage) Local Const $hBitmap_Dest = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $tBitmapData_Dest = _GDIPlus_BitmapLockBits($hBitmap_Dest, 0, 0, $iW - 1, $iH - 1, $GDIP_ILMWRITE, $GDIP_PXF32ARGB) Local Const $iScan0_Dest = DllStructGetData($tBitmapData_Dest, "Scan0") Local Const $tPixel_Dest = DllStructCreate("int[" & $iW * $iH & "];", $iScan0_Dest) Local Const $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW - 1, $iH - 1, $GDIP_ILMREAD, $GDIP_PXF32ARGB) Local Const $iScan0 = DllStructGetData($tBitmapData, "Scan0") Local Const $tPixel = DllStructCreate("int[" & $iW * $iH & "];", $iScan0) Local $iRowOffset, $iX, $iY, $c, $k, $sumR, $sumG, $sumB, $iCount, $xx, $yy, $iR, $iG, $iB, $iR1, $iG1, $iB1, $iR2, $iG2, $iB2, $x, $y For $iY = 0 To $iH - 1 $iRowOffset = $iY * $iW For $iX = 0 To $iW - 1 $sumR = 0 $sumG = 0 $sumB = 0 $iCount = 0 $c = DllStructGetData($tPixel, 1, $iRowOffset + $iX) $iR = BitShift(BitAND(0x00FF0000, $c), 16) $iG = BitShift(BitAND(0x0000FF00, $c), 8) $iB = BitAND(0x000000FF, $c) For $yy = -$fRadius To $fRadius For $xx = -$fRadius To $fRadius $k = $iX + $xx $x = $k < 0 ? 0 : $k > $iW - 1 ? $iW - 1 : $k $k = $iY + $yy $y = $k < 0 ? 0 : $k > $iH - 1 ? $iH - 1 : $k $c = DllStructGetData($tPixel, 1, $y * $iW + $x) $iR1 = BitShift(BitAND(0x00FF0000, $c), 16) $iG1 = BitShift(BitAND(0x0000FF00, $c), 8) $iB1 = BitAND(0x000000FF, $c) $k = $iX - $xx $x = $k < 0 ? 0 : $k > $iW - 1 ? $iW - 1 : $k $k = ($iY - $yy) $y = $k < 0 ? 0 : $k > $iH - 1 ? $iH - 1 : $k $c = DllStructGetData($tPixel, 1, $y * $iW + $x) $iR2 = BitShift(BitAND(0x00FF0000, $c), 16) $iG2 = BitShift(BitAND(0x0000FF00, $c), 8) $iB2 = BitAND(0x000000FF, $c) If __DeltaE($iR, $iG, $iB, $iR1, $iG1, $iB1) < __DeltaE($iR, $iG, $iB, $iR2, $iG2, $iB2) Then $sumR += $iR1 $sumG += $iG1 $sumB += $iB1 Else $sumR += $iR2 $sumG += $iG2 $sumB += $iB2 EndIf $iCount += 1 Next Next DllStructSetData($tPixel_Dest, 1, 0xFF000000 + Int($sumR / $iCount) * 0x10000 + Int($sumG / $iCount) * 0x100 + Int($sumB / $iCount), $iRowOffset + $iX) $fProg += 1 Next Next _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData) _GDIPlus_BitmapUnlockBits($hBitmap_Dest, $tBitmapData_Dest) _GDIPlus_ImageSaveToFile($hBitmap_Dest, @ScriptDir & "\Filter_SNN" & $fRadius & "_" & @YEAR & @MON & @MDAY & @MIN & @SEC & ".png") If $bGDI Then Local $hGDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_Dest) _GDIPlus_BitmapDispose($hBitmap_Dest) Return $hGDIBitmap EndIf Return $hBitmap_Dest EndFunc Func __DeltaE($iR1, $iG1, $iB1, $iR2, $iG2, $iB2) Return Sqrt(($iR1 - $iR2) * ($iR1 - $iR2) + ($iG1 - $iG2) * ($iG1 - $iG2) + ($iB1 - $iB2) * ($iB1 - $iB2)) EndFunc #EndRegion #Region Jitter Func _GDIPlus_BitmapApplyFilter_Jitter($hImage, $iAmount = 20, $bGDI = True) Local Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage) Local Const $hBitmap_Dest = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $tBitmapData_Dest = _GDIPlus_BitmapLockBits($hBitmap_Dest, 0, 0, $iW - 1, $iH - 1, $GDIP_ILMWRITE, $GDIP_PXF32ARGB) Local Const $iScan0_Dest = DllStructGetData($tBitmapData_Dest, "Scan0") Local Const $tPixel_Dest = DllStructCreate("int[" & $iW * $iH & "];", $iScan0_Dest) Local Const $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW - 1, $iH - 1, $GDIP_ILMREAD, $GDIP_PXF32ARGB) Local Const $iScan0 = DllStructGetData($tBitmapData, "Scan0") Local Const $tPixel = DllStructCreate("int[" & $iW * $iH & "];", $iScan0) Local $iX, $iY, $iRowOffset, $fNX, $fNY For $iY = 0 To $iH - 1 $iRowOffset = $iY * $iW + 1 For $iX = 0 To $iW - 1 $fNX = $iX + Int((Random() - 0.5) * $iAmount) $fNX = $fNX < 1 ? 1 : $fNX > $iW - 1 ? $iW - 1 : $fNX $fNY = ($iY + Int((Random() - 0.5) * $iAmount)) $fNY = $fNY < 1 ? 1 : $fNY > $iH - 1 ? $iH - 1 : $fNY $fNY *= $iW DllStructSetData($tPixel_Dest, 1, DllStructGetData($tPixel, 1, $fNY + $fNX), $iRowOffset + $iX) $fProg += 1 Next Next _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData) _GDIPlus_BitmapUnlockBits($hBitmap_Dest, $tBitmapData_Dest) _GDIPlus_ImageSaveToFile($hBitmap_Dest, @ScriptDir & "\Filter_Jitter" & $iAmount & "_" & @YEAR & @MON & @MDAY & @MIN & @SEC & ".png") If $bGDI Then Local $hGDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_Dest) _GDIPlus_BitmapDispose($hBitmap_Dest) Return $hGDIBitmap EndIf Return $hBitmap_Dest EndFunc #EndRegion #Region Median Func _GDIPlus_BitmapApplyFilter_Median($hImage, $fRadius = 3, $bGDI = True) Local Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage) Local Const $hBitmap_Dest = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $tBitmapData_Dest = _GDIPlus_BitmapLockBits($hBitmap_Dest, 0, 0, $iW - 1, $iH - 1, $GDIP_ILMWRITE, $GDIP_PXF32ARGB) Local Const $iScan0_Dest = DllStructGetData($tBitmapData_Dest, "Scan0") Local Const $tPixel_Dest = DllStructCreate("int[" & $iW * $iH & "];", $iScan0_Dest) Local Const $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW - 1, $iH - 1, $GDIP_ILMREAD, $GDIP_PXF32ARGB) Local Const $iScan0 = DllStructGetData($tBitmapData, "Scan0") Local Const $tPixel = DllStructCreate("int[" & $iW * $iH & "];", $iScan0) Local $iX, $iY, $iRowOffset For $iY = 0 To $iH - 1 $iRowOffset = $iY * $iW + 1 For $iX = 0 To $iW - 1 DllStructSetData($tPixel_Dest, 1, __Median_Value($iX, $iY, $fRadius, $tPixel, $iW, $iH), $iRowOffset + $iX) $fProg += 1 Next Next _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData) _GDIPlus_BitmapUnlockBits($hBitmap_Dest, $tBitmapData_Dest) _GDIPlus_ImageSaveToFile($hBitmap_Dest, @ScriptDir & "\Filter_Median" & $fRadius & "_" & @YEAR & @MON & @MDAY & @MIN & @SEC & ".png") If $bGDI Then Local $hGDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_Dest) _GDIPlus_BitmapDispose($hBitmap_Dest) Return $hGDIBitmap EndIf Return $hBitmap_Dest EndFunc Func __Median_Value($iPosX, $iPosY, $fRadius, $tPixel, $iW, $iH) Local $iX, $iY, $aColors[1000], $iColors = 0, $iSize = $iW * $iH - 1, $iOff, $e For $iX = $iPosX - $fRadius To $iPosX + $fRadius For $iY = $iPosY - $fRadius To $iPosY + $fRadius $iOff = 1 + $iY * $iW + $iX $aColors[$iColors] = DllStructGetData($tPixel, 1, $iOff < 1 ? 1 : $iOff > $iSize ? $iSize : $iOff) $iColors += 1 Next Next ReDim $aColors[$iColors] ;~ _ArraySort($aColors, 0) $e = $iColors - 1 __ArrayQuickSort1D($aColors, 0, $e) Local $iMid = Floor($iColors / 2), $iMedian If BitAND($iColors, 1) Then $iMedian = Int($aColors[$iMid + 1]) Else $iMedian = Int(($aColors[$iMid] + $aColors[$iMid + 1]) / 2) EndIf Return $iMedian EndFunc #EndRegion _GDIPlus_BitmapApplyFilter v0.9.8 build 2024-04-17 beta.7z
  2. Browsing a Chinese AutoIt forum, i fall on a little pearl that i want to share with you ! I have already seen water effects example with autoit, but this one is very easy to create using waterctrl.dll Only BMP are supported. Position of Blob water can be set by coordinates and mouse movements (and clicks) when over bmp create traces on water. All files are embeded in script with BinaryToAu3Kompressor. WaterEffect.au3 Hope you like it !
  3. wakillon

    GifCamEx

    Version 1.0.2.8

    870 downloads

    Create animated gif from capture.
  4. wakillon

    WaterEffect

    1,151 downloads

    Create water effects using waterctrl.dll. Topic
  5. Bitmap2AscII use Lucida Console font with a size set to 8, so Windows 8/8.1 users need to change their notepad font and size for get a correct display. Image Rescale slider is only available when saving as image. A click on the "PreviewEdit" open AscII string in Notepad. You can save as Text, Html or Image (add the extension you want) Each setting change is immediately applied. Downloads available in the download section Hope you like it !
  6. I love GifCam. Easy and handy to use for create animated gif from capture. For the fun, i have tried to do it in AutoIt. GifSicle is only used for compress animated Gif when saving or decompress when loading. Due to a lack of time, I have not re-created all the features of latest GifCam Version. Warning : Use latest AutoIt release (v3.3.12.0) and script do not work under XP. source and executable are available in the Download Section Hope you like it ! If not, try the Original !
  7. ImagePixelate function : Func _GDIPlus_ImagePixelate ( $hImage, $iPixelBlockSize=10 ) If $iPixelBlockSize < 1 Then Return SetError ( 1, 0, 0 ) Local $iWidth = _GDIPlus_ImageGetWidth ( $hImage ) If $iPixelBlockSize > $iWidth Then Return SetError ( 2, 0, 0 ) Local $iWidthAdapted = $iWidth - Mod ( $iWidth, $iPixelBlockSize ) ; adapt size for avoid no Pixelated zone on the right side. Local $iHeight = _GDIPlus_ImageGetHeight ( $hImage ) If $iPixelBlockSize > $iHeight Then Return SetError ( 3, 0, 0 ) Local $iHeightAdapted = $iHeight - Mod ( $iHeight, $iPixelBlockSize ) ; adapt size for avoid no Pixelated zone on the bottom side. Local $hBitmap = _GDIPlus_BitmapCreateFromScan0 ( $iWidthAdapted, $iHeightAdapted ) Local $hContext = _GDIPlus_ImageGetGraphicsContext ( $hBitmap ) _GDIPlus_GraphicsDrawImageRect ( $hContext, $hImage, 0, 0, $iWidthAdapted, $iHeightAdapted ) _GDIPlus_GraphicsDispose ( $hContext ) Local $tBitmapData = _GDIPlus_BitmapLockBits ( $hBitmap, 0, 0, $iWidthAdapted, $iHeightAdapted, BitOR ( $GDIP_ILMWRITE, $GDIP_ILMREAD ), $GDIP_PXF32ARGB ) Local $iScan0 = DllStructGetData ( $tBitmapData, 'Scan0' ) Local $tPixel = DllStructCreate ( 'int[' & $iWidthAdapted * $iHeightAdapted & '];', $iScan0 ) Local $iPixelColor For $x = 0 To $iWidthAdapted - $iPixelBlockSize Step $iPixelBlockSize For $y = 0 To $iHeightAdapted - $iPixelBlockSize Step $iPixelBlockSize $iPixelColor = DllStructGetData ( $tPixel, 1, $x*$iHeightAdapted + 1 + $y ) For $i = $x To $x + $iPixelBlockSize -1 ; create pixel block with same color. For $j = $y To $y + $iPixelBlockSize -1 DllStructSetData ( $tPixel, 1, $iPixelColor, $i*$iHeightAdapted + 1 + $j ) Next Next Next Next _GDIPlus_BitmapUnlockBits ( $hBitmap, $tBitmapData ) Local $hBitmap_Scaled = _GDIPlus_ImageResize ( $hBitmap, $iWidth, $iHeight ) ; restore original size. _GDIPlus_BitmapDispose ( $hBitmap ) $tPixel = 0 $tBitmapData = 0 Return $hBitmap_Scaled EndFunc ;==> _GDIPlus_ImagePixelate() Working on an other project, i made a pause by playing with pixellated image effect. Avoid big images, it's a bit slow. Don't know if it can be usefull to someone... Sure that an unpixelate/depixelize function should be better, but it's not for today ! Just run example, it's fun. ImagePixelate Example : ImagePixelate Example.au3.html
  8. So I was getting into GDI and found a lot of examples that I really liked, one of them caught my eye which was a smiley face that would go in circles that I got from martin I wanted to make a sort of "black hole" on my desktop where I can drag and drop files and have them securely deleted and came up with this with a lot of help from UEZ, Werty and other people from who I took code from and liked it so much I thought I'd share it since I haven't seen something like this on here yet. You are going to need to install the ImageMagick COM object if you do not already have it, the script will tell you where you can get it and how to install it if you don't already have it. A lot of copy pasta lead to this script. Now for the script. #NoTrayIcon #region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=blackhole.ico #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Res_Comment=Graphical Trash Bin #AutoIt3Wrapper_Res_Description=Secure Delete Toy #AutoIt3Wrapper_Res_Fileversion=1.0.0.58 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_Obfuscated.au3" #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/so #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ScreenCapture.au3> #include <WinAPI.au3> #include <GDIPlus.au3> #include <GDIp.au3> #include <SD.au3>; wraithdu Secure Delete UDF http://www.autoitscript.com/forum/topic/82954-securely-overwrite-files/ HotKeySet("{ESC}", "close") OnAutoItExitRegister("close") Global $aM_Mask, $hwnd Global Const $IMAGE_BITMAP = 0 Global Const $STM_SETIMAGE = 0x0172 Global $gaDropFiles[1] Global $Img = @TempDir & "\test.png"; The image used for the effects processing Global $ImgMgc = ObjCreate("ImageMagickObject.MagickImage.1"); Create the Image Majic Com object if installed If Not IsObj($ImgMgc) Then Global $Over = False, $SEC = @SEC, $Pos, $Msg, $Label, _ $Adv = GUICreate("Error!", 297, 93, 371, 313, BitOR($WS_CAPTION, $WS_POPUPWINDOW, $DS_SETFOREGROUND), -1), _ $h = ControlGetHandle($Adv, '', $Label), _ $Ok = GUICtrlCreateButton("OK", 107, 58, 77, 23) GUICtrlCreateIcon(@SystemDir & "\user32.dll", -2, 10, 10, 32, 32) GUICtrlCreateLabel("You need to install the ", 60, 20, 110, 17) $Label = GUICtrlCreateLabel("ImageMagick COM object!", 169, 20, 124, 17) GUICtrlSetFont($Label, 8.5) GUICtrlSetCursor($Label, 0) GUISetState() While 1 $Pos = _WinAPI_GetMousePos() $Msg = GUIGetMsg() Switch $Msg Case -3 close() Case $Ok close() Case $Label ShellExecute("http://www.imagemagick.org/script/binary-releases.php#windows") Sleep(8000) MsgBox(48,"Info",'The download we'&"'"&'re looking for is the "ImageMagick-6.x.x-3-Q16-windows-dll.exe" release binary...' & @CR & @CR & _ 'After downloading and running, in the "Select Additional Tasks" section, deselect everything' & @CR & _ 'and select only "Install ImageMagickObject OLE Control for VBscript, Visual Basic, and WSH".') EndSwitch Switch _WinAPI_WindowFromPoint($Pos) Case $h If Not $Over Then GUICtrlSetFont($Label, -1, -1, 4) GUICtrlSetColor($Label, 0x0000ff) $Over = 1 EndIf Case Else If $Over And (@SEC <> $SEC) Then GUICtrlSetFont($Label, 8.5) GUICtrlSetColor($Label, 0x000000) $Over = 0 $SEC = @SEC ElseIf Not $Over And ($SEC <> @SEC) Then GUICtrlSetFont($Label, -1, -1, 4) GUICtrlSetColor($Label, 0x0000ff) $Over = 1 $SEC = @SEC EndIf EndSwitch WEnd close() EndIf Init(); Start all the fun stuff :) Func Init() _GDIPlus_Startup() Local $hwnd = GUICreate("Black Hole", 300, 300, -1, -1, $WS_POPUP, $WS_EX_ACCEPTFILES, GUICreate("ghost"));$WS_EX_TOPMOST Local $Pic = GUICtrlCreatePic("", 0, 0, 400, 400, -1, $GUI_WS_EX_PARENTDRAG); only for enable dragging of the gui GUICtrlSetState($Pic, $GUI_DROPACCEPTED) GUISetBkColor(0x000000, $hwnd) $Img = CreateImg($hwnd, $Img, 0.50); Create the magic image If IsObj($ImgMgc) Then $ImgMgc.Convert($Img, "-implode", "-15", $Img); Give the image a lense effect EndIf GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES_FUNC") 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) _GDIPlus_GraphicsSetTransform($backbuffer, $matrix) _GDIPlus_GraphicsDrawImageRect($backbuffer, $image, -150, -150, 300, 300);-150,-150) _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, 300, 300) setTrans($hwnd); make the GUI circular GUISetState() Local $Msg, $Files, $SEC = @SEC While 1 Sleep(20) $Msg = GUIGetMsg($hwnd) Switch $Msg Case $GUI_EVENT_DROPPED $Files = '' For $i = 0 To UBound($gaDropFiles) - 1 $Files &= $gaDropFiles[$i] & @CR Next Switch MsgBox(4 + 48 + 256 + 262144, "Advisory!", "Are you sure you wish to permanantly delete these files?" & @CRLF & $Files) Case 6 For $i = 0 To UBound($gaDropFiles) - 1 _SecureFileDelete($gaDropFiles[$i], False, True, False) Next EndSwitch Case $Pic $Pos = WinGetPos($hwnd) If ($Pos[0] <> $TmpPos[0]) Or ($Pos[1] <> $TmpPos[1]) Then; check if GUI was relocated GUISetState(@SW_HIDE) _GDIPlus_BitmapDispose($image) Sleep(100);for some reason the GUI is still caught in the image if we don't wait :/ CreateImg($hwnd, $Img, 0.50) If IsObj($ImgMgc) Then Switch Random(1,2,1) Case 1 $ImgMgc.Convert($Img, "-implode", "-1", "-swirl", "1000", $Img) Case 2 $ImgMgc.Convert($Img, "-implode", "-15", $Img) EndSwitch EndIf $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 EndSwitch If @SEC <> $SEC Then ;_GDIPlus_MatrixRotate($matrix, -0.01); uncomment to slowley rotate the image at an intervail _GDIPlus_GraphicsSetTransform($backbuffer, $matrix) _GDIPlus_GraphicsDrawImageRect($backbuffer, $image, -150, -150, 300, 300);-150,-150) _GDIPlus_GraphicsDrawImageRect($graphics, $bitmap, 0, 0, 300, 300) $SEC = @SEC EndIf WEnd close() EndFunc ;==>Init Func CreateImg($hGui, $ImgPath, $fArea); Thanks UEZ! If Not IsHWnd($hGui) Then Exit MsgBox(0, "", "error") EndIf Local $iWidth = 300 Local $iHeight = 300 Local $iSize = 300 Local $hBmp = _ScreenCapture_CaptureWnd("", $hGui, 0, 0, $iWidth, $iHeight, False) Local $hBGBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBmp) Local $hBrush = _CreateBrush($iSize, $fArea) Local $hContext = _GDIPlus_ImageGetGraphicsContext($hBGBitmap) _GDIPlus_GraphicsFillRect($hContext, 0, 0, $iSize, $iSize, $hBrush) _GDIPlus_ImageSaveToFile($hBGBitmap, $ImgPath) _WinAPI_DeleteObject($hBmp) _GDIPlus_BitmapDispose($hBGBitmap) _GDIPlus_GraphicsDispose($hContext) _GDIPlus_BitmapDispose($hBGBitmap) Return $ImgPath EndFunc ;==>CreateImg Func _CreateBrush($iSize, $fArea) Local $fTmp = $iSize * $fArea * 1.20 Local $hPath = _GDIPlus_PathCreate() ;_GDIPlus_PathAddEllipse($hPath, $fTmp, $fTmp, $iSize - $fTmp * 2, $iSize - $fTmp * 2) _GDIPlus_PathAddEllipse($hPath, $fTmp - 25, $fTmp - 25, -10, -10) Local $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath) _GDIPlus_PathBrushSetCenterColor($hBrush, 0xFF000000) Local $aColor[2] = [1, 0x00000000] _GDIPlus_PathBrushSetSurroundColorsWithCount($hBrush, $aColor) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.5, 0.5) _GDIPlus_PathBrushSetGammaCorrection($hBrush, True) _GDIPlus_PathDispose($hPath) Return $hBrush EndFunc ;==>_CreateBrush Func WM_DROPFILES_FUNC($hwnd, $msgID, $wParam, $lParam) Local $nSize, $pFileName Local $nAmt = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", 0xFFFFFFFF, "ptr", 0, "int", 255) For $i = 0 To $nAmt[0] - 1 $nSize = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", 0, "int", 0) $nSize = $nSize[0] + 1 $pFileName = DllStructCreate("char[" & $nSize & "]") DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", DllStructGetPtr($pFileName), "int", $nSize) ReDim $gaDropFiles[$i + 1] $gaDropFiles[$i] = DllStructGetData($pFileName, 1) $pFileName = 0 Next Binary($hwnd + $msgID + $lParam);just to prevent unused var errors -_- EndFunc ;==>WM_DROPFILES_FUNC Func close() _GDIPlus_Shutdown() 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 Download Black Hole Desktop Toy.htm Download Since I'm not exactly a pro at this GDI stuff, the script is a little buggy, in example, I have the GUI redrawn every second since when another window is hovered above it it will be painted black and will look ugly. Updated: I removed my fail attempt at creating a portable version of the ImageMagick COM interface, if you don't have it, it'll advise you as to where you can get it. Here is a version that does not need the ImageMagick COM object thanks to UEZ. Although, when dropping files into it, it takes about 20-30 seconds to respond which is a fault on my side due to my scripting abilities... You will need the UDF & the UDF. #include <GDIP.au3> #include <GUIConstantsEx.au3> #include <ScreenCapture.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <SD.au3>; Secure Delete UDF HotKeySet("{ESC}", "_Exit") _GDIPlus_Startup() Global $aM_Mask Global $iWidth = 300 Global $iHeight = 300 Global $iSize = 301 Global $fArea = 0.25 Global $gaDropFiles[1] Global $hGui = GUICreate("Black Hole", $iWidth, $iHeight, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW,$WS_EX_ACCEPTFILES)) GUISetBkColor(0xABCDEF) Local $Pic = GUICtrlCreatePic("", 0, 0, 400, 400, -1, $GUI_WS_EX_PARENTDRAG); only for enable dragging of the gui GUICtrlSetState($Pic, $GUI_DROPACCEPTED) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES_FUNC") setTrans($hGui) _WinAPI_SetLayeredWindowAttributes($hGui, 0xABCDEF, 255, 0x1) Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui) Global $hBmpBuffer = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics) Global $hGfxBuffer = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer) _GDIPlus_GraphicsSetSmoothingMode($hGfxBuffer, 2) _GDIPlus_GraphicsClear($hGfxBuffer, 0xFFABCDEF) Global $hBrush = _CreateBrush(300, $fArea) GUIRegisterMsg($WM_PAINT, "WM_PAINT") GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND") ;_WinAPI_ShowCursor(False) GUISetState() Global $Msg, $Files While 1 _Draw() Sleep(100) $Msg = GUIGetMsg($hGui) Switch $Msg Case $GUI_EVENT_DROPPED $Files = '' For $i = 0 To UBound($gaDropFiles) - 1 $Files &= $gaDropFiles[$i] & @CR Next Switch MsgBox(4 + 48 + 256 + 262144, "Advisory!", "Are you sure you wish to permanantly delete these files?" & @CRLF & $Files) Case 6 For $i = 0 To UBound($gaDropFiles) - 1 _SecureFileDelete($gaDropFiles[$i], False, True, False) Next EndSwitch EndSwitch WEnd Func _Draw() _GDIPlus_GraphicsClear($hGfxBuffer, 0xFFABCDEF) ; Local $hBmp = _ScreenCapture_Capture("", $aPos[0], $aPos[1], $aPos[0] + $iSize, $aPos[1] + $iSize, False) Local $hBmp = _ScreenCapture_CaptureWnd("",$hGui,0,0) Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBmp) _WinAPI_DeleteObject($hBmp) Local $hTexture = _GDIPlus_TextureCreate($hBitmap) _GDIPlus_BitmapDispose($hBitmap) $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iSize, $iSize, $hGraphics) Local $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap) Local $fScale = 1 Local $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_GraphicsFillEllipse($hContext, 0, 0, $iSize, $iSize, $hTexture) _GDIPlus_GraphicsSetSmoothingMode($hContext, 2) Local $fTmp = 0 For $i = 2 To Floor($iSize / 2) $fTmp = $i * ($iSize * $fArea) / ($iSize / 2) * 2.6 $fScale = (($iSize - $fTmp) / ($iSize - $i * 2)) _GDIPlus_MatrixSetElements($hMatrix, 1, 0, 0, 1, 0, 0) _GDIPlus_MatrixTranslate($hMatrix, $iSize / 2, $iSize / 2) _GDIPlus_MatrixScale($hMatrix, $fScale, $fScale) _GDIPlus_MatrixRotate($hMatrix, $fScale) _GDIPlus_MatrixTranslate($hMatrix, -$iSize / 2, -$iSize / 2) _GDIPlus_GraphicsSetTransform($hContext, $hMatrix) _GDIPlus_GraphicsFillEllipse($hContext, $i, $i, $iSize - $i * 2, $iSize - $i * 2, $hTexture) Next _GDIPlus_MatrixSetElements($hMatrix, 1, 0, 0, 1, 0, 0) _GDIPlus_GraphicsSetTransform($hContext, $hMatrix) _GDIPlus_GraphicsFillRect($hContext, 0, 0, $iSize, $iSize, $hBrush) _GDIPlus_MatrixDispose($hMatrix) _GDIPlus_BrushDispose($hTexture) _GDIPlus_GraphicsDrawImage($hGfxBuffer, $hBitmap, -1, -1) _GDIPlus_GraphicsDispose($hContext) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0) EndFunc ;==>_Draw Func WM_DROPFILES_FUNC($hwnd, $msgID, $wParam, $lParam) Local $nSize, $pFileName Local $nAmt = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", 0xFFFFFFFF, "ptr", 0, "int", 255) For $i = 0 To $nAmt[0] - 1 $nSize = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", 0, "int", 0) $nSize = $nSize[0] + 1 $pFileName = DllStructCreate("char[" & $nSize & "]") DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", DllStructGetPtr($pFileName), "int", $nSize) ReDim $gaDropFiles[$i + 1] $gaDropFiles[$i] = DllStructGetData($pFileName, 1) $pFileName = 0 Next Binary($hwnd + $msgID + $lParam);just to prevent unused var errors -_- EndFunc ;==>WM_DROPFILES_FUNC Func _CreateBrush($iSize, $fArea) Local $fTmp = $iSize * $fArea * 1.20 Local $hPath = _GDIPlus_PathCreate() _GDIPlus_PathAddEllipse($hPath, $fTmp, $fTmp, $iSize - $fTmp * 2, $iSize - $fTmp * 2) Local $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath) _GDIPlus_PathBrushSetCenterColor($hBrush, 0xFF000000) Local $aColor[2] = [1, 0x00000000] _GDIPlus_PathBrushSetSurroundColorsWithCount($hBrush, $aColor) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.5, 0.5) _GDIPlus_PathBrushSetGammaCorrection($hBrush, True) _GDIPlus_PathDispose($hPath) Return $hBrush EndFunc ;==>_CreateBrush Func WM_PAINT($hWnd, $uMsgm, $wParam, $lParam) _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0) Return $GUI_RUNDEFMSG EndFunc ;==>WM_PAINT Func WM_ERASEBKGND($hWnd, $uMsgm, $wParam, $lParam) _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0) Return True EndFunc ;==>WM_ERASEBKGND 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 Func _Exit() ;_WinAPI_ShowCursor(True) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGfxBuffer) _GDIPlus_BitmapDispose($hBmpBuffer) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() Exit EndFunc ;==>_Exit
  9. Hey! Is it possible to let a GUI slide in from the right bounds of the desktop? I am making a settings-GUI where all necessary settings can easily be done in one window When my mouse reaches a zone on the right of my desktop, a GUI should slide in... I achieved this some time ago with a single control of a GUI... GUICtrlSetPos; But there is no GUISetPos Function... Can i achieve this in any other way? Or do you know better ways to bring this GUI to my screen?
×
×
  • Create New...