Leaderboard
Popular Content
Showing content with the highest reputation on 04/07/2024 in all areas
-
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.7z2 points
-
Hello guys. I just did another OCR wrapper for this nice library. What's AU3-RapidOCR? RapidOCR UDF is a simple wrapper for RapidOCR library. Features. Get Text From Image File. Easy to use. Usage: #include "RapidOCR.au3" _Example() Func _Example() MsgBox(0, "", _RapidOCR_ImageToText(@ScriptDir & "\images\Image1.png")) EndFunc Check RapidOCR UDF on GitHub. Saludos1 point
-
Get the binary type for exe / dll file. ;Coded by UEZ build 2024-04-08 #AutoIt3Wrapper_UseX64 = y #include <WinAPIFiles.au3> #include <WinAPIProc.au3> Global $sFile = FileOpenDialog("Select a DLL file", "", "File (*.dll;*.exe)", $FD_FILEMUSTEXIST) If @error Then Exit MsgBox($MB_ICONINFORMATION, "File Binary Type", StringRegExpReplace($sFile, ".+\\(.+)", "$1") & " = " & _WinAPI_GetBinaryType2($sFile)) ; #FUNCTION# ==================================================================================================================== ; Author.........: UEZ ; Modified.......: ; =============================================================================================================================== Func _WinAPI_GetBinaryType2($sFile) Local Const $hFile = _WinAPI_CreateFile($sFile, 2, 2) If Not $hFile Or @error Then Return SetError(1, 0, 0) Local Const $hMapping = _WinAPI_CreateFileMapping($hFile, 0, Null, $PAGE_READONLY, Null) If Not $hMapping Then _WinAPI_CloseHandle($hFile) Return SetError(2, 0, 0) EndIf Local Const $pAddress = _WinAPI_MapViewOfFile($hMapping, 0, 0, $FILE_MAP_READ) If Not $pAddress Or @error Then __ReturnGBT2($hMapping, $hFile, 3) Local $aHeader = DllCall("Dbghelp.dll", "ptr", "ImageNtHeader", "ptr", $pAddress) If @error Or IsArray($aHeader) = 0 Then Return __ReturnGBT2($hMapping, $hFile, 4) Local $tIMAGE_NT_HEADERS = DllStructCreate("dword Signature;ptr FileHeader;ptr OptionalHeader;", $aHeader[0]) If @error Or Not IsDllStruct($tIMAGE_NT_HEADERS) Then Return __ReturnGBT2($hMapping, $hFile, 5) Local $tIMAGE_FILE_HEADER = DllStructCreate("word Machine;word NumberOfSections;dword TimeDateStamp;dword PointerToSymbolTable;dword NumberOfSymbols;word SizeOfOptionalHeader;word Characteristics;", DllStructGetPtr($tIMAGE_NT_HEADERS) + 4) If @error Or Not IsDllStruct($tIMAGE_FILE_HEADER) Then Return __ReturnGBT2($hMapping, $hFile, 6) __ReturnGBT2($hMapping, $hFile, 0) Switch $tIMAGE_FILE_HEADER.Machine Case 0x014c Return "x86" Case 0x0200 Return "Intel Itanium" Case 0x8664 Return "x64" Case Else Return "Error" EndSwitch EndFunc ;==>_WinAPI_GetBinaryType2 Func __ReturnGBT2($hMapping, $hFile, $iError) _WinAPI_CloseHandle($hMapping) _WinAPI_CloseHandle($hFile) If $iError Then Return SetError($iError, 0, 0) EndFunc ;==>__ReturnGBT21 point
-
AutoItHelp v3.3.16.1 with external CSS loading
donnyh13 reacted to argumentum for a topic
Ok, try it out. Made a sun button and a moon button. Should be enough. But as always, ideas are welcomed. Edit: added a comboBox to evaluate as an option Edit2: left the comboBox and removed the sun and moon buttons idea. Edit3: moved to the bottom right corner. It'll be better to implement site wide ( not all help pages have the same formatting ). The default theme is the OS/browser default theme. Note for Opera browser users: If the scrollbars look like ..poop, go to "opera://flags/#component-based-scrollbar" and search for "scrollbar". You'll find 4 entries. Disable them ( Opera One scrollbar, Overlay Scrollbars, Fluent Overlay scrollbars and Fluent scrollbars ).1 point -
TaskPin
kurtykurtyboy reacted to ioa747 for a topic
@kurtykurtyboy Thank you very much for your helpful suggestions, which were fair and implemented New versions are available ( in the first post ) TaskPin.au3 0.0.0.8 and TaskPinEditor.au3 0.0.0.81 point -
Or you may want to try this one : #include <WindowsConstants.au3> #include <GUIConstants.au3> ; Description of DEV_BROADCAST_VOLUME : https://learn.microsoft.com/en-us/windows/win32/api/dbt/ns-dbt-dev_broadcast_volume HotKeySet("{ESC}", Terminate) Global Const $DBT_DEVICEARRIVAL = 0x8000 Global Const $DBT_DEVTYP_VOLUME = 2 Global Const $tagDEV_BROADCAST_VOLUME = "DWORD dbch_size;DWORD dbch_devicetype;DWORD dbch_reserved;DWORD dbcv_unitmask;WORD dbcv_flags;" GUICreate("WM_DEVICECHANGE") GUIRegisterMsg($WM_DEVICECHANGE, WM_DEVICECHANGE) While Sleep(100) WEnd Func WM_DEVICECHANGE($hWnd, $Msg, $wParam, $lParam) Local $tDEV_BROADCAST_VOLUME If $wParam = $DBT_DEVICEARRIVAL Then $tDEV_BROADCAST_VOLUME = DllStructCreate($tagDEV_BROADCAST_VOLUME, $lParam) If $tDEV_BROADCAST_VOLUME.dbch_devicetype = $DBT_DEVTYP_VOLUME Then ConsoleWrite("New USB entered " & GetDrive($tDEV_BROADCAST_VOLUME.dbcv_unitmask) & @CRLF) EndIf EndIf Return $GUI_RUNDEFMSG EndFunc Func Terminate() Exit EndFunc Func GetDrive($iUnit) For $i = 0 To 25 If $iUnit = 2^$i Then Return Chr(65 + $i) & ":" Next Return "" EndFunc1 point
-
This should work. #include <WinAPI.au3> #include <WinAPISys.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <ScreenCapture.au3> HotKeySet("{ESC}", "_Exit") ; Exit Global $hHookFunc = DllCallbackRegister('_WinEventProc', 'none', 'ptr;uint;hwnd;int;int;uint;uint') Global $hWinHook = _WinAPI_SetWinEventHook($EVENT_OBJECT_CREATE, $EVENT_OBJECT_CREATE, DllCallbackGetPtr($hHookFunc)) While Sleep(30) WEnd Func _Exit() _Free() Exit EndFunc ;==>_Exit Func _Free() If $hWinHook Then _WinAPI_UnhookWinEvent($hWinHook) If $hHookFunc Then DllCallbackFree($hHookFunc) EndFunc ;==>_Free Func _WinEventProc($hHook, $iEvent, $hWnd, $iObjectID, $iChildID, $iEventThread, $imsEventTime) If WinGetTitle($hWnd) = "VCarve Pro" Then ConsoleWrite(WinGetTitle($hWnd) & @CRLF) ConsoleWrite(_WinAPI_GetWindowFileName($hWnd) & @CRLF) EndIf EndFunc ;==>_WinEventProc Saludos1 point
-
Just check out this link: http://www.mediafire.com/file/7y07a02epruem4e/_GDIPlus_BitmapApplyFilter_FB_Examples_build_2020-11-16.7z/file Within this package you should find all needed files including some FB examples. Here the Autoit UDF for it: ;IMPORTANT: You are not allowed to sell this code or just parts of it in a commercial project or modify it and distribute it with a different name! ;Distributing copies of this UDF incl. _GDIPlus_BitmapApplyFilter.dll in compiled format (exe) must be free of any fee! ; ;coded by UEZ build 2020-11-16 beta ; #include-once #include <GDIPlus.au3> Global $__hDLL__FX__ Global Enum $EMBOSS1 = 1, $EMBOSS2, $EMBOSS3, $EMBOSS4, $SHARPEN1, $BOX_BLUR, $GAUSSIAN_BLUR, $TRIANGLE_BLUR, $UNSHARP, $UNSHARP5x5, _ $EDGE_DETECTION1, $EDGE_DETECTION2, $EDGE_DETECTION3, $EDGE_DETECTION4, $EDGE_DETECTION5, $EDGE_DETECTION6, _ $ANOTHER_BLUR, $MOTION_BLUR, $SHARPEN2, $SOBEL, $LAPLACE3x3_1, $LAPLACE3x3_2, $LAPLACE5x5, $PREWITT, $KIRSCH, _ $OUTLINE3X3, $GAUSSIAN5X5_1, $GAUSSIAN5X5_2, $LAPLACIANOFGAUSSIAN, $SOVELVSPREWITT, $GAUSSIAN3X3 ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Open ; Description ...: Initialises the DLL and starts GDIPlus ; Syntax ........: _GDIPlus_BitmapApplyFilter_Open([$sPath = @ScriptDir & "\_GDIPlus_BitmapApplyFilter.dll"]) ; Parameters ....: $sPath - [optional] a string value. Default is @ScriptDir & "\_GDIPlus_BitmapApplyFilter.dll". ; Return values .: A dll "handle". ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Open($sPath = @ScriptDir & "\_GDIPlus_BitmapApplyFilter.dll") _GDIPlus_Startup() If @error Then Return SetError(1, 0, 0) If Not FileExists($sPath) Then Return SetError(2, 0, 0) $__hDLL__FX__ = DllOpen($sPath) If $__hDLL__FX__ = -1 Then Return SetError(3, 0, 0) Return $__hDLL__FX__ EndFunc ;==>_GDIPlus_BitmapApplyFilter_Open ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Close ; Description ...: Shut down GDIPlus and close the DLL handle. ; Syntax ........: _GDIPlus_BitmapApplyFilter_Close() ; Parameters ....: ; Return values .: None ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Close() DllClose($__hDLL__FX__) _GDIPlus_Shutdown() Return 1 EndFunc ;==>_GDIPlus_BitmapApplyFilter_Close ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Ver ; Description ...: Displays the version information about the _GDIPlus_BitmapApplyFilter.dll in a MessageBox. ; Syntax ........: _GDIPlus_BitmapApplyFilter_Ver() ; Parameters ....: None ; Return values .: None ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Ver() DllCall($__hDLL__FX__, "none", "Ver") Return 1 EndFunc ;==>_GDIPlus_BitmapApplyFilter_Ver ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_SymmetricNearestNeighbour ; Description ...: A smoothing (noise reduction) filter. The SNN smoothing filter is designed to preserve edges in data and ; is very effective at noise reduction. ; Syntax ........: _GDIPlus_BitmapApplyFilter_SymmetricNearestNeighbour($hImage, $fRadius[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $fRadius - a floating point value. The higher the value the more time will needed for calculation. ; The value is limited between 1 and 25. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will ; be returned, otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_SymmetricNearestNeighbour($hImage, $fRadius, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_SymmetricNearestNeighbour", "ptr", $hImage, "float", $fRadius, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_SymmetricNearestNeighbour ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Jitter ; Description ...: Jitters the image ; Syntax ........: _GDIPlus_BitmapApplyFilter_Jitter($hImage, $iAmount[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iAmount - an integer value. The amount of jitter strength the image will be modified. ; The higher the value the more the image will be jittered. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Jitter($hImage, $iAmount, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Jitter", "ptr", $hImage, "uint", $iAmount, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Jitter ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Median ; Description ...: A smoothing (noise reduction) filter. The median filter is well known as an edge-preserving smoothing filter. ; Syntax ........: _GDIPlus_BitmapApplyFilter_Median($hImage, $fRadius[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $fRadius - a floating point value. The higher the value the more time will needed for calculation. ; The value is limited between 1 and 25. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Median($hImage, $fRadius, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Median", "ptr", $hImage, "float", $fRadius, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Median ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Median2 ; Description ...: A smoothing (noise reduction) filter. The median filter is well known as an edge-preserving smoothing filter. ; Syntax ........: _GDIPlus_BitmapApplyFilter_Median2($hImage, $fRadius[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $fRadius - a floating point value. The higher the value the more time will needed for calculation. ; The value is limited between 1 and 25. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: This filter is faster than _GDIPlus_BitmapApplyFilter_Median but the output quality is lower! ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Median2($hImage, $fRadius, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Median2", "ptr", $hImage, "float", $fRadius, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Median2 ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Kuwahara ; Description ...: A smoothing (noise reduction) filter. Like the SNN filter, the Kuwahara filter is an adaptive, edge-preserving ; smoothing filter. ; Syntax ........: _GDIPlus_BitmapApplyFilter_Kuwahara($hImage, $iSize[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iSize - an integer value. The higher the value the more time will needed for calculation. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Kuwahara($hImage, $iSize, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Kuwahara", "ptr", $hImage, "uint", $iSize, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Kuwahara ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Edges ; Description ...: An edge detecting function based on left neighbour color value. ; Syntax ........: _GDIPlus_BitmapApplyFilter_Edges($hImage, $bMode[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iMode - an integer value. If 1 then the colors will be negated. ; $bInverse - [optional] a boolean value. Default is False. If true image will be inverted. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Edges($hImage, $iMode, $bInverse = False, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Edges", "ptr", $hImage, "uByte", $iMode, "bool", $bInverse, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Edges ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Pointillism ; Description ...: Creates an image based on filled ellipses. ; Syntax ........: _GDIPlus_BitmapApplyFilter_Pointillism($hImage, $iRounds, $iSizeEllipse, $iAlpha[, $bBorder = False[, ; $bGDI_Bmp = False]]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iRounds - an integer value. The amount of drawn filled ellipses. ; $iSizeEllipse - an integer value. The size of the ellipses. ; $iAlpha - an integer value. Alpha color channel. Possible values are between 0 and 255 whereas ; 0 is transparent and 255 is opaque. ; $bBorder - [optional] a boolean value. Default is False. If true ellipses will have borders. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Pointillism($hImage, $iRounds, $iSizeEllipse, $iAlpha, $bBorder = False, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Pointillism", "ptr", $hImage, "uint", $iRounds, "uint", $iSizeEllipse, "byte", $iAlpha, "bool", $bBorder, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Pointillism ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Linellism ; Description ...: Creates an image based on filled rectangles (similar to Pointillism fx). ; Syntax ........: _GDIPlus_BitmapApplyFilter_Linellism($hImage, $iRounds, $iSizeRect, $iAlpha[, $iMode = 1[, $bBorder = False[, ; $bGDI_Bmp = False]]]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iRounds - an integer value. The amount of drawn filled rectangles. ; $iSizeRect - an integer value. The size of the rectangles. ; $iAlpha - an integer value. Alpha color channel. Possible values are between 0 and 255 whereas ; 0 is transparent and 255 is opaque. ; $iMode - [optional] an integer value. Default is 1. Direction of the rectangles. ; 1 = horizontal, 2 = vertical, 3 = randomly 1 and 2. ; $bBorder - [optional] a boolean value. Default is False. If true ellipses will have borders. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Linellism($hImage, $iRounds, $iSizeRect, $iAlpha, $iMode = 1, $bBorder = False, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Linellism", "ptr", $hImage, "uint", $iRounds, "uint", $iSizeRect, "byte", $iAlpha, "byte", $iMode, "bool", $bBorder, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Linellism ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Convolution ; Description ...: In image processing, a kernel, convolution matrix, or mask is a small matrix useful for blurring, sharpening, ; embossing, edge detection, and more. This is accomplished by means of convolution between a kernel and an image. ; Syntax ........: _GDIPlus_BitmapApplyFilter_Convolution($hImage, $fFactor, $fBias[, $iMode = 1[, $bGDI_Bmp = False]]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $fFactor - a floating point value. Adjustment for the color value (the factor will be multiplied with the result). ; $fBias - a floating point value. Adjustment for the color value (brightness). ; $iMode - [optional] an integer value. Default is 1. ; Convolution modes (matrixes): ; 0: Manual odd matrix -> 3x3, 5x5, 7x7, 9x9 ; 1: Emboss 3x3 ; 2: Emboss 45 Degree 3x3 ; 3: Emboss Top Left Bottom Right 3x3 ; 4: Intense Emboss 5x5 ; 5: Sharpen 3x3 ; 6: Box Blur (normalized) 3x3 ; 7: Gaussian Blur (approximation) 3x3 ; 8: Triangle Blur 3x3 ; 9: Unsharp(with no image mask) 5x5 ; 10: Unsharp 3x3 ; 11: Edge Detection 1 3x3 ; 12: Edge Detection 2 3x3 ; 13: Edge Detection 3 3x3 ; 14: Edge Detection 4 3x3 ; 15: Edge Detection 5 3x3 ; 16: Edge Detection 6 3x3 ; 17: Another Blur 5x5 ; 18: Motion Blur 9x9 ; 19: Sharpen 2 3x3 ; 20: Sobel 3x3 with 2 matrixes (h/w) ; 21: Laplace 3x3 v1 ; 22: Laplace 3x3 v2 ; 23: Laplace 5x5 ; 24: Prewitt 3x3 ; 25: Kirsch 3x3 ; 26: Gaussian3x3 blur ; 27: Gaussian5x5 Type1 blur ; 28: Gaussian5x5 Type2 blur ; 29: Laplacian of Gaussian 5x5 ; 30: Sovel vs Prewitt 3x3 ; $tMatrix - [optional] an integer value. Default is 0. You can provide a convolution matrix manually. ; The struct must have same amount of columns & rows whereas columns / rows must be odd! ; E.g. struct of array has following structure for a 3x3 matrix: ; $iMatrix = 3 * 3 ; $tStruct = DllStructCreate("float Matrix[" & $iMatrix & "]") ; $tStruct.Matrix((1)) = 0.1 ; $tStruct.Matrix((2)) = 0.2 ; $tStruct.Matrix((3)) = 0.3 ; $tStruct.Matrix((4)) = 1.1 ; $tStruct.Matrix((5)) = 1.2 ; $tStruct.Matrix((6)) = 1.3 ; $tStruct.Matrix((7)) = 2.1 ; $tStruct.Matrix((8)) = 2.2 ; $tStruct.Matrix((9)) = 2.3 ; As an array: ; [0.1, 0.1, 0.1] ; [1.1, 1.1, 1.1] ; [2.1, 2.1, 2.1] ; $iMatrix - [optional] an integer value. Default is 0. The amount of matrix elements. E.g. a 3x3 matrix ; has 9 elements. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Convolution($hImage, $fFactor, $fBias, $iMode = 1, $tMatrix = 0, $iMatrix = 0, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Convolution", "ptr", $hImage, "float", $fFactor, "float", $fBias, "byte", $iMode, "struct*", $tMatrix, "ushort", $iMatrix, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Convolution ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Raster ; Description ...: Creates a raster effect based on ellipses. ; Syntax ........: _GDIPlus_BitmapApplyFilter_Raster($hImage[, $iSizeW = 8[, $iSizeH = 8[, $fDensity = 0.0[, $fbrightness = 0[, ; $fBias = 0[, $iMode = 1[, $bGDI_Bmp = False]]]]]]]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iSizeW - [optional] an integer value. Default is 8. Width of the raster ellipse. ; $iSizeH - [optional] an integer value. Default is 8. Height of the raster ellipse. ; $fDensity - [optional] a floating point value. Default is 0.0. Represents the pixel density. ; $fbrightness - [optional] a floating point value. Default is 0. Represents the brightness of the ellipse color. ; $fBias - [optional] a floating point value. Default is 0. Adjusts the size of the ellipse. ; $iMode - [optional] an integer value. Default is 1. 1 = colorized, >1 = b/w. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Raster($hImage, $iSizeW = 8, $iSizeH = 8, $fDensity = 0.0, $fbrightness = 10, $fBias = 0, $iMode = 1, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Raster", "ptr", $hImage, "uint", $iSizeW, "uint", $iSizeH, "float", $fDensity, "float", $fbrightness, "float", $fBias, "byte", $iMode, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Raster ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Pixelate ; Description ...: Pixelates an image. ; Syntax ........: _GDIPlus_BitmapApplyFilter_Pixelate($hImage[, $iPixelate = 8[, $bGDI_Bmp = False]]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iPixelate - [optional] an integer value. Default is 8. The divisor for the width / height of the image. ; The higher the value the more pixelated will be the image. ; $bGrid - [optional] a boolean value. Default is False. If true a grid will be drawn according to the pixel size. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Pixelate($hImage, $iPixelate = 8, $bGrid = False, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Pixelate", "ptr", $hImage, "byte", $iPixelate, "bool", $bGrid, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Pixelate ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Dilatation ; Description ...: Gradually enlarges the boundaries of regions of foreground pixels (i.e. white pixels, typically). ; Syntax ........: _GDIPlus_BitmapApplyFilter_Dilate($hImage[, $iSize = 5[, $bGDI_Bmp = False]]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iSize - [optional] an integer value. Default is 5. The higher the value the more time will ; needed for calculation. $iSize is limited to a value between 2 and 32. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Dilatation($hImage, $iSize = 5, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Dilatation", "ptr", $hImage, "byte", $iSize, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Dilatation ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Erosion ; Description ...: Erodes away the boundaries of regions of foreground pixels (i.e. white pixels, typically). ; Syntax ........: _GDIPlus_BitmapApplyFilter_Erosion($hImage[, $iSize = 5[, $bGDI_Bmp = False]]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iSize - [optional] an integer value. Default is 5. The higher the value the more time will ; needed for calculation. $iSize is limited to a value between 2 and 32. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Erosion($hImage, $iSize = 5, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Erosion", "ptr", $hImage, "byte", $iSize, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Erosion ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_OilPainting ; Description ...: Applies an oil painting look to the image. ; Syntax ........: _GDIPlus_BitmapApplyFilter_OilPainting($hImage, $iRadius, $fIntensityLevels[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iRadius - an integer value. The size of the brush. $iRadius is limited to a value between 1 and 32. ; $fIntensityLevels - a floating point value. The higher the value the more details will be drawn and also ; more time will needed for calculation. Lower values mean more solid colors. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_OilPainting($hImage, $iRadius, $fIntensityLevels, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_OilPainting", "ptr", $hImage, "byte", $iRadius, "float", $fIntensityLevels, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_OilPainting ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_ColorAccent ; Description ...: Make the image greyscale except the selected Hue value. ; Syntax ........: _GDIPlus_BitmapApplyFilter_ColorAccent($hImage[, $iHue = 0[, $fRange = 15[, $bGDI_Bmp = False]]]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iHue - [optional] an integer value. Default is 0°. A Hue value which will be skipped to be greyscale. ; Range: 0° - 360° ; $fRange - [optional] a floating point value. Default is 15. Range of Hue value. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: http://www.rapidtables.com/convert/color/rgb-to-hsv.htm ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_ColorAccent($hImage, $iHue = 0, $fRange = 15, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_ColorAccent", "ptr", $hImage, "ushort", $iHue, "float", $fRange, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_ColorAccent ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_PenSketch ; Description ...: A bundle of several filters to produce a pen sketch effect. ; Syntax ........: _GDIPlus_BitmapApplyFilter_PenSketch($hImage, $iThreshold[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iThreshold - an integer value. This value is used for _GDIPlus_BitmapApplyFilter_Convolution (Sobel) ; filter. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_PenSketch($hImage, $iThreshold, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_PenSketch", "ptr", $hImage, "float", $iThreshold, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_PenSketch ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_PenSketch2 ; Description ...: A bundle of several filters to produce a pen sketch effect. ; Syntax ........: _GDIPlus_BitmapApplyFilter_PenSketch2($hImage, $iThreshold[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iThreshold - an integer value. This value is used for _GDIPlus_BitmapApplyFilter_Convolution (Sobel) ; filter. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_PenSketch2($hImage, $iThreshold, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_PenSketch2", "ptr", $hImage, "ubyte", $iThreshold, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_PenSketch2 ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Cartoon1 ; Description ...: Creates a cartoon effect image. ; Syntax ........: _GDIPlus_BitmapApplyFilter_Cartoon1($hImage, $iRadius, $fIntensityLevels, $iThreshold[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iRadius - an integer value. The size of the brush. $iRadius is limited to a value between 1 and 32. ; $fIntensityLevels - a floating point value. The higher the value the more details will be drawn and also ; more time will needed for calculation. Lower values mean more solid colors. ; $iThreshold - an integer value. The lower the value the more black contour lines will be drawn. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Cartoon1($hImage, $iRadius, $fIntensityLevels, $iThreshold, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Cartoon1", "ptr", $hImage, "ubyte", $iRadius, "float", $fIntensityLevels, "ubyte", $iThreshold, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Cartoon1 ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_TiltShift ; Description ...: Creates a tilf shift effect. ; Syntax ........: _GDIPlus_BitmapApplyFilter_TiltShift($hImage, $fPosY[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $fPosY - a floating point value. This value is the area in the image where no blurring occurs whereas ; $fPosY is the start and $fPosY + $fPosY / 2 the end position. ; $iIntensity - an integer value. The higher the value the more the image will be blurred. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_TiltShift($hImage, $fPosY, $iIntensity, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_TiltShift", "ptr", $hImage, "float", $fPosY, "uByte", $iIntensity, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_TiltShift ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_RadialBlur ; Description ...: Creates a radial blur effect. ; Syntax ........: _GDIPlus_BitmapApplyFilter_RadialBlur($hImage, $fPosX, $fPosY, $fRadius, $iIntensity[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $fPosX - a floating point value. X position if the circle. ; $fPosY - a floating point value. Y position if the circle. ; $fRadius - a floating point value. Radius of the non blur circle. ; $iIntensity - an integer value. The higher the value the more the image will be blurred. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_RadialBlur($hImage, $fPosX, $fPosY, $fRadius, $iIntensity, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_RadialBlur", "ptr", $hImage, "float", $fPosX, "float", $fPosY, "float", $fRadius, "uByte", $iIntensity, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_RadialBlur ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_TimeWarp ; Description ...: Creates a time warp effect. ; Syntax ........: _GDIPlus_BitmapApplyFilter_TimeWarp($hImage, $fFactor, $fMidX, $fMidY[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $fFactor - a floating point value. The strength of the time warp effect ; $fMidX - a floating point value. X coordinate for the center. ; $fMidY - a floating point value. Y coordinate for the center. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_TimeWarp($hImage, $fFactor, $fMidX, $fMidY, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_TimeWarp", "ptr", $hImage, "float", $fFactor, "float", $fMidX, "float", $fMidY, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_TimeWarp ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_FishEye ; Description ...: Creates a fish eye effect. ; Syntax ........: _GDIPlus_BitmapApplyFilter_FishEye($hImage[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_FishEye($hImage, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_FishEye", "ptr", $hImage, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_FishEye ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Wave ; Description ...: Adds a wavy look to the image. ; Syntax ........: _GDIPlus_BitmapApplyFilter_Wave($hImage, $fAmplitudeX, $fAmplitudeY, $fFrequencyX, $fFrequencyY[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $fAmplitudeX - a floating point value. ; $fAmplitudeY - a floating point value. ; $fFrequencyX - a floating point value. ; $fFrequencyY - a floating point value. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Wave($hImage, $fAmplitudeX, $fAmplitudeY, $fFrequencyX, $fFrequencyY, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Wave", "ptr", $hImage, "float", $fAmplitudeX, "float", $fAmplitudeY, "float", $fFrequencyX, "float", $fFrequencyY, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Wave ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Swirl ; Description ...: Creates a swirl effect. ; Syntax ........: _GDIPlus_BitmapApplyFilter_Swirl($hImage, $fDegree[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $fDegree - a floating point value. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Swirl($hImage, $fDegree, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Swirl", "ptr", $hImage, "float", $fDegree, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Swirl ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_XRay ; Description ...: Creates a x-ray effect. ; Syntax ........: _GDIPlus_BitmapApplyFilter_XRay($hImage, $iBias, $bInvert[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iBias - an integer value. The bias value increases / decreases the brightness of the image ; $bInvert - a boolean value. Inverts the colors (negative). ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_XRay($hImage, $iBias, $bInvert, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_XRay", "ptr", $hImage, "byte", $iBias, "bool", $bInvert, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_XRay ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_DistortionBlur ; Description ...: Creates a blurred / distored image effect. ; Syntax ........: _GDIPlus_BitmapApplyFilter_DistortionBlur($hImage, $iDistortFactor[, $bGDI_Bmp = False]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iDistortFactor - an integer value. The higher the value the more the pixels will be distorted. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_DistortionBlur($hImage, $iDistortFactor, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_DistortionBlur", "ptr", $hImage, "ushort", $iDistortFactor, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_DistortionBlur ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_BWJJNDithering ; Description ...: Converts the image to a black and white image using Jarvis, Judice, and Ninke dithering ; Syntax ........: _GDIPlus_BitmapApplyFilter_BWJJNDithering($hImage[, $fErrorMultiplier = 0.3333333[, $iThreshold = 128[, ; $bGDI_Bmp = False]]]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $fErrorMultiplier - [optional] a floating point value. Default is 0.3333333. ; $iThreshold - [optional] an integer value. Default is 128. Level between black = 0 and white = 255. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_BWJJNDithering($hImage, $fErrorMultiplier = 0.3333333, $iThreshold = 128, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) $iThreshold = $iThreshold < 0 ? 0 : $iThreshold > 255 ? 255 : $iThreshold Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_BWJJNDithering", "ptr", $hImage, "float", $fErrorMultiplier, "ubyte", $iThreshold, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_BWJJNDithering ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapApplyFilter_Indexed ; Description ...: Converts the image to 1, 16 or 256 color bitmap. Dithering is optional. ; Syntax ........: _GDIPlus_BitmapApplyFilter_Indexed($hImage[, $iColors = 256[, $iDitherStrength = 5[, $iDitherMode = 1[, ; $bDither = True[, $bGDI_Bmp = False]]]]]) ; Parameters ....: $hImage - a handle to a GDIPlus bitmap. ; $iColors - [optional] an integer value. Default is 256. 1, 16 or 256 color are implemented yet only. ; $iDitherMode - [optional] an integer value. Default is 1. 2 is calculated with Euclidean distance. ; $bDither - [optional] a boolean value. Default is True. If false the dithering is disabled. ; $bGDI_Bmp - [optional] a boolean value. Default is False. If false a GDIPlus bitmap handle will be returned, ; otherwise a GDI bitmap handle. ; Return values .: A bitmap handle (GDI/GDI+) depending on $bGDI_Bmp value. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _GDIPlus_BitmapApplyFilter_Indexed($hImage, $iColors = 256, $iDitherMode = 1, $bDither = True, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Indexed", "ptr", $hImage, "ulong", $iColors, "bool", $bDither, "ubyte", $iDitherMode, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc ;==>_GDIPlus_BitmapApplyFilter_Indexed Func _GDIPlus_BitmapApplyFilter_Mosaic($hImage, $iSites, $bOrdered, $bBorder, $iCalcMode, $iBorderColor, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Mosaic", "ptr", $hImage, "ULong", $iSites, "bool", $bOrdered, "bool", $bBorder, "ubyte", $iCalcMode, "ulong", $iBorderColor, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc Func _GDIPlus_BitmapApplyFilter_Delaunay($hImage, $iBlur = 4, $fSobel = 1.0, $iThresholdBW = 60, $iSpaceX = 4, $iSpaceY = 4, $iBorderSpaceX = 16, $iBorderSpaceY = 16, _ $bRndPoints = False, $iRndPoints = 0, $bShowEdges = False, $iAlpha = 0x60, $bWireframe = False, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Delaunay", "ptr", $hImage, "ubyte", $iBlur, "float", $fSobel, "ubyte", $iThresholdBW, "ulong", $iSpaceX, "ulong", $iSpaceY, "ubyte", _ $iBorderSpaceX, "ubyte", $iBorderSpaceY, "bool", $bRndPoints, "ulong", $iRndPoints, "bool", $bShowEdges, "ubyte", $iAlpha, "bool", $bWireframe, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc Func _GDIPlus_BitmapApplyFilter_Spiral($hImage, $iMode = 1, $iBgColor = 0xFFF0F0F0, $bGreyscale = True, $bGDI_Bmp = False) If Not IsPtr($hImage) Then Return SetError(1, 0, 0) Local Const $aReturn = DllCall($__hDLL__FX__, "ptr", "_GDIPlus_BitmapApplyFilter_Spiral", "ptr", $hImage, "ubyte", $iMode, "ulong", $iBgColor, "bool", $bGreyscale, "bool", $bGDI_Bmp) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc You need the DLL version dated to 2020-11-16 to use the UDF properly.1 point
-
Hi @junkew, I do not know if this could be useful, however, at this link (https://www.autoitscript.com/forum/topic/168043-realtime-node-framework-like-blenders-node-interface/) there was a script that generated nice diagrams, but it seems that script is no longer available in that topic. By chance I had a copy of it in a folder, which I upload here if it can help you .... Opt("GUIOnEventMode", 1) Global Const $iGUIWidth = 1000 Global Const $iGUIHeight = 600 GUICreate("Node Test", $iGUIWidth, $iGUIHeight, -1, -1, -1, 34078728) GUISetBkColor(0x404040) GUISetOnEvent(-3, "exut") GUISetFont(7) Dim $aMovables[1][7] $g = GUICtrlCreateGraphic(0,0) GUICtrlSetState(-1, 128) $aMovables[0][0] = GUICtrlCreateButton("Render Framework" & @LF & "mode: init", 20, 20, 100, 40, 0x2000) $aMovables[0][1] = 20 $aMovables[0][2] = 20 $aMovables[0][3] = 100 $aMovables[0][4] = 40 $aMovables[0][5] = "1,2,3" $aMovables[0][6] = 0xFFFFFF ;AddObject(Text, Pos, Pos, Pos, Pos, Connected Nodes) AddObject("type: value" & @LF & "mode: per frame" & @LF & "name: SunX", 160, 40, 100, 50, "4") AddObject("type: value" & @LF & "mode: per frame" & @LF & "name: AmbientLight", 80, 140, 100, 50, "4") AddObject("type: value" & @LF & "mode: per frame" & @LF & "name: SunRed", 20, 240, 100, 50, "4") AddObject("type: loop" & @LF & "mode: general" & @LF & "name: ""MainLoop""", 300, 110, 100, 50, "5,6,7,18,23,28,32,37") AddObject("type: value" & @LF & "mode: per pixel" & @LF & "name: DirectLight", 320, 20, 100, 50, "") AddObject("type: variable" & @LF & "mode: per pixel" & @LF & "name: ColorARGB", 450, 20, 100, 50, "") AddObject("type: element" & @LF & "mode: per pixel" & @LF & "name: Tree Trunks", 580, 20, 100, 50, "8") AddObject("formula: tt_01", 740, 20, 100, 20, "9,17") AddObject("bool: AND", 880, 35, 60, 20, "10") AddObject("formula: tt_02", 740, 50, 100, 20, "11,17") AddObject("bool: AND", 880, 65, 60, 20, "12") AddObject("formula: tt_03", 740, 80, 100, 20, "13,17") AddObject("bool: AND", 880, 95, 60, 20, "14") AddObject("formula: tt_04", 740, 110, 100, 20, "15,17") AddObject("bool: AND", 880, 125, 60, 20, "16") AddObject("formula: tt_05", 740, 140, 100, 20, "17") AddObject("type: modifier" & @LF & "mode: requested" & @LF & "name: SetColor", 580, 80, 100, 50, "40") AddObject("type: element" & @LF & "mode: per pixel" & @LF & "name: Light Leaves", 450, 75, 100, 50, "19") AddObject("formula: ll_01", 580, 140, 100, 20, "20,22") AddObject("bool: AND", 740, 170, 60, 20, "21") AddObject("formula: ll_02", 580, 170, 100, 20, "22") AddObject("type: modifier" & @LF & "mode: requested" & @LF & "name: SetColor", 450, 135, 100, 50, "40") AddObject("type: element" & @LF & "mode: per pixel" & @LF & "name: Dark Leaves", 880, 150, 100, 50, "24") AddObject("formula: dl_01", 740, 200, 100, 20, "25,27") AddObject("bool: AND", 880, 210, 60, 20, "26") AddObject("formula: dl_02", 740, 230, 100, 20, "27") AddObject("type: modifier" & @LF & "mode: requested" & @LF & "name: SetColor", 580, 200, 100, 50, "40") AddObject("type: element" & @LF & "mode: per pixel" & @LF & "name: Ground", 320, 180, 100, 50, "29") AddObject("formula: g_01", 450, 200, 100, 20, "30") AddObject("bool: AND", 360, 240, 60, 20, "31") AddObject("type: modifier" & @LF & "mode: requested" & @LF & "name: SetColor", 450, 230, 100, 50, "40") AddObject("type: element" & @LF & "mode: per pixel" & @LF & "name: Water", 510, 290, 100, 50, "33") AddObject("formula: w_01", 365, 290, 100, 20, "34,36") AddObject("bool: AND", 270, 270, 60, 20, "35") AddObject("formula: w_02", 365, 330, 100, 20, "36") AddObject("type: modifier" & @LF & "mode: requested" & @LF & "name: SetColor", 230, 330, 100, 50, "40") AddObject("type: element" & @LF & "mode: per pixel" & @LF & "name: Sun", 630, 260, 100, 50, "38") AddObject("formula: s_01", 800, 310, 100, 20, "39") AddObject("type: modifier" & @LF & "mode: requested" & @LF & "name: SetColor", 870, 240, 100, 50, "40") AddObject("Render Framework" & @LF & "mode: flush", 800, 500, 100, 40, "") Func AddObject($sText, $iLeft, $iTop, $iWidth, $iHeight, $sNodes, $iColor = 0xFFFFFF) $Bound = UBound($aMovables) ReDim $aMovables[$Bound+1][7] $aMovables[$Bound][0] = GUICtrlCreateButton($sText, $iLeft, $iTop, $iWidth, $iHeight, 0x2000) $aMovables[$Bound][1] = $iLeft $aMovables[$Bound][2] = $iTop $aMovables[$Bound][3] = $iWidth $aMovables[$Bound][4] = $iHeight $aMovables[$Bound][5] = $sNodes $aMovables[$Bound][6] = $iColor EndFunc DrawBounds() GUISetState() While Sleep(20) $cur = GUIGetCursorInfo() If Not IsArray($cur) Then ContinueLoop If $cur[2] = 1 Then For $nCtrl = 0 To UBound($aMovables)-1 If $cur[4] = $aMovables[$nCtrl][0] Then $end = GUIGetCursorInfo() If Not IsArray($end) Then ContinueLoop $dx = $end[0] - $aMovables[$nCtrl][1] $dy = $end[1] - $aMovables[$nCtrl][2] $iDrawn = 0 $iTimer = TimerInit() Do $end = GUIGetCursorInfo() $aMovables[$nCtrl][1] = $end[0]-$dx $aMovables[$nCtrl][2] = $end[1]-$dy If $aMovables[$nCtrl][1] <= 6 Then $aMovables[$nCtrl][1] = 6 If $aMovables[$nCtrl][2] <= 6 Then $aMovables[$nCtrl][2] = 6 If $aMovables[$nCtrl][1]+$aMovables[$nCtrl][3] >= ($iGUIWidth-6) Then $aMovables[$nCtrl][1] = ($iGUIWidth-6)-$aMovables[$nCtrl][3] If $aMovables[$nCtrl][2]+$aMovables[$nCtrl][4] >= ($iGUIWidth-26) Then $aMovables[$nCtrl][2] = ($iGUIHeight-26)-$aMovables[$nCtrl][4] $aMovables[$nCtrl][6] = 0x00FF00 $back = $g $g = GUICtrlCreateGraphic(0,0) GUICtrlSetState(-1, 128) DrawBounds() For $tCtrl = 0 To UBound($aMovables)-1 If $aMovables[$tCtrl][5] <> "" Then $aNodes = StringSplit($aMovables[$tCtrl][5], ",", 3) For $nConnection = 0 To UBound($aNodes)-1 If Not IsNodeInObject($aNodes[$nConnection], $tCtrl) Then DrawConnection($tCtrl, $aNodes[$nConnection], $aMovables) $iDrawn += 1 Next EndIf Next GUICtrlDelete($back) GUICtrlSetPos($aMovables[$nCtrl][0], $aMovables[$nCtrl][1], $aMovables[$nCtrl][2]) $aMovables[$nCtrl][6] = 0xFFFFFF Until $end[2] = 0 EndIf Next EndIf WEnd Func IsNodeInObject(ByRef $iObj, $nNode) If $aMovables[$iObj][5] = "" Then Return False $f = StringSplit($aMovables[$iObj][5], ",", 3) For $b = 0 To UBound($f)-1 If $f[$b] = $nNode Then Return True Next Return False EndFunc Func DrawConnection($n1,$n2, ByRef $a) GUICtrlSetGraphic($g,8,$a[$n1][6]) If $a[$n1][1]+$a[$n1][3]<=$a[$n2][1] Then $n=DrawWire(5+$a[$n1][1]+$a[$n1][3],$a[$n1][2]+($a[$n1][4]/2),$a[$n2][1]-5,$a[$n2][2]+($a[$n2][4]/2))+g($g,12,1+$a[$n1] _ [1]+$a[$n1][3],$a[$n1][2]+($a[$n1][4]/2)-4,9,9)+g($g,12,$a[$n2][1]-10,$a[$n2][2]+($a[$n2][4]/2)-4,9,9) ElseIf $a[$n1][1]+$a[$n1][3]>=$a[$n2][1] And $a[$n1][1]<=$a[$n2][1]+$a[$n2][3] And $a[$n1][2]+$a[$n1][4]<=$a[$n2][2] Then $n=DrawWire($a[$n1][1]+($a[$n1][3]/2),$a[$n1][2]+$a[$n1][4]+5,$a[$n2][1]+($a[$n2][3]/2),$a[$n2][2]-6)+g($g,12,$a[$n1][1 _ ]+($a[$n1][3]/2)-4,$a[$n1][2]+$a[$n1][4]+1,9,9)+g($g,12,$a[$n2][1]+($a[$n2][3]/2)-4,$a[$n2][2]-10,9,9) ElseIf $a[$n1][1]+$a[$n1][3]>=$a[$n2][1] And $a[$n1][1]<=$a[$n2][1]+$a[$n2][3] And $a[$n1][2]>=$a[$n2][2]+$a[$n2][4] Then $n=DrawWire($a[$n1][1]+($a[$n1][3]/2),$a[$n1][2]-6,$a[$n2][1]+($a[$n2][3]/2),$a[$n2][2]+$a[$n2][4]+5)+g($g,12,$a[$n1][1 _ ]+($a[$n1][3]/2)-4,$a[$n1][2]-10,9,9)+g($g,12,$a[$n2][1]+($a[$n2][3]/2)-4,$a[$n2][2]+$a[$n2][4]+1,9,9) ElseIf $a[$n1][1]>=$a[$n2][1]++$a[$n2][3] Then $n=DrawWire($a[$n1][1]-6,$a[$n1][2]+($a[$n1][4]/2),$a[$n2][1]+$a[$n2][3]+6,$a[$n2][2]+($a[$n2][4]/2))+g($g,12,$a[$n1][1 _ ]-10,$a[$n1][2]+($a[$n1][4]/2)-4,9,9)+g($g,12,1+$a[$n2][1]+$a[$n2][3],$a[$n2][2]+($a[$n2][4]/2)-4,9,9) EndIf EndFunc Func g($1, $2, $3, $4, $5, $6) GUICtrlSetGraphic($1, $2, $3, $4, $5, $6) EndFunc Func DrawBounds() GUICtrlSetGraphic($g, 8, 0xFFFFFF) GUICtrlSetGraphic($g, 10, 5, 5, ($iGUIWidth-10), ($iGUIHeight-10)) EndFunc Func DrawWire($x, $y, $x1, $y1) $d = ($x1-$x) / 2 GUICtrlSetGraphic($g, 6, $x, $y) GUICtrlSetGraphic($g, 4, $x1, $y1, $x+$d, $y, $x+$d, $y1) EndFunc Func exut() Exit EndFunc1 point
-
You could do this: #include <GUIConstantsEx.au3> #include <WinAPIEx.au3> Example() Func Example() Local $hGUI = GUICreate('An(other) example by guinness - 2013', Default, Default) ; Create a GUI. GUISetState(@SW_SHOW, $hGUI) GUIRegisterMsg(_WinAPI_RegisterWindowMessage('SHELLHOOK'), 'WM_SHELLHOOK') ; Define a window message and assign to the WM_SHELLHOOK function. _WinAPI_RegisterShellHookWindow($hGUI) ; Register the shell hook message to our GUI. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd _WinAPI_DeregisterShellHookWindow($hGUI) GUIDelete($hGUI) EndFunc ;==>Example Func WM_SHELLHOOK($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg Switch $wParam Case $HSHELL_WINDOWCREATED ConsoleWrite('Created: ' & @CRLF & _ @TAB & 'PID: ' & WinGetProcess($lParam) & @CRLF & _ ; This is the PID. @TAB & 'Filename: ' & _WinAPI_GetWindowFileName($lParam) & @CRLF & _ ; This is the filepath of the window. @TAB & 'hWnd: ' & WinGetTitle($lParam) & @CRLF) ; This will be the handle of the window closed. EndSwitch EndFunc ;==>WM_SHELLHOOK Saludos1 point