Search the Community
Showing results for tags 'Bitmap'.
-
I wrote a dll and the wrapper to convert non-animated WebP images to a GDI/GDI+ format / encode any GDI+ supported image to WebP format for use in Autoit. What is WebP? You can find more information about WebP and WebP tools / source codes here: https://developers.google.com/speed/webp Maybe useful for one or the other... 🙂 WebP.au3: ;Version 0.3.1 build 2022-06-13 beta #include-once #include <GDIPlus.au3> Enum $WEBP_PRESET_DEFAULT = 0, _ ; default preset. $WEBP_PRESET_PICTURE, _ ; digital picture, like portrait, inner shot $WEBP_PRESET_PHOTO, _ ; outdoor photograph, with natural lighting $WEBP_PRESET_DRAWING, _ ; hand or line drawing, with high-contrast details $WEBP_PRESET_ICON, _ ; small-sized colorful images $WEBP_PRESET_TEXT ; text-like ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_Ver ; Description ...: Displays the DLL version information in a messagebox window ; Syntax ........: WebP_Ver([$sPath2DLL = ""]) ; Parameters ....: $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir ; Return values .: None ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_Ver($sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found DllCall($sDLL, "none", "WebP_DLL_Version") Return True EndFunc ;==>WebP_Ver ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_Ver2 ; Description ...: Returns the DLL version information ; Syntax ........: WebP_Ver([$sPath2DLL = ""]) ; Parameters ....: $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir ; Return values .: DLL version ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func WebP_Ver2($sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found Return DllCall($sDLL, "str", "Web_DLL_Version2")[0] EndFunc ;==>WebP_Ver ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_BitmapGetInfo ; Description ...: Gets some rudimentary information about the WebP image ; Syntax ........: WebP_BitmapGetInfo($sFilename[, $sPath2DLL = ""]) ; Parameters ....: $sFilename - file to load ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir ; Return values .: Struct ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: https://developers.google.com/speed/webp ; Example .......: No ; =============================================================================================================================== Func WebP_BitmapGetInfo($sFilename, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found If Not FileExists($sFilename) Then Return SetError(2, 0, 0) ;file not found Local $iFileSize = FileGetSize($sFilename), $nBytes Local $tBuffer = DllStructCreate("struct;byte bin[" & $iFileSize & "];endstruct") Local Const $hFile = _WinAPI_CreateFile($sFilename, 2, 2) _WinAPI_ReadFile($hFile, $tBuffer, $iFileSize, $nBytes) _WinAPI_CloseHandle($hFile) If Int(BinaryMid($tBuffer.bin, 1, 4)) <> 1179011410 Or Int(BinaryMid($tBuffer.bin, 9, 6)) <> 88331643929943 Then Return SetError(3, 0, 0) ;header must contain RIFF and WEBPVP Local $tWebPBitstreamFeatures = DllStructCreate("struct;long width; long height; long has_alpha; long has_animation; long format; ulong pad[5];endstruct") Local $iReturn = DllCall($sDLL, "long", "WebP_BitmapGetInfo", "struct*", $tBuffer, "uint", $iFileSize, "struct*", $tWebPBitstreamFeatures) If $iReturn = 0 Then Return SetError(4, 0, 0) Return $tWebPBitstreamFeatures EndFunc ;==>WebP_BitmapGetInfo ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_BitmapCreateGDIp ; Description ...: Converts (decodes) a WebP image from disk to a GDI / GDI+ bitmap handle ; Syntax ........: WebP_BitmasFilename[, $bGDIImage = False[, $sPath2DLL = ""]]) ; Parameters ....: $sFilename - file to load ; $bGDIImage - [optional] a boolean value. Default is False (GDIPlus bitmap handle). If True then output is GDI bitmap handle ; $bCountColors - [optional] a boolean value. Default is False. If True then the colors will be counted and saved in extended. Use @extended to get color count. ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir ; Return values .: GDI / GDIPlus bitmap handle and color count if $bCountColors = True in extended. ; Author ........: UEZ ; Modified ......: ; Remarks .......: Currently only WebP images are supported - no animated WebP images yet! ; Related .......: ; Link ..........: https://developers.google.com/speed/webp ; Example .......: No ; =============================================================================================================================== Func WebP_BitmapCreateGDIp($sFilename, $bGDIImage = False, $bCountColors = False, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found If Not FileExists($sFilename) Then Return SetError(2, 0, 0) ;file not found Local $iFileSize = FileGetSize($sFilename), $nBytes Local $tBuffer = DllStructCreate("byte bin[" & $iFileSize & "]") Local Const $hFile = _WinAPI_CreateFile($sFilename, 2, 2) _WinAPI_ReadFile($hFile, $tBuffer, $iFileSize, $nBytes) _WinAPI_CloseHandle($hFile) If Int(BinaryMid($tBuffer.bin, 1, 4)) <> 1179011410 Or Int(BinaryMid($tBuffer.bin, 9, 6)) <> 88331643929943 Then Return SetError(3, 0, 0) ;header must contain RIFF and WEBPVP Local $tColors = DllStructCreate("struct;ulong cc;endstruct") Local Const $hBitmap = DllCall($sDLL, "ptr", "WebP_BitmapCreateGDIp", "struct*", $tBuffer, "uint", $iFileSize, "boolean", $bGDIImage, "boolean", $bCountColors, "struct*", $tColors)[0] If $hBitmap = 0 Then Return SetError(4, 0, 0) Return SetExtended($tColors.cc, $hBitmap) EndFunc ;==>WebP_BitmapCreateGDIp ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_BitmapCreateGDIpFromMem ; Description ...: Converts (decodes) a WebP image from memory to a GDI / GDI+ bitmap handle ; Syntax ........: WebP_BitmapCreateGDIpFromMem($tBuffer[, $iBufferSize = 0[, $bGDIImage = False[, $sPath2DLL = ""]]]) ; Parameters ....: $tBuffer - a dll struct with WebP binary data as content or pointer to the memory data ; $iBufferSize - the size of the binary data (file size) ; $bGDIImage - [optional] a boolean value. Default is False (GDIPlus bitmap handle). If True then output is GDI bitmap handle ; $bCountColors - [optional] a boolean value. Default is False. If True then the colors will be counted and saved in extended. Use @extended to get color count. ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir ; Return values .: GDI / GDIPlus bitmap handle and color count if $bCountColors = True in extended. ; Author ........: UEZ ; Modified ......: ; Remarks .......: Currently only WebP images are supported - no animated WebP images yet! ; Related .......: ; Link ..........: https://developers.google.com/speed/webp ; Example .......: No ; =============================================================================================================================== Func WebP_BitmapCreateGDIpFromMem($tBuffer, $iBufferSize = 0, $bGDIImage = False, $bCountColors = False, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found If $iBufferSize = 0 Then Return SetError(2, 0, 0) Local $binMem If IsPtr($tBuffer) Then Local $tMem = DllStructCreate("byte bin[" & $iBufferSize & "]", $tBuffer) $binMem = $tMem.bin Else $binMem = DllStructGetData($tBuffer, 1) EndIf If Int(BinaryMid($binMem, 1, 4)) <> 1179011410 Or Int(BinaryMid($binMem, 9, 6)) <> 88331643929943 Then Return SetError(3, 0, 0) ;header must contain RIFF and WEBPVP Local $tColors = DllStructCreate("struct;ulong cc;endstruct") Local Const $hBitmap = DllCall($sDLL, "ptr", "WebP_BitmapCreateGDIp", "struct*", $tBuffer, "uint", $iBufferSize, "boolean", $bGDIImage, "boolean", $bCountColors, "struct*", $tColors)[0] If $hBitmap = 0 Then Return SetError(4, 0, 0) Return SetExtended($tColors.cc, $hBitmap) EndFunc ;==>WebP_BitmapCreateGDIpFromMem ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_CreateWebPLossySimpleFromBitmap ; Description ...: Converts a bitmap to WebP lossy image and save it to HD ; Syntax ........: WebP_CreateWebPLossySimpleFromBitmap($sFilename, $hBitmap[, $iQuality = 75[, $sPath2DLL = ""]]) ; Parameters ....: $sFilename - file to load ; $hBitmap - GDIPlus bitmap handle ; $iQuality - [optional] an integer value. Default is 75. Valid range is 0 - 100. ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir. ; Return values .: 0 for failure, 1 for success. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: https://developers.google.com/speed/webp ; Example .......: No ; =============================================================================================================================== Func WebP_CreateWebPLossySimpleFromBitmap($sFilename, $hBitmap, $iQuality = 75, $sPath2DLL = "") If $sFilename = "" Then Return SetError(1, 0, 0) Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(2, 0, 0) ;DLL not found Local $iReturn = DllCall($sDLL, "long", "WebP_CreateWebPLossySimpleFromBitmap", "str", $sFilename, "ptr", $hBitmap, "float", $iQuality)[0] If $iReturn = 0 Then Return SetError(3, 0, 0) Return 1 EndFunc ;==>WebP_CreateWebPLossySimpleFromBitmap ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_CreateWebPLosslessSimpleFromBitmap ; Description ...: Converts a bitmap to WebP lossless image and save it to HD ; Syntax ........: WebP_CreateWebPLosslessSimpleFromBitmap($sFilename, $hBitmap[, $sPath2DLL = ""]) ; Parameters ....: $sFilename - file to load ; $hBitmap - GDIPlus bitmap handle ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir. ; Return values .: 0 for failure, 1 for success. ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: https://developers.google.com/speed/webp ; Example .......: No ; =============================================================================================================================== Func WebP_CreateWebPLosslessSimpleFromBitmap($sFilename, $hBitmap, $sPath2DLL = "") If $sFilename = "" Then Return SetError(1, 0, 0) Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(2, 0, 0) ;DLL not found Local $iReturn = DllCall($sDLL, "long", "WebP_CreateWebPLosslessSimpleFromBitmap", "str", $sFilename, "ptr", $hBitmap)[0] If $iReturn = 0 Then Return SetError(3, 0, 0) Return 1 EndFunc ;==>WebP_CreateWebPLosslessSimpleFromBitmap ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_CreateWebPAdvancedFromBitmap ; Description ...: Converts a bitmap to WebP lossy / lossless image and save it to HD ; Syntax ........: WebP_CreateWebPAdvancedFromBitmap($sFilename, $hBitmap[, $WebPPreset = $WEBP_PRESET_DEFAULT[, $lossless = 0[, ; $quality = 75.0[, $method = 4[, $sns_strength = 50[, $filter_sharpness = 0[, $filter_strength = 60[, ; $pass = 1[, $level = 6[, $sPath2DLL = ""]]]]]]]]]]) ; Parameters ....: $sFilename - file to load ; $hBitmap - GDIPlus bitmap handle ; $WebPPreset - [optional] an unknown value. Default is $WEBP_PRESET_DEFAULT. ; $lossless - [optional] an unknown value. Default is 0. 0 for lossy encoding / 1 for lossless.. ; $quality - [optional] an unknown value. Default is 75.0. Valid range is 0 - 100. ; $method - [optional] a map. Default is 4. Valid range is 0 - 6 (0=fast, 6=slower-better). ; $sns_strength - [optional] a string value. Default is 50. Spatial Noise Shaping. 0=off, 100=maximum ; $filter_sharpness - [optional] a floating point value. Default is 0. Range: [0 = off .. 7 = least sharp] ; $filter_strength - [optional] a floating point value. Default is 60. Range: [0 = off .. 100 = strongest] ; $pass - [optional] a pointer value. Default is 1. Number of entropy-analysis passes (in [1..10]). ; $level - [optional] an unknown value. Default is 6. Between 0 (fastest, lowest compression) and 9 (slower, best compression) only valid for lossless = 1! ; $near_lossless - [optional] an unknown value. Default is 100. Near lossless encoding [0 = max loss .. 100 = off (default)]. ; $alpha_compression - [optional] an unknown value. Default is 1. Algorithm for encoding the alpha plane (0 = none,1 = compressed with WebP lossless). Default is 1. ; $alpha_filtering - [optional] an unknown value. Default is 1. Predictive filtering method for alpha plane.0: none, 1: fast, 2: best. Default if 1. ; $alpha_quality - [optional] an unknown value. Default is 100. Between 0 (smallest size) and 100 (lossless). Default is 100. ; $target_size - [optional] an unknown value. Default is 0. If non-zero, set the desired target size in bytes. ; $NoSave - [optional] an unknown value. Default is False. ; $pMem - [optional] a string value. Default is Null. If $NoSave = True then the pointer to the memory which holds the data will be returned. ; $pCallback - [optional] a pointer value. Default is 0. Pointer to a callback address for progress hook. ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir. ; Return values .: negative value for failure, 1 for success or the struct with information (pointers, size) if $NoSave = True ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: https://developers.google.com/speed/webp ; Example .......: No ; =============================================================================================================================== Func WebP_CreateWebPAdvancedFromBitmap($sFilename, $hBitmap, $WebPPreset = $WEBP_PRESET_DEFAULT, $lossless = 0, $quality = 75.0, $method = 4, $sns_strength = 50, _ $filter_sharpness = 0, $filter_strength = 60, $pass = 1, $level = 6, $near_lossless = 100, $alpha_compression = 1, $alpha_filtering = 1, $alpha_quality = 100, _ $target_size = 0, $NoSave = False, $pCallback = 0, $sPath2DLL = "") If $sFilename = "" And Not $NoSave Then Return SetError(1, 0, 0) Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(2, 0, 0) ;DLL not found Local $tMem = DllStructCreate("struct;ptr pPic; ptr pWriter; ptr pMemData; uint memsize;endstruct") Local $iReturn = DllCall($sDLL, "long", "WebP_CreateWebPAdvancedFromBitmap", _ "str", $sFilename, _ ;Webp filename "ptr", $hBitmap, _ ;handle to GDI+ bitmap "long", $WebPPreset, _ ;WebPPreset "long", $lossless, _ ;lossless "float", $quality, _ ;quality "long", $method, _ ;method "long", $sns_strength, _ ;sns_strength "long", $filter_sharpness, _ ;filter_sharpness "long", $filter_strength, _ ;filter_strength "long", $pass, _ ;pass "long", $level, _ ;level "long", $near_lossless, _ ;near_lossless "long", $alpha_compression, _ ;alpha_compression "long", $alpha_filtering, _ ;alpha_filtering "long", $alpha_quality, _ ;alpha_quality "long", $target_size, _ ;target_size "bool", $NoSave, _ ; "struct*", $tMem, _ ; "ptr", @AutoItX64 ? $pCallback : 0)[0] ;x86 crashes for unknown reason If $iReturn < 0 Then Return SetError(3, 0, $iReturn) If $NoSave And $tMem.memsize = 0 Then SetError(4, 0, 0) Return $NoSave ? $tMem : $iReturn EndFunc ;==>WebP_CreateWebPAdvancedFromBitmap ; #FUNCTION# ==================================================================================================================== ; Name ..........: WebP_FreeUp ; Description ...: Release the ressources from $tMem struct ; Syntax ........: WebP_FreeUp(Byref $tMem[, $sPath2DLL = ""]) ; Parameters ....: $tMem - [in/out] a dll struct value. ; $sPath2DLL - [optional] a string value. Default is "". ; Return values .: 1 ; Author ........: UEZ ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: https://developers.google.com/speed/webp ; Example .......: No ; =============================================================================================================================== Func WebP_FreeUp(ByRef $tMem, $sPath2DLL = "") Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(1, 0, 0) ;DLL not found Local $iReturn = DllCall($sDLL, "long", "WebP_FreeUp", "struct*", $tMem)[0] Return $iReturn EndFunc ;==>WebP_FreeUp ; #FUNCTION# ==================================================================================================================== ; Name ..........: BitmapCountColors ; Description ...: Counts the colors used by the bitmap ; Syntax ........: BitmapCountColors($hBitmap) ; Parameters ....: $hBitmap - a handle to a GDI+ bitmap. ; $bGDIImage - [optional] a boolean value. Default is False (GDIPlus bitmap handle). ; Return values .: Number of colors used by the image. ; Author ........: UEZ ; Modified ......: ; Remarks .......: The result may differ from other programs for JPG images depending on the decoder. ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func BitmapCountColors($hBitmap = 0, $bGDIImage = False, $sPath2DLL = "") If IsPtr($hBitmap) = 0 Or $hBitmap = 0 Then SetError(1, 0, 0) Local $sDLL = Path2DLL($sPath2DLL) If Not FileExists($sDLL) Then Return SetError(2, 0, 0) ;DLL not found Local $iReturn = DllCall(Path2DLL(), "ulong", "BitmapCountColors", "ptr", $hBitmap)[0] Return $iReturn EndFunc ; #INTERNAL_USE_ONLY#============================================================================================================ ; Name...........: Path2DLL ; Description ...: Return the path to the _WebP_x??.dll ; Author ........: UEZ ; Modified.......: ; Remarks .......: This function is used internally by WebP.au3 ; =============================================================================================================================== Func Path2DLL($sPath2DLL = "") Return $sPath2DLL ? $sPath2DLL : @ScriptDir & (@AutoItX64 ? "\_WebP_x64.dll" : "\_WebP_x86.dll") EndFunc ;==>Path2DLL WebP Advanced Encoder GUI: ;Coded by UEZ build 2022-06-18 #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Res_HiDpi=n #AutoIt3Wrapper_Version=p #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /pe ;/rm #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #pragma compile(Icon, WebP_logo_2010_by_Simo99.ico) #pragma compile(FileVersion, 0.9.9.0) #pragma compile(ProductVersion, 3.3.16.1) #pragma compile(CompanyName, "UEZ Software Development") #pragma compile(ProductName, "WebP Advanced Encoder GUI") AutoItSetOption("MustDeclareVars", 1) #include <Array.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GuiMenu.au3> #include <GuiStatusBar.au3> #include <Memory.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> #include <WinAPISysWin.au3> #include <WinAPITheme.au3> #include <WindowsConstants.au3> #include "WebP.au3" Break(0) If @OSBuild < 10240 Then MsgBox($MB_ICONWARNING, "Warning", "Your Windows version is not support!", 30) If WebP_Ver2() < "0.3.1" Then Exit MsgBox($MB_ICONERROR, "ERROR", "DLL Version v0.3.1+ required!", 30) Global Const $ver = "v0.99", $build = "build 2022-06-18" #Region TichySID Global Const $tagIMAGE_DOS_HEADER = 'WORD e_magic;WORD e_cblp;WORD e_cp;WORD e_crlc;WORD e_cparhdr;WORD e_minalloc;WORD e_maxalloc;WORD e_ss;WORD e_sp;WORD e_csum;WORD e_ip;WORD e_cs;WORD e_lfarlc;WORD e_ovno;WORD e_res[4];WORD e_oemid;WORD e_oeminfo;WORD e_res2[10];LONG e_lfanew;' Global Const $tagIMAGE_FILE_HEADER = 'WORD Machine;WORD NumberOfSections;DWORD TimeDateStamp;DWORD PointerToSymbolTable;DWORD NumberOfSymbols;WORD SizeOfOptionalHeader;WORD Characteristics;' Global $tagIMAGE_OPTIONAL_HEADER = 'WORD Magic;BYTE MajorLinkerVersion;BYTE MinorLinkerVersion;DWORD SizeOfCode;DWORD SizeOfInitializedData;DWORD SizeOfUninitializedData;DWORD AddressOfEntryPoint;DWORD BaseOfCode;DWORD BaseOfData;PTR ImageBase;DWORD SectionAlignment;DWORD FileAlignment;WORD MajorOperatingSystemVersion;WORD MinorOperatingSystemVersion;WORD MajorImageVersion;WORD MinorImageVersion;WORD MajorSubsystemVersion;WORD MinorSubsystemVersion;DWORD Win32VersionValue;DWORD SizeOfImage;DWORD SizeOfHeaders;DWORD CheckSum;WORD Subsystem;WORD DllCharacteristics;PTR SizeOfStackReserve;PTR SizeOfStackCommit;PTR SizeOfHeapReserve;PTR SizeOfHeapCommit;DWORD LoaderFlags;DWORD NumberOfRvaAndSizes;' If @AutoItX64 Then $tagIMAGE_OPTIONAL_HEADER = 'WORD Magic;BYTE MajorLinkerVersion;BYTE MinorLinkerVersion;DWORD SizeOfCode;DWORD SizeOfInitializedData;DWORD SizeOfUninitializedData;DWORD AddressOfEntryPoint;DWORD BaseOfCode;PTR ImageBase;DWORD SectionAlignment;DWORD FileAlignment;WORD MajorOperatingSystemVersion;WORD MinorOperatingSystemVersion;WORD MajorImageVersion;WORD MinorImageVersion;WORD MajorSubsystemVersion;WORD MinorSubsystemVersion;DWORD Win32VersionValue;DWORD SizeOfImage;DWORD SizeOfHeaders;DWORD CheckSum;WORD Subsystem;WORD DllCharacteristics;PTR SizeOfStackReserve;PTR SizeOfStackCommit;PTR SizeOfHeapReserve;PTR SizeOfHeapCommit;DWORD LoaderFlags;DWORD NumberOfRvaAndSizes;' Global Const $tagIMAGE_NT_HEADER = 'DWORD Signature;' & $tagIMAGE_FILE_HEADER & $tagIMAGE_OPTIONAL_HEADER Global Const $tagIMAGE_SECTION_HEADER = 'CHAR Name[8];DWORD VirtualSize;DWORD VirtualAddress;DWORD SizeOfRawData;DWORD PointerToRawData;DWORD PointerToRelocations;DWORD PointerToLinenumbers;WORD NumberOfRelocations;WORD NumberOfLinenumbers;DWORD Characteristics;' Global Const $tagIMAGE_DATA_DIRECTORY = 'DWORD VirtualAddress;DWORD Size;' Global Const $tagIMAGE_BASE_RELOCATION = 'DWORD VirtualAddress;DWORD SizeOfBlock;' Global Const $tagIMAGE_IMPORT_DESCRIPTOR = 'DWORD OriginalFirstThunk;DWORD TimeDateStamp;DWORD ForwarderChain;DWORD Name;DWORD FirstThunk;' Global Const $tagIMAGE_IMPORT_BY_NAME = 'WORD Hint;char Name[1];' Global Const $tagIMAGE_EXPORT_DIRECTORY = 'DWORD Characteristics;DWORD TimeDateStamp;WORD MajorVersion;WORD MinorVersion;DWORD Name;DWORD Base;DWORD NumberOfFunctions;DWORD NumberOfNames;DWORD AddressOfFunctions;DWORD AddressOfNames;DWORD AddressOfNameOrdinals;' Global $_KERNEL32DLL = DllOpen('kernel32.dll') Global $_MFHookPtr, $_MFHookBak, $_MFHookApi = 'LocalCompact' Global Const $tagModule = 'PTR ExportList;PTR CodeBase;PTR ImportList;PTR DllEntry;DWORD Initialized;' Global Const $SID_MEMORY = 1 Global Const $SID_NON_DEFAULT = 2 Global $hTitchysidDll, $iSubsongCount = 0 #EndRegion ; enum _PROCESS_DPI_AWARENESS -> https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx Global Enum $DPI_AWARENESS_INVALID = -1, $PROCESS_DPI_UNAWARE = 0, $PROCESS_SYSTEM_DPI_AWARE, $PROCESS_PER_MONITOR_DPI_AWARE ;https://docs.microsoft.com/en-us/windows/desktop/hidpi/dpi-awareness-context Global Enum $Context_UnawareGdiScaled = -5, $Context_PerMonitorAwareV2, $Context_PerMonitorAware, $Context_SystemAware, $Context_Unaware ; enum _MONITOR_DPI_TYPE Global Enum $MDT_EFFECTIVE_DPI = 0, $MDT_ANGULAR_DPI, $MDT_RAW_DPI Global Const $MDT_DEFAULT = $MDT_EFFECTIVE_DPI Global Const $SM_CXPADDEDBORDER = 92 _GDIPlus_Startup() ;~ Global $aDPI = _WinAPI_GetDpiForMonitor() ;_GDIPlus_GraphicsGetDPIRatio() Global $aDPI = [1, 1] Global $hGUI_About, $iFPS = 0, $iShowFPS = 0, $bExit, $bGUIBgColor = 0xFF808080 #Region GUI Global Const $SC_DRAGMOVE = 0xF012, $iW = 322, $iH = 694 Global Const $hGUI = GUICreate("WAE GUI " & $ver & " Beta by UEZ", $iW, $iH, @DesktopWidth - 330, -1, -1, BitOR($WS_EX_ACCEPTFILES, $WS_EX_APPWINDOW, $WS_EX_TOPMOST, $WS_EX_NOACTIVATE)) GUISetFont(10 * $aDPI[0], 400, 0, "Arial Narrow") Global Const $Title = GUICtrlCreateLabel("WebP Advanced Encoder GUI", 5, 8, 310, 41) GUICtrlSetFont(-1, 21 * $aDPI[0], 400, 0, "Arial Narrow") Global Const $icLoad = GUICtrlCreateIcon(@SystemDir & "\shell32.dll", -127, 8, 60, 32, 32, BitOR($GUI_SS_DEFAULT_ICON, $WS_BORDER)) GUICtrlSetTip(-1, "Load a GDI+ supported image") Global Const $icSave = GUICtrlCreateIcon(@SystemDir & "\shell32.dll", -259, 56, 60, 32, 32, BitOR($GUI_SS_DEFAULT_ICON, $WS_BORDER)) GUICtrlSetTip(-1, "Save compressed image in WebP format.") Global Const $icReset = GUICtrlCreateIcon(@SystemDir & "\shell32.dll", -239, 104, 60, 32, 32, BitOR($GUI_SS_DEFAULT_ICON, $WS_BORDER)) GUICtrlSetTip(-1, "Reset image position if image was moved (only for images larger than preview window).") GUICtrlCreateLabel("", 0, 106, 324, 2, $SS_ETCHEDHORZ) Global Const $lbPresets = GUICtrlCreateLabel("Presets", 10, 125, 39, 20) Global Const $cbPreset = GUICtrlCreateCombo("Default", 120, 120, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)), $hcbPreset = GUICtrlGetHandle($cbPreset) GUICtrlSetData(-1, "Picture|Photo|Drawing|Icon|Text") Global Const $chkbLossless = GUICtrlCreateCheckbox("&Lossless", 120, 152, 97, 17) GUICtrlSetTip(-1, "Enable lossless compression. Default: lossy.") Global Const $lbEncoding = GUICtrlCreateLabel("Encoding", 10, 152, 48, 20) Global Const $lbQuality = GUICtrlCreateLabel("Quality", 10, 176, 36, 20) Global Const $slQuality = GUICtrlCreateSlider(116, 176, 158, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslQuality = GUICtrlGetHandle($slQuality) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, 75) GUICtrlSetTip(-1, "Between 0 and 100. 0 gives the smallest size and 100 the largest.") Global Const $ipQuality = GUICtrlCreateInput("", 274, 172, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slQuality)) Global Const $lbMethod = GUICtrlCreateLabel("Method", 10, 210, 39, 20) Global Const $slMethod = GUICtrlCreateSlider(116, 210, 158, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslMethod = GUICtrlGetHandle($slMethod) GUICtrlSetLimit(-1, 6, 0) GUICtrlSetData(-1, 4) GUICtrlSetTip(-1, "Quality/speed trade-off (0=fast, 6=slower-better.") Global Const $ipMethod = GUICtrlCreateInput("", 274, 206, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slMethod)) Global Const $lbSNS_Strength = GUICtrlCreateLabel("SNS-Strength", 10, 242, 66, 20) Global Const $slSNS_Strength = GUICtrlCreateSlider(116, 244, 158, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslSNS_Strength = GUICtrlGetHandle($slSNS_Strength) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, 50) GUICtrlSetTip(-1, "Spatial Noise Shaping. 0=off, 100=maximum.") Global Const $ipSSN_Strength = GUICtrlCreateInput("", 274, 240, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slSNS_Strength)) Global Const $lbFilterSharpness = GUICtrlCreateLabel("Filter Sharpness", 10, 274, 81, 20) Global Const $slFilter_Sharpness = GUICtrlCreateSlider(116, 278, 158, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslFilter_Sharpness = GUICtrlGetHandle($slFilter_Sharpness) GUICtrlSetLimit(-1, 7, 0) GUICtrlSetTip(-1, "Range: [0 = off .. 7 = least sharp].") Global Const $ipFilter_Sharpness = GUICtrlCreateInput("", 274, 274, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slFilter_Sharpness)) Global Const $lbFilter_Strength = GUICtrlCreateLabel("Filter Strenght", 010, 304, 69, 20) Global Const $slFilter_Strength = GUICtrlCreateSlider(116, 312, 158, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslFilter_Strength = GUICtrlGetHandle($slFilter_Strength) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, 60) GUICtrlSetTip(-1, "Range: [0 = off .. 100 = strongest]") Global Const $ipFilter_Strength = GUICtrlCreateInput("", 274, 308, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slFilter_Strength)) Global Const $lbPass = GUICtrlCreateLabel("Pass", 10, 344, 27, 20) Global Const $slPass = GUICtrlCreateSlider(116, 346, 158, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslPass = GUICtrlGetHandle($slPass) GUICtrlSetLimit(-1, 10, 1) GUICtrlSetData(-1, 6) GUICtrlSetTip(-1, "Number of entropy-analysis passes (in [1..10]).") Global Const $ipPass = GUICtrlCreateInput("", 274, 342, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slPass)) Global Const $lbNear_Lossless = GUICtrlCreateLabel("Near Lossless", 10, 378, 80, 20) Global Const $slNear_Lossless = GUICtrlCreateSlider(116, 380, 158, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslNear_Lossless = GUICtrlGetHandle($slNear_Lossless) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, 60) GUICtrlSetTip(-1, "Specify the level of near-lossless image preprocessing. The range is 0 (maximum preprocessing) to 100 (no preprocessing, the default).") Global Const $ipNear_Lossless = GUICtrlCreateInput("", 274, 374, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slNear_Lossless)) Global Const $lbLevel = GUICtrlCreateLabel("Level", 10, 411, 30, 20) Global Const $slLevel = GUICtrlCreateSlider(116, 414, 158, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslLevel = GUICtrlGetHandle($slLevel) GUICtrlSetLimit(-1, 9, 0) GUICtrlSetData(-1, 6) GUICtrlSetTip(-1, "Switch on lossless compression mode with the specified level between 0 and 9, with level 0 being the fastest, 9 being the slowest.") Global Const $ipLevel = GUICtrlCreateInput("", 274, 410, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slLevel)) Global Const $lbAlpha_Compression = GUICtrlCreateLabel("Alpha Compression", 10, 444, 96, 20) Global Const $chkbAlpha_Compression = GUICtrlCreateCheckbox("&Enable", 120, 444, 97, 17) GUICtrlSetState(-1, $GUI_CHECKED) Global Const $lbAlpha_Filtering = GUICtrlCreateLabel("Alpha Filtering", 10, 478, 71, 20) Global Const $slAlpha_Filtering = GUICtrlCreateSlider(114, 482, 158, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslAlpha_Filtering = GUICtrlGetHandle($slAlpha_Filtering) GUICtrlSetLimit(-1, 2, 0) GUICtrlSetData(-1, 1) GUICtrlSetTip(-1, "Predictive filtering method for alpha plane. 0: none, 1: fast, 2: best. Default if 1.") Global Const $ipAlpha_Filtering = GUICtrlCreateInput("", 274, 478, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slAlpha_Filtering)) Global Const $lbAlpha_Quality = GUICtrlCreateLabel("Alpha Quality", 8, 516, 66, 20) Global Const $slAlpha_Quality = GUICtrlCreateSlider(114, 516, 158, 21, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_ENABLESELRANGE)), $hslAlpha_Quality = GUICtrlGetHandle($slAlpha_Quality) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, 100) GUICtrlSetTip(-1, "Between 0 (smallest size) and 100 (lossless).") Global Const $ipAlpha_Quality = GUICtrlCreateInput("", 274, 512, 28, 24, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_READONLY)) GUICtrlSetData(-1, GUICtrlRead($slAlpha_Quality)) Global Const $lbTarget_Size = GUICtrlCreateLabel("Target Size", 10, 552, 58, 20) Global Const $ipTarget_Size = GUICtrlCreateInput("0", 120, 550, 121, 24, $ES_NUMBER) GUICtrlSetTip(-1, "If non-zero, set the desired target size in bytes (lossy mode only!).") Global Const $chkbCountColors = GUICtrlCreateCheckbox("&Count Colors", 10, 590, 87, 17) Global Const $lbColorOriginal = GUICtrlCreateLabel("Source:", 101, 590, 38, 20) Global Const $ipColorOriginal = GUICtrlCreateInput("0", 142, 588, 60, 24, BitOR($ES_NUMBER, $ES_READONLY)) Global Const $lbColorWebP = GUICtrlCreateLabel("WebP:", 215, 590, 32, 20) Global Const $ipColorWebP = GUICtrlCreateInput("0", 250, 588, 60, 24, BitOR($ES_NUMBER, $ES_READONLY)) Global Const $btnShow = GUICtrlCreateButton("Show Original Image", 10, 630, 123, 25) GUICtrlSetTip(-1, "Press lmb and hold it to display original image.") Global Const $btnApply = GUICtrlCreateButton("&Apply Settings", 188, 630, 123, 25) Global Const $StatusBar = _GUICtrlStatusBar_Create($hGUI), $iSBColor = 0xE9CFEC _WinAPI_SetWindowTheme($StatusBar, "", "") _GUICtrlStatusBar_SetText($StatusBar, " Welcome to 'WebP Advanced Encoder GUI' ٩(●̮̮̃•̃)۶") _GUICtrlStatusBar_SetBkColor($StatusBar, $iSBColor) Global Const $hGUI_Image = GUICreate("", 0, 0, -1, -1, $WS_EX_TOOLWINDOW, BitOR($WS_EX_TOOLWINDOW, $WS_EX_APPWINDOW)) GUISetBkColor(BitAND(0xFFFFFF, $bGUIBgColor), $hGUI_Image) Global Const $iPic_WebP = GUICtrlCreatePic("", 0, 0, 0, 0), $hPic_WebP = GUICtrlGetHandle($iPic_WebP) ;~ Global Const $iW_Zoom = @DesktopWidth * 0.25, $iH_Zoom = @DesktopHeight * 0.25 ;~ Global Const $hGUI_Image_Zoom = GUICreate("", $iW_Zoom, $iH_Zoom, 0, 0, $WS_POPUP) Global Const $dw = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME), $dh = _WinAPI_GetSystemMetrics($SM_CYDLGFRAME) + _WinAPI_GetSystemMetrics($SM_CYSIZE) + 1 Global Enum $idAbout = 5000, $idResetPicPos, $idResetValues Global Const $hMenu_Sys = _GUICtrlMenu_GetSystemMenu($hGUI) _GUICtrlMenu_AppendMenu($hMenu_Sys, $MF_SEPARATOR, 0, 0) _GUICtrlMenu_AppendMenu($hMenu_Sys, $MF_STRING, $idAbout, "About") Global Const $hImage_Icon = _GDIPlus_BitmapCreateFromMemory(_WebP_Icon()) Global Const $hIcon = _GDIPlus_HICONCreateFromBitmap($hImage_Icon) _WinAPI_SetClassLongEx($hGUI, -34, $hIcon) _GDIPlus_ImageDispose($hImage_Icon) GUISetState(@SW_HIDE, $hGUI_Image) GUISetState(@SW_SHOW, $hGUI) ;~ GUISetState(@SW_SHOW, $hGUI_Image_Zoom) _WinAPI_SetProcessDpiAwarenessContext($Context_PerMonitorAwareV2, $hGUI, 2) Global Const $iDummy_About = GUICtrlCreateDummy(), $iDummy_Return = GUICtrlCreateDummy() Global $sFileLoad, $hImage, $hImage_GDI, $hHBitmap, $aDim, $aPixelFormat, $pMemData, $pMemData_Size, $tMem, $mp, $sFileSave, $hFile, $nBytes, $nBytes, $iResetPosX, $iResetPosY, _ $hImage_tmp GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES") GUIRegisterMsg($WM_LBUTTONDOWN, "WM_LBUTTONDOWN") GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUIRegisterMsg($WM_CONTEXTMENU, "WM_CONTEXTMENU") GUIRegisterMsg($WM_SYSCOMMAND, "WM_SYSCOMMAND") GUIRegisterMsg($WM_HSCROLL, "WM_HSCROLL") #EndRegion GUI Global $aGUIGetMsg, $aMPos1, $aMPos2, $iMPx, $iMPy, $iMPx_p = 0, $iMPy_p = 0, $bBigger = False, $iResult, $old_cursor, $bNew = False While 1 $mp = GUIGetCursorInfo($hGUI) If $hImage And $mp[2] And $mp[4] = $btnShow Then _WinAPI_DeleteObject(GUICtrlSendMsg($iPic_WebP, $STM_SETIMAGE, $IMAGE_BITMAP, $hImage_GDI)) While $mp[2] $mp = GUIGetCursorInfo($hGUI) Sleep(10) WEnd _WinAPI_DeleteObject(GUICtrlSendMsg($iPic_WebP, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap)) EndIf $mp = GUIGetCursorInfo($hGUI_Image) $aMPos1 = MouseGetPos() If $mp[4] = $iPic_WebP And $mp[2] And $bBigger And WinActive($hGUI_Image) Then While $mp[2] $mp = GUIGetCursorInfo($hGUI_Image) Sleep(10) $aMPos2 = MouseGetPos() $iMPx = $iMPx_p + $aMPos2[0] - $aMPos1[0] $iMPy = $iMPy_p + $aMPos2[1] - $aMPos1[1] ControlMove($hGUI_Image, "", $iPic_WebP, $iMPx, $iMPy) WEnd $iMPx_p = $iMPx $iMPy_p = $iMPy EndIf $aGUIGetMsg = GUIGetMsg(1) Switch $aGUIGetMsg[1] Case $hGUI Switch $aGUIGetMsg[0] Case $GUI_EVENT_CLOSE GUIRegisterMsg($WM_DROPFILES, "") GUIRegisterMsg($WM_LBUTTONDOWN, "") GUIRegisterMsg($WM_COMMAND, "") GUIRegisterMsg($WM_CONTEXTMENU, "") GUIRegisterMsg($WM_SYSCOMMAND, "") GUIRegisterMsg($WM_HSCROLL, "") ;~ If IsDllStruct($tMem) Then WebP_FreeUp($tMem) _WinAPI_DestroyIcon($hIcon) If $hImage_tmp Then _GDIPlus_ImageDispose($hImage_tmp) If $hImage Then _GDIPlus_ImageDispose($hImage) If $hHBitmap Then _WinAPI_DeleteObject($hHBitmap) If $hImage_GDI Then _WinAPI_DeleteObject($hImage_GDI) If $hGUI_Image Then GUIDelete($hGUI_Image) _GDIPlus_Shutdown() GUIDelete($hGUI_Image) GUIDelete($hGUI) DllClose($_KERNEL32DLL) Exit Case $btnApply, $iDummy_Return If $hImage Then CompressAndDisplay($hImage) EndIf Case $icLoad $sFileLoad = FileOpenDialog("Select an image to compress", "", "Images (*.jpg;*.bmp;*.png;*.gif;*.tif;*webp)") If @error Then ContinueLoop LoadImage($sFileLoad) Case $icSave If $hImage Then $sFileSave = FileSaveDialog("Save WebP Image", "", "WebP Image (*.webp)", BitOR($FD_PATHMUSTEXIST, $FD_PROMPTOVERWRITE), StringRegExpReplace($sFileLoad, ".+\\(.+)\..*", "$1") & ".webp", $hGUI) If @error Then ContinueLoop $hFile = _WinAPI_CreateFile($sFileSave, 1) $iResult = _WinAPI_WriteFile($hFile, $tMem.pMemData, $tMem.memsize, $nBytes) _WinAPI_CloseHandle($hFile) If Not $iResult Then MsgBox($MB_ICONERROR, "ERROR", "Unable to save WebP image to disk!", 30, $hGUI) Else MsgBox($MB_ICONINFORMATION, "Information", "WebP image successfully save to disk", 10, $hGUI) EndIf EndIf Case $icReset ResetImage() Case $slAlpha_Filtering GUICtrlSetData($ipAlpha_Filtering, GUICtrlRead($slAlpha_Filtering)) Case $slAlpha_Quality GUICtrlSetData($ipAlpha_Quality, GUICtrlRead($slAlpha_Quality)) Case $slFilter_Sharpness GUICtrlSetData($ipFilter_Sharpness, GUICtrlRead($slFilter_Sharpness)) Case $slFilter_Strength GUICtrlSetData($ipFilter_Strength, GUICtrlRead($slFilter_Strength)) Case $slLevel GUICtrlSetData($ipLevel, GUICtrlRead($slLevel)) Case $slMethod GUICtrlSetData($ipMethod, GUICtrlRead($slMethod)) Case $slNear_Lossless GUICtrlSetData($ipNear_Lossless, GUICtrlRead($slNear_Lossless)) Case $slPass GUICtrlSetData($ipPass, GUICtrlRead($slPass)) Case $slQuality GUICtrlSetData($ipQuality, GUICtrlRead($slQuality)) Case $slSNS_Strength GUICtrlSetData($ipSSN_Strength, GUICtrlRead($slSNS_Strength)) Case $iDummy_About AutoItSetOption("GUIOnEventMode", 1) GDIPlus_About(11 * $aDPI[0], 0.5, 18.5) AutoItSetOption("GUIOnEventMode", 0) EndSwitch Case $hGUI_Image Switch $aGUIGetMsg[0] Case $GUI_EVENT_CLOSE EndSwitch EndSwitch WEnd Func ResetImage() If $bBigger Then $iMPx_p = $iResetPosX $iMPy_p = $iResetPosY ControlMove($hGUI_Image, "", $iPic_WebP, $iMPx_p, $iMPy_p) EndIf EndFunc Func LoadImage($sFileLoad) If $hImage_tmp Then _GDIPlus_ImageDispose($hImage_tmp) If $hImage Then _GDIPlus_ImageDispose($hImage) If $hImage_GDI Then _WinAPI_DeleteObject($hImage_GDI) If StringRight($sFileLoad, 5) = ".webp" Then $hImage_tmp = WebP_BitmapCreateGDIp($sFileLoad) If @error Or $hImage_tmp = 0 Then Return MsgBox($MB_ICONERROR, "ERROR", "Unable to decode WebP image!", 30, $hGUI) EndIf Else $hImage_tmp = _GDIPlus_ImageLoadFromFile($sFileLoad) If @error Or $hImage_tmp = 0 Then Return MsgBox($MB_ICONERROR, "ERROR", "Unknown image format!", 30, $hGUI) EndIf EndIf $aPixelFormat = _GDIPlus_ImageGetPixelFormat($hImage_tmp) ;Local Const $aImageRawFormat = _GDIPlus_ImageGetRawFormat($hImage_tmp) If BitAND(GUICtrlRead($chkbCountColors), $GUI_CHECKED) Then GUICtrlSetData($ipColorOriginal, BitmapCountColors($hImage_tmp)) Else GUICtrlSetData($ipColorOriginal, 0) EndIf ;~ If $hImage_tmp Then ConsoleWrite("Original color count: " & BitmapCountColors($hImage_tmp) & @CRLF) $aDim = _GDIPlus_ImageGetDimension($hImage_tmp) $hImage = _GDIPlus_BitmapCreateFromScan0($aDim[0], $aDim[1]) Local Const $hGfx = _GDIPlus_ImageGetGraphicsContext($hImage) If $aPixelFormat[0] = 2498570 Then _GDIPlus_GraphicsClear($hGfx, $bGUIBgColor) _GDIPlus_GraphicsDrawImageRect($hGfx, $hImage_tmp, 0, 0, $aDim[0], $aDim[1]) _GDIPlus_GraphicsDispose($hGfx) $hImage_GDI = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $bNew = True _WinAPI_LockWindowUpdate($hGUI) CompressAndDisplay($hImage, $aPixelFormat[1]) _WinAPI_LockWindowUpdate(0) EndFunc ;==>LoadImage Func CompressAndDisplay($hImage, $sFormat = "") Local $aDim = _GDIPlus_ImageGetDimension($hImage) If $hHBitmap Then _WinAPI_DeleteObject($hHBitmap) $pMemData = 0 $pMemData_Size = 0 Local $iPreset = GUICtrlRead($cbPreset) Switch $iPreset Case "Default" $iPreset = 0 Case "Picture" $iPreset = 1 Case "Photo" $iPreset = 2 Case "Drawing" $iPreset = 3 Case "Icon" $iPreset = 4 Case "Text" $iPreset = 5 EndSwitch ;~ If IsDllStruct($tMem) Then WebP_FreeUp($tMem) $old_cursor = MouseGetCursor() GUISetCursor(15, 1, $hGUI) _GUICtrlStatusBar_SetBkColor($StatusBar, 192) Local $iCallback = DllCallbackRegister("Progress", "long", "long;ptr"), $hCallback = DllCallbackGetPtr($iCallback) Sleep(10) Local $end, $fTimer = TimerInit() $tMem = WebP_CreateWebPAdvancedFromBitmap("", $hImage, _ $iPreset, _ BitAND(GUICtrlRead($chkbLossless), $GUI_CHECKED), _ GUICtrlRead($slQuality), _ GUICtrlRead($slMethod), _ GUICtrlRead($slSNS_Strength), _ GUICtrlRead($slFilter_Sharpness), _ GUICtrlRead($slFilter_Strength), _ GUICtrlRead($slPass), _ GUICtrlRead($slLevel), _ GUICtrlRead($slNear_Lossless), _ BitAND(GUICtrlRead($chkbAlpha_Compression), $GUI_CHECKED), _ GUICtrlRead($slAlpha_Filtering), _ GUICtrlRead($slAlpha_Quality), _ GUICtrlRead($ipTarget_Size), _ True, _ ;hold the compressed image in memory only, no save to HD! $hCallback) $end = TimerDiff($fTimer) DllCallbackFree($hCallback) ToolTip("") _GUICtrlStatusBar_SetBkColor($StatusBar, $iSBColor) GUISetCursor($old_cursor, 1, $hGUI) Local $iColorsWebp = 0 If IsDllStruct($tMem) Then _GUICtrlStatusBar_SetText($StatusBar, "WebP size: " & Round($tMem.memsize / 1024, 2) & " kb / encoded in " & Round($end, 2) & " ms.") $hHBitmap = WebP_BitmapCreateGDIpFromMem($tMem.pMemData, $tMem.memsize, True, BitAND(GUICtrlRead($chkbCountColors), $GUI_CHECKED)) If @error Then Return MsgBox($MB_ICONERROR, "ERROR", "Unable to compress image", 30, $hGUI) $iColorsWebp = @extended GUICtrlSetData($ipColorWebP, $iColorsWebp) If BitAND(GUICtrlRead($chkbCountColors), $GUI_CHECKED) And GUICtrlRead($ipColorOriginal) = "0" Then GUICtrlSetData($ipColorOriginal, BitmapCountColors($hImage_tmp)) ;~ ConsoleWrite("WebP image color count: " & @extended & @CRLF) Local $aTaskbar = WinGetPos("[CLASS:Shell_TrayWnd;INSTANCE:1]", ""), $tbw = 0, $tbh = 0 If $aTaskbar[2] > $aTaskbar[3] Then $tbh = $aTaskbar[3] ELse $tbw = $aTaskbar[2] EndIf Local Const $minw = 384, $minh = $minw * 10 / 16 Local $maxw = Min($aDim[0] + $dw, @DesktopWidth * 0.95), $maxh = Min($aDim[1] + $dh, @DesktopHeight * 0.95), $iNewW = 0, $iNewH = 0 If $aDim[0] + $dw > @DesktopWidth * 0.95 Or $aDim[1] + $dh > @DesktopHeight * 0.95 Then $bBigger = True Else $bBigger = False EndIf If $bNew Then $iNewW = Max($minw, $maxw) $iNewH = Max($minh, $maxh) WinMove($hGUI_Image, "", (@DesktopWidth - $iNewW - (@DesktopWidth - $iW > $iNewW ? $iW : 0)) / 2 - $tbw, (@DesktopHeight - $iNewH - $tbh) / 2, $iNewW, $iNewH) WinSetTitle($hGUI_Image, "", StringRegExpReplace($sFileLoad, ".+\\(.*)", "$1") & " / " & $aDim[0] & "x" & $aDim[1] & " px / " & $sFormat & " / " & Round(FileGetSize($sFileLoad) / 1024, 2) & " kb") $iNewH -= $dh ;_WinAPI_GetSystemMetrics($SM_CXBORDER) + _WinAPI_GetSystemMetrics($SM_CYSIZE) + _WinAPI_GetSystemMetrics($SM_CXPADDEDBORDER) * 2 $iMPx_p = ($iNewW - $aDim[0]) / 2 $iMPy_p = ($iNewH - $aDim[1] - 4) / 2 $iResetPosX = $iMPx_p $iResetPosY = $iMPy_p GUICtrlSetPos($iPic_WebP, $iMPx_p, $iMPy_p, $iNewW - 1, $iNewH - 1) $bNew = False EndIf _WinAPI_DeleteObject(GUICtrlSendMsg($iPic_WebP, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap)) Local Const $iWC_State = WinGetState($hGUI_Image) If $iWC_State <> 7 Or $iWC_State <> 5 Then WinSetState($hGUI_Image, "", @SW_SHOW) WinActivate($hGUI_Image) EndIf WinActivate($hGUI) Else MsgBox($MB_ICONERROR, "ERROR", "DLL encode error " & $tMem, 30) EndIf EndFunc ;==>CompressAndDisplay Func Progress($progress, $ptr) ToolTip($progress & "%", MouseGetPos(0) - 40, MouseGetPos(1)) Return 1 EndFunc Func WM_HSCROLL($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $wParam Switch $lParam Case $hslAlpha_Filtering GUICtrlSetData($ipAlpha_Filtering, GUICtrlRead($slAlpha_Filtering)) Case $hslAlpha_Quality GUICtrlSetData($ipAlpha_Quality, GUICtrlRead($slAlpha_Quality)) Case $hslFilter_Sharpness GUICtrlSetData($ipFilter_Sharpness, GUICtrlRead($slFilter_Sharpness)) Case $hslFilter_Strength GUICtrlSetData($ipFilter_Strength, GUICtrlRead($slFilter_Strength)) Case $hslLevel GUICtrlSetData($ipLevel, GUICtrlRead($slLevel)) Case $hslMethod GUICtrlSetData($ipMethod, GUICtrlRead($slMethod)) Case $hslNear_Lossless GUICtrlSetData($ipNear_Lossless, GUICtrlRead($slNear_Lossless)) Case $hslPass GUICtrlSetData($ipPass, GUICtrlRead($slPass)) Case $hslQuality GUICtrlSetData($ipQuality, GUICtrlRead($slQuality)) Case $hslSNS_Strength GUICtrlSetData($ipSSN_Strength, GUICtrlRead($slSNS_Strength)) EndSwitch Return "GUI_RUNDEFMSG" EndFunc ;==>WM_HSCROLL Func WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam) Local $i = 1 Local $aFileList = _WinAPI_DragQueryFileEx($wParam) Do If StringInStr(FileGetAttrib($aFileList[$i]), "D") Then _ArrayDelete($aFileList, $i) Else $i += 1 EndIf Until $i = UBound($aFileList) $aFileList[0] = UBound($aFileList) - 1 $sFileLoad = $aFileList[1] _WinAPI_DragFinish($wParam) LoadImage($sFileLoad) Return 0 EndFunc ;==>WM_DROPFILES# Func WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam) _SendMessage($hWnd, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) EndFunc ;==>_WM_LBUTTONDOWN Func WM_SYSCOMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $ilParam Switch BitAND($iwParam, 0x0000FFFF) Case $idAbout GUICtrlSendToDummy($iDummy_About) EndSwitch Return "GUI_RUNDEFMSG" EndFunc ;==>WM_SYSCOMMAND Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg Switch $iwParam Case 1 GUICtrlSendToDummy($iDummy_Return) Return 0 Case $idResetPicPos ResetImage() Return 0 Case $idResetValues GUICtrlSetData($slAlpha_Filtering, 1) GUICtrlSetData($ipAlpha_Filtering, 1) GUICtrlSetData($slAlpha_Quality, 100) GUICtrlSetData($ipAlpha_Quality, 100) GUICtrlSetData($slFilter_Sharpness, 0) GUICtrlSetData($ipFilter_Sharpness, 0) GUICtrlSetData($slFilter_Strength, 60) GUICtrlSetData($ipFilter_Strength, 60) GUICtrlSetData($slLevel, 6) GUICtrlSetData($ipLevel, 6) GUICtrlSetData($slMethod, 4) GUICtrlSetData($ipMethod, 4) GUICtrlSetData($slNear_Lossless, 60) GUICtrlSetData($ipNear_Lossless, 60) GUICtrlSetData($slPass, 6) GUICtrlSetData($ipPass, 6) GUICtrlSetData($slQuality, 75) GUICtrlSetData($ipQuality, 75) GUICtrlSetData($slSNS_Strength, 50) GUICtrlSetData($ipSSN_Strength, 50) GUICtrlSetData($ipTarget_Size, 0) GUICtrlSetState($chkbAlpha_Compression, $GUI_CHECKED) GUICtrlSetState($chkbLossless, $GUI_UNCHECKED) _SendMessage($hcbPreset, $CB_SETCURSEL, 0) Return 0 EndSwitch Return "GUI_RUNDEFMSG" EndFunc ;==>WM_COMMAND Func WM_CONTEXTMENU($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Switch $hWnd Case $hGUI Local $hMenu $hMenu = _GUICtrlMenu_CreatePopup() _GUICtrlMenu_InsertMenuItem($hMenu, 0, "Reset values to default", $idResetValues) If $bBigger Then _GUICtrlMenu_InsertMenuItem($hMenu, 1, 0) _GUICtrlMenu_InsertMenuItem($hMenu, 2, "Reset image position", $idResetPicPos) EndIf _GUICtrlMenu_TrackPopupMenu($hMenu, $wParam) _GUICtrlMenu_DestroyMenu($hMenu) Return True EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_CONTEXTMENU Func Max($a, $b) If $a > $b Then Return $a Return $b EndFunc Func Min($a, $b) If $a < $b Then Return $a Return $b EndFunc Func GDIPlus_About($iFontsize = 10, $dx = 0, $dy = 0, $iSpeed = 333, $sFont = "MV Boli") If @AutoItX64 = 0 Then Local $binSIDSound = _Chip_Sound() _SIDStartup() _SIDOpen($binSIDSound) EndIf Local Const $iWh = $iW / 2, $iHh = $iH / 2, $sTitle = "GDI+ About Window" Local Const $fPi = ACos(-1), $fRad = $fPi / 180, $fDeg = 180 / $fPi #Region text Local $sText = _ "WebP Advanced Encoder GUI ²" & _ " " & $ver & " beta " & _ " " & $build & " " & _ " " & _ " Coded by UEZ ;-) " & _ " " & _ "Credits to: " & _ " " & _ "* Google for the WebP API " & _ " and static libraries " & _ "* wakillon for TichySID " & _ " and Stat-Mat for the DLL " & _ "* Soren Lund for SID Tune " & _ "* Ward for Mem call code " & _ " " & _ "-------------------------- " & _ " " & _ "Greetings fly out to: " & _ " " & _ " All Autoit users " & _ " around the globe " & _ " " & _ " " & _ " Press ESC to exit. " & _ " " & _ " " & _ "-------------------------- " & _ " " & _ "NO ..--+++--.. WAR " & _ " .-' | `-. " & _ " +' | `+ " & _ " ' | ` " & _ " ' | ` " & _ ": | :" & _ ": +'|`+ :" & _ ". +' | `+ ;" & _ " + +' | `+ + " & _ " `. +' | `+ .' " & _ " `._ | _.' " & _ "Peace `--.._|_..--' :-) " #EndRegion $bExit = False $hGUI_About = GUICreate($sTitle, $iW, $iH, 0, 0, $WS_POPUP, $WS_EX_NOPARENTNOTIFY, $hGUI) _WinAPI_SetParent($hGUI_About, $hGUI) WinSetTrans($hGUI_About, "", 0xD8) GUISetState(@SW_SHOWNA, $hGUI_About) ;create canvas elements Local Const $hDC = _WinAPI_GetDC($hGUI_About) Local Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $iW, $iH) Local Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) Local Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBitmap) Local Const $hCanvas = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) _GDIPlus_GraphicsSetSmoothingMode($hCanvas, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetPixelOffsetMode($hCanvas, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local Const $hBrush_Clr = _GDIPlus_HatchBrushCreate(18, 0xF0B0B0E0, 0xF0F0F0FF), _ $hBrush_FPS = _GDIPlus_BrushCreateSolid(0xF0808080), _ $hFormat_FPS = _GDIPlus_StringFormatCreate(), _ $hFamily_FPS = _GDIPlus_FontFamilyCreate("Arial"), _ $hFont_FPS = _GDIPlus_FontCreate($hFamily_FPS, 8), _ $tLayout_FPS = _GDIPlus_RectFCreate(0, 0, 100, 24) $iFPS = 0 GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_About") Local $iLen = StringLen($sText), $iColums = StringInStr($sText, "²"), $i, $u, $s, $r, $iChar_Space, $x, $y, $t = 0, $f, $b = 0, $a = 512, $iCharCol = 0x101030 $sText = StringReplace($sText, "²", " ") Local $aChars = StringSplit($sText, "", 2) Local $hFormat_char = _GDIPlus_StringFormatCreate(), $hFamily_char = _GDIPlus_FontFamilyCreate($sFont), $hFont_char = _GDIPlus_FontCreate($hFamily_char, $iFontsize, 1), _ $tLayout_char = _GDIPlus_RectFCreate(), $hBrush_char = _GDIPlus_BrushCreateSolid(0xFF000000 + $iCharCol) Local Const $iMilliSeconds = 5 AdlibRegister("CalcFPS", 1000) Do DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush_Clr, "float", 0, "float", 0, "float", $iW, "float", $iH) ;erase canvas background For $i = 0 To UBound($aChars) - 1 If $aChars[$i] <> " " Then $f = $t - $i / $iSpeed $s = $f > 2 ? 2 : $f $s = $s > 0 ? $s : 0 $r = (2 - $s) * $iColums * $iColums $iChar_Space = $s / 4.5 * $iColums $tLayout_char.x = $dx + $r / 2 * Sin($t + $i) + Mod($i, $iColums) * $iChar_Space $tLayout_char.y = $dy + $r / 3 * Cos($t + $i) + Int($i / $iColums) * $iChar_Space * 1.3333 DllCall($__g_hGDIPDll, "int", "GdipDrawString", "handle", $hCanvas, "wstr", $aChars[$i], "int", -1, "handle", $hFont_char, "struct*", $tLayout_char, "handle", $tLayout_char, "handle", $hBrush_char) EndIf Next $t += 0.025 DllCall($__g_hGDIPDll, "int", "GdipDrawString", "handle", $hCanvas, "wstr", "FPS: " & $iShowFPS, "int", -1, "handle", $hFont_FPS, "struct*", $tLayout_FPS, "handle", $hFormat_FPS, "handle", $hBrush_FPS) DllCall("gdi32.dll", "bool", "BitBlt", "handle", $hDC, "int", 0, "int", 0, "int", $iW, "int", $iH, "handle", $hDC_backbuffer, "int", 0, "int", 0, "dword", $SRCCOPY) $iFPS += 1 If $bExit Then ExitLoop If $r = 0 Then $b = 1 If $b Then $a -= 5 If $a < 256 Then DllCall($__g_hGDIPDll, "int", "GdipSetSolidFillColor", "handle", $hBrush_char, "dword", BitShift(Max(0, $a), -24) + $iCharCol) If $a <= -50 Then $b = 0 $a = 384 DllCall($__g_hGDIPDll, "int", "GdipSetSolidFillColor", "handle", $hBrush_char, "dword", 0xFF000000 + $iCharCol) $t = 0 EndIf EndIf DllCall($_KERNEL32DLL, "dword", "SleepEx", "dword", $iMilliSeconds, "bool", True) Until False AdlibUnRegister("CalcFPS") ;release resources _GDIPlus_FontDispose($hFont_char) _GDIPlus_FontFamilyDispose($hFamily_char) _GDIPlus_StringFormatDispose($hFormat_char) _GDIPlus_BrushDispose($hBrush_char) _GDIPlus_FontDispose($hFont_FPS) _GDIPlus_FontFamilyDispose($hFamily_FPS) _GDIPlus_StringFormatDispose($hFormat_FPS) _GDIPlus_BrushDispose($hBrush_Clr) _GDIPlus_BrushDispose($hBrush_FPS) _GDIPlus_GraphicsDispose($hCanvas) _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_DeleteDC($hDC_backbuffer) _WinAPI_DeleteObject($hHBitmap) _WinAPI_ReleaseDC($hGUI_About, $hDC) GUIDelete($hGUI_About) If @AutoItX64 = 0 Then _SIDStop() _SIDClose() _SIDShutdown() $binSIDSound = 0 EndIf EndFunc ;==>GDIPlus_About Func _Exit_About() $bExit = True EndFunc ;==>_Exit_About Func CalcFPS() ;display FPS $iShowFPS = $iFPS $iFPS = 0 EndFunc ;==>CalcFPS Func _GDIPlus_GraphicsGetDPIRatio($iDPIDef = 96) Local $hGfx = _GDIPlus_GraphicsCreateFromHWND(0) If @error Then Return SetError(1, @extended, 0) Local $aResult = DllCall($__g_hGDIPDll, "int", "GdipGetDpiX", "handle", $hGfx, "float*", 0) If @error Then Return SetError(2, @extended, 0) Local $iDPI = $aResult[2] _GDIPlus_GraphicsDispose($hGfx) Local $aResults[2] = [$iDPIDef / $iDPI, $iDPI / $iDPIDef] Return $aResults EndFunc ;==>_GDIPlus_GraphicsGetDPIRatio Func _WinAPI_GetDpiForMonitor($dpiType = $MDT_DEFAULT, $iDPIDef = 96) Local $aMonitors = _WinAPI_EnumDisplayMonitors() Local $x, $y Local $aRet = DllCall("Shcore.dll", "long", "GetDpiForMonitor", "long", $aMonitors[1][0], "int", $dpiType, "uint*", $x, "uint*", $y) If @error Or Not IsArray($aRet) Then Return SetError(1, 0, 0) Local $aDPI[2] = [$iDPIDef / $aRet[3], $aRet[3] / $iDPIDef] Return $aDPI EndFunc ;==>_WinAPI_GetDpiForMonitor Func _WinAPI_SetDPIAwareness($hGUI = 0) Switch @OSBuild Case 6000 To 9199 If Not DllCall("user32.dll", "bool", "SetProcessDPIAware") Then Return SetError(1, 0, 0) Return 1 Case 9200 To 13999 _WinAPI_SetProcessDpiAwareness($PROCESS_PER_MONITOR_DPI_AWARE) If @error Then Return SetError(1, 0, 0) Return 1 Case @OSBuild > 13999 #cs Context_Unaware = ((DPI_AWARENESS_CONTEXT)(-1)), Context_SystemAware = ((DPI_AWARENESS_CONTEXT)(-2)), Context_PerMonitorAware = ((DPI_AWARENESS_CONTEXT)(-3)), Context_PerMonitorAwareV2 = ((DPI_AWARENESS_CONTEXT)(-4)), Context_UnawareGdiScaled = ((DPI_AWARENESS_CONTEXT)(-5)) #ce _WinAPI_SetProcessDpiAwarenessContext($Context_PerMonitorAwareV2, $hGUI) If @error Then Return SetError(3, @error, 0) Return 1 EndSwitch Return -1 EndFunc ;==>_WinAPI_SetDPIAwareness Func _WinAPI_SetProcessDpiAwareness($DPIAware) ;https://docs.microsoft.com/en-us/windows/desktop/api/shellscalingapi/nf-shellscalingapi-setprocessdpiawareness DllCall("Shcore.dll", "long", "SetProcessDpiAwareness", "int", $DPIAware) If @error Then Return SetError(1, 0, 0) Return 1 EndFunc ;==>_WinAPI_SetProcessDpiAwareness ;https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setprocessdpiawarenesscontext Func _WinAPI_SetProcessDpiAwarenessContext($DPIAwareContext = $Context_PerMonitorAware, $hGUI = 0, $iMode = 1) ;https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setprocessdpiawarenesscontext $DPIAwareContext = ($DPIAwareContext < -5) ? -5 : ($DPIAwareContext > -1) ? -1 : $DPIAwareContext $iMode = ($iMode < 1) ? 1 : ($iMode > 3) ? 3 : $iMode Switch $iMode Case 1 Local $hDC = _WinAPI_GetDC($hGUI) Local $aResult1 = DllCall("user32.dll", "ptr", "GetDpiFromDpiAwarenessContext", "ptr", $hDC) If @error Or Not IsArray($aResult1) Then Return SetError(11, 0, 0) _WinAPI_ReleaseDC(0, $hDC) Local $aResult = DllCall("user32.dll", "Bool", "SetProcessDpiAwarenessContext", "int", $aResult1[0] + $DPIAwareContext) If @error Or Not IsArray($aResult) Then Return SetError(12, 0, 0) Case 2 ;~ If Not $hGUI Then $hGUI = WinGetHandle(AutoItWinGetTitle()) Local $aResult2 = DllCall("user32.dll", "int", "GetWindowDpiAwarenessContext", "ptr", $hGUI) If @error Or Not IsArray($aResult2) Then Return SetError(21, 0, 0) Local $aResult = DllCall("user32.dll", "Bool", "SetProcessDpiAwarenessContext", "int", $aResult2[0] + $DPIAwareContext) If @error Or Not IsArray($aResult) Then Return SetError(22, 0, 0) Case 3 Local $aResult31 = DllCall("user32.dll", "ptr", "GetThreadDpiAwarenessContext") If @error Or Not IsArray($aResult31) Then Return SetError(31, 0, 0) Local $aResult32 = DllCall("user32.dll", "ptr", "GetAwarenessFromDpiAwarenessContext", "ptr", $aResult31[0]) If @error Or Not IsArray($aResult32) Then Return SetError(32, 0, 0) Local $aResult = DllCall("user32.dll", "Bool", "SetThreadDpiAwarenessContext", "int", $aResult32[0] + $DPIAwareContext) If @error Or Not IsArray($aResult) Then Return SetError(33, 0, 0) EndSwitch Return 1 EndFunc ;==>_WinAPI_SetProcessDpiAwarenessContext ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2020-06-05 Func _Chip_Sound($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Chip_Sound $Chip_Sound &= 'UFNJRAACAHwAABAAEAMAAQABAAAAAENvbW1vZG9yZSA2NAAAAAAAAAAAAAAAAAAAAAAAAAAAU/hyZW4gTHVuZCAoSmVmZikAAAAAAAAAAAAAAAAAAAAyMDA0IFZpcnV6L0NhbWVsb3QAAAAAAAAAAAAAAAAAAAAUAAAAAAAQTH0RTOoRTA0SrZaJkpWarS0oAykgCgUGBi8WCRIVGi0BAAAAAAAAAAABAQEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFic4S19ziqG61PAOLU5xlr3nE0J0qeAbWpviLHvOJ4XoUcE3tDfEV/WcTgnQo4JuaG6Ir+s5nBOhRgTc0NwQXtZyOCZCjAi4oLggvKzkcEyEGBBwQHBAeFjI4JgIMCAuAQEBAQEBAQEBAQECAgICAgICAwMDAwMEBAQEBQUFBgYGBwcICAkJC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Pt1/mv7vGP7b/7/l2MAZ/6VYAq6bvtr/rtn/rxj/pprAP+SYCe3Yvtj/mAjt2L7Y/6WYC63Yvtj/mAqt2L7Y/6TYCe3avty/rlg/v+bYCe+YvuSYCe3Yvtj/mAjt2L7Y/6WYC63Yvtj/mAqt2L7Y/6TYCe3cvtn/v+XYQCYYCL8J/wu/CL8KfwulwD8+5gq/CX8J/wq/Cz8J/+eYBjAYvvBY/vC+8Nn+8Rj+8X7xvtgSshi+8dgSsj+Sshi+8dgSsj+nxvJavvKYD9m+/+eYBjAYvvBY/vC+8Nn+8Rj+8X7y2H7zPtgSshi+8dgSsj+Sshi+8dgSsj+nz/KYvuXYwCHYQCQYwAAhWEA/w==' Local $bString = _WinAPI_Base64Decode($Chip_Sound) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Commodore_64.sid", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Chip_Sound Func _WebP_Icon($bSaveBinary = False, $sSavePath = @ScriptDir) Local $WebP_Icon $WebP_Icon &= 'iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAMkElEQVR4XsRZe3BU1Rn/vnPvPpNsdsnCIgkkFogoElIpFAMZmUIC5SVpBcb6ACMNFAYUi5RRKUgFNWTEDgyKBEHoA4y1ZkKxHQYspfJ0SpGEplIeCXntJvtIsu+993yF3EDGMs3eO67hd3fuP/fuOb/f9zrfOReoV8TkGBFdrwvo7oXFi5bNmjN59pzJi55dZh4OX5y91P3CXQUDFeAxZu0HhSu8BUtbpyxu/eFz3nsyIRZWnsG3BM5VDR1HgMJPFA16PdizojZHxOaI9ssM2NLAZuvX9UiEbweMqTJub9MTkcKvualRFwJPS9DvFUHGtuZrDsz+5Usbc76b7XL7BCYAECQIBKBnzO1vnD+3qKAwX3FFL2KQiP7/UAgAH+4/WLx81urSSdljfX6PBMBMKf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8fHJyMuGjo6NqNb1eL7Wd2NhY4Drdx6/cUh6bxJM/AhSiW+Xp7x88Ngrl5s5CVVWVFKmkpCRKk3ehkJmZiZGyore3l9edYoxxenqaaloq2aOjI9SGxWJBZ9jc3MT65Ofnt7e3R0REqNWoT7A/vEO97/KQLrv4e/DOR4LoPUjehDO5uLhIFigjrFar4FCRBmqXI41yIb6iogLM+fm5tAIoXEYclGBubi547nIgNzc34AUF+eDPLMqjn8XTEfHr8Pfnx0rHYPWzMZH+7xRKT0+XLPj4+AAvKioSEDiLcnJyMGZkZBC4trZGorZei4uLgaDHSQ4MDw8DRyNmB/z8/KS5Ozs7UhE3dZUU' $WebP_Icon &= 'dYoCg0jWiy8N4qtO1yedn7MFnU4nWTg9PSUL2H8EtgYqDqpdOrqoQ5iQkICxpaXF7i5bWloKXtuapMeDZmdngeClX+scKVSEzYTDyhburHh6emrtokB5/5L2y8PDQ2GPuJuxk2j/7BvTxcWFeuPSbs1SW6uvr5csoPygILg/nJycxMXFIQc40rR1p6Sk9PT0EKil5eVlbIVYh8bGRpwpJAX04tTUVOIRv9ra2vLy8oGBAefOOXJfRnNDk0DL6ejokA5z941kB8bGxv7722msAxF4B6D0K05KGJl3MJ01mXGS+F6BAzmbZQv3eQXkG4Xdi4RQ7jehbOCAgyP3P94Red6jcQCLAAAAAElFTkSuQmCC' Local $bString = _WinAPI_Base64Decode($WebP_Icon) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\WebP_logo_2010_64x64_Simo99.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_WebP_Icon Func _WinAPI_Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_WinAPI_Base64Decode #Region TichySID Func _SIDClose() Local $aRet = MemoryDllCall($hTitchysidDll, 'int', 'SIDClose') If @error Then Return SetError(@error, 0, 0) Return $aRet[0] EndFunc ;==>_SIDClose Func _SIDOpen($Sid, $iSubsong = 1) Local $bSid If Not IsBinary($Sid) Then If Not FileExists($Sid) Then Return SetError(2, 0, 0) Local $hFileOpen = FileOpen($Sid, 0) If $hFileOpen = -1 Then Return SetError(-1, 0, 0) $bSid = FileRead($hFileOpen) FileClose($hFileOpen) Else $bSid = $Sid EndIf Local $tSid = DllStructCreate('byte[' & BinaryLen($bSid) & ']') DllStructSetData($tSid, 1, $bSid) Local $sType = BinaryToString(BinaryMid($bSid, 1, 4), 1) ConsoleWrite('-->-- Sid File Type : ' & $sType & @CRLF) Local $iVersion = Execute(BinaryMid($bSid, 5, 2)) ConsoleWrite('-->-- Sid File Version : ' & $iVersion & @CRLF) $iSubsongCount = Int(StringTrimLeft(BinaryMid($bSid, 15, 2), 2)) ConsoleWrite('-->-- SubsongCount : ' & $iSubsongCount & @CRLF) $iSubsong = $iSubsong - 1 If $iSubsong < 0 Then $iSubsong = 0 If $iSubsong > $iSubsongCount Then $iSubsong = 0 ConsoleWrite('-->-- Subsong : ' & $iSubsong & @CRLF) Local $aRet = MemoryDllCall($hTitchysidDll, 'int', 'SIDOpen', 'ptr', DllStructGetPtr($tSid), 'int', DllStructGetSize($tSid), 'int', $SID_MEMORY, 'int', $SID_NON_DEFAULT, 'int', $iSubsong) If @error Then Return SetError(@error, 0, 0) $tSid = 0 $bSid = 0 Return $aRet[0] EndFunc ;==>_SIDOpen Func _SIDShutdown() MemoryDllClose($hTitchysidDll) $hTitchysidDll = 0 EndFunc ;==>_SIDShutdown Func _SIDStartup() $hTitchysidDll = MemoryDllOpen(TitchySIDdll()) If $hTitchysidDll = -1 Then Return SetError(1, 0, 0) Return SetError(0, 0, $hTitchysidDll) EndFunc ;==>_SIDStartup Func _SIDStop() Local $aRet = MemoryDllCall($hTitchysidDll, 'int', 'SIDStop') If @error Then Return SetError(@error, 0, 0) Return $aRet[0] EndFunc ;==>_SIDStop Func TitchySIDdll() ;only x86 :-( Local $sFileBin = 'cbsATVqQAAMAAACCBAAw//8AALgAOC0BAEAEOBkAsAAMDh8Aug4AtAnNIbgAAUzNIVRoaXMAIHByb2dyYW0AIGNhbm5vdCAAYmUgcnVuIGkAbiBET1MgbW+AZGUuDQ0KJASGADvpjpN/iODAQQUDg6jywHwAB/EQl/PAZQAHUmljBmgBFwVzUEUAAEyAAQQA9O0oVQUTAOAADiELAQUMpAASAAzMAgegEAADfjAECQELABoB5wEABQcA/iCAfgQGgxwAFIEVhgMDA2BgMgAAvoEDgCc84RmKEAMAnKCdDgCAK4JYGA8udGV4dIADftYBRoEBgXUGYgRlAE8uAHJkYXRhAAAeNwHqgX2BERaLE4DtQC5xAxMAW8NAPQF7AT8aAc4JwC5yZWxvY7gAAGjBB8A2whMczgn+QrE8PwA/AD8APwA/ADcAAFWL7IPE6FZXADPJvoRCABC/ASA5EOtzUQ+3RgACJf8PAADB4AAQiUcED7YVmwEAA9Pqg+IBiFcACQ+2TgXB6QRAiwSNCEAA4AMKDLpI4AChAoDhDw9AtwRKiUcOoAEGAaYBFg+2RgYk8ACJRxKKRgSIR0AID7cG9yXgRhAAiQdZQYPGB4MAxyyD+QNyiL+BYRAPtkcWweBgDgBPFYPhBwPB90QlBCAFuQCAoIXBAHYBkYlHGTPJCLEE64AKRxjT6ACD4AGA+Qd1AwCD8AGIRDkZQQCD+Qhy5WaD5gAPiXchuD0KAAIAAAkXwOkE9+EAuTMzAQAryMEA6QiJTy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uOFYTMABxAAT0AAh0ABYAJTg4KiUzOBerMABxAAXwADhwAAl0AIQYJnAAJi84EjAAKhUwAAb0AAx0ABk1oXAANTQ4IjAAFTAACgf0AA10ADgPODiAEQ8QOB84I3IAIgD0ACQPGrIBLSsiLDIAISsdcgABKxEzAQ4rHnIAMjA4QTAAKDggMBtyAAIV8AA4cAAKdAAxNjhBMAApOBw2N3IAAxXwADhwAAt0AGvdMwDTi9kA0HrdTcDUK90d0WD8AP0BFfMADPYAaPYBRNUrStnwANj5ABHS+AHUT/IB/AD1HtEyRKywWLEuAjAzgHIgAGhwAQswABAwKTA/MEcwAHswjzClMBIxAFkxCTK8MvIyAIAzjTO+M/MzAA40XDShNCQ2AEo2dTadNqI2AKs2uDbINvI2AAc3Ejc9PJM8AME82jwqPUg9AE49kz34PQU+ACU+1z5MP3Y/sJ4/uj8ABkAmNGAAAgRwBiAwbDByMAB4MH4whDCKMACQMJYwnDCiMACoMK4wtDC6MIDAMMYwzDDSP2H/DwAPAA8ADwAPAA8ADwAPAP8PAA8ADwAPAA8ADwAPAA8A/w8ADwAPAA8ADwAPAA8ADwD/DwAPAA8ADwAPAA8ADwAPAP8PAA8ADwAPAA8ADwAPAA8A/w8ADwAPAA8ADwAPAA8ABAA=' $sFileBin = Binary(_WinAPI_Base64Decode($sFileBin)) $sFileBin = Binary(_LzntDecompress($sFileBin)) Return SetError(0, 0, $sFileBin) EndFunc ;==>TitchySIDdll Func _LzntDecompress($bBinary) $bBinary = Binary($bBinary) Local $tInput = DllStructCreate('byte[' & BinaryLen($bBinary) & ']') DllStructSetData($tInput, 1, $bBinary) Local $tBuffer = DllStructCreate('byte[' & 16 * DllStructGetSize($tInput) & ']') Local $a_Call = DllCall('ntdll.dll', 'int', 'RtlDecompressBuffer', 'ushort', 2, 'ptr', DllStructGetPtr($tBuffer), 'dword', DllStructGetSize($tBuffer), 'ptr', DllStructGetPtr($tInput), 'dword', DllStructGetSize($tInput), 'dword*', 0) If @error Or $a_Call[0] Then Return SetError(1, 0, '') Local $tOutput = DllStructCreate('byte[' & $a_Call[6] & ']', DllStructGetPtr($tBuffer)) Return SetError(0, 0, DllStructGetData($tOutput, 1)) EndFunc ;==>_LzntDecompress Func API_FreeLibrary($Module) Local $Ret = DllCall($_KERNEL32DLL, 'bool', 'FreeLibrary', 'handle', $Module) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_FreeLibrary Func API_GetProcAddress($Module, $Procname) If IsNumber($Procname) Then Local $Ret = DllCall($_KERNEL32DLL, 'ptr', 'GetProcAddress', 'handle', $Module, 'int', $Procname) Else Local $Ret = DllCall($_KERNEL32DLL, 'ptr', 'GetProcAddress', 'handle', $Module, 'str', $Procname) EndIf If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_GetProcAddress Func API_IsBadReadPtr($Ptr, $Len) Local $Ret = DllCall($_KERNEL32DLL, 'int', 'IsBadReadPtr', 'ptr', $Ptr, 'UINT_PTR', $Len) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_IsBadReadPtr Func API_LoadLibrary($Filename) Local $Ret = DllCall($_KERNEL32DLL, 'handle', 'LoadLibraryW', 'wstr', $Filename) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_LoadLibrary Func API_lstrlenA($Address) Local $Ret = DllCall($_KERNEL32DLL, 'int', 'lstrlenA', 'ptr', $Address) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_lstrlenA Func API_lstrlenW($Address) Local $Ret = DllCall($_KERNEL32DLL, 'int', 'lstrlenW', 'ptr', $Address) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_lstrlenW Func API_VirtualProtect($Address, $Size, $Protection) Local $Ret = DllCall($_KERNEL32DLL, 'bool', 'VirtualProtect', 'ptr', $Address, 'dword_ptr', $Size, 'dword', $Protection, 'dword*', 0) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_VirtualProtect Func API_ZeroMemory($Address, $Size) Local $Ret = DllCall($_KERNEL32DLL, 'none', 'RtlZeroMemory', 'ptr', $Address, 'dword_ptr', $Size) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_ZeroMemory Func MemLib_BuildImportTable($CodeBase, $PEHeader) Local Const $IMAGE_DIRECTORY_ENTRY_IMPORT = 1 Local Const $SizeOfPtr = DllStructGetSize(DllStructCreate('ptr', 1)) Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfDataDirectory = DllStructGetSize(DllStructCreate($tagIMAGE_DATA_DIRECTORY)) Local $ImportDirectoryPtr = $PEHeader + DllStructGetSize($IMAGE_NT_HEADER) + $IMAGE_DIRECTORY_ENTRY_IMPORT * $SizeOfDataDirectory Local $ImportDirectory = DllStructCreate($tagIMAGE_DATA_DIRECTORY, $ImportDirectoryPtr) Local $ImportSize = DllStructGetData($ImportDirectory, 'Size') Local $ImportVirtualAddress = DllStructGetData($ImportDirectory, 'VirtualAddress') Local $SizeOfImportDir = DllStructGetSize(DllStructCreate($tagIMAGE_IMPORT_DESCRIPTOR)) Local $ImportList = '' If $ImportSize > 0 Then Local $ImportDescPtr = $CodeBase + $ImportVirtualAddress While 1 If API_IsBadReadPtr($ImportDescPtr, $SizeOfImportDir) Then ExitLoop Local $ImportDesc = DllStructCreate($tagIMAGE_IMPORT_DESCRIPTOR, $ImportDescPtr) Local $NameOffset = DllStructGetData($ImportDesc, 'Name') If $NameOffset = 0 Then ExitLoop Local $Name = Peek('str', $CodeBase + $NameOffset) Local $OriginalFirstThunk = DllStructGetData($ImportDesc, 'OriginalFirstThunk') Local $FirstThunk = DllStructGetData($ImportDesc, 'FirstThunk') Local $Handle = API_LoadLibrary($Name) If $Handle Then $ImportList &= $Handle & ',' Local $FuncRef = $CodeBase + $FirstThunk Local $ThunkRef = $CodeBase + $OriginalFirstThunk If $OriginalFirstThunk = 0 Then $ThunkRef = $FuncRef While 1 Local $Ref = Peek('ptr', $ThunkRef) If $Ref = 0 Then ExitLoop If BitAND(Peek('byte', $ThunkRef + $SizeOfPtr - 1), 0x80) Then Local $Ptr = API_GetProcAddress($Handle, BitAND($Ref, 0xffff)) Else Local $IMAGE_IMPORT_BY_NAME = DllStructCreate($tagIMAGE_IMPORT_BY_NAME, $CodeBase + $Ref) Local $NamePtr = DllStructGetPtr($IMAGE_IMPORT_BY_NAME, 2) Local $FuncName = Peek('str', $NamePtr) Local $Ptr = API_GetProcAddress($Handle, $FuncName) EndIf If $Ptr = 0 Then Return SetError(1, 0, False) Poke('ptr', $FuncRef, $Ptr) $ThunkRef += $SizeOfPtr $FuncRef += $SizeOfPtr WEnd Else Return SetError(1, 0, False) EndIf $ImportDescPtr += $SizeOfImportDir WEnd EndIf Return $ImportList EndFunc ;==>MemLib_BuildImportTable Func MemLib_CopySections($CodeBase, $PEHeader, $DllDataPtr) Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfFileHeader = DllStructGetPtr($IMAGE_NT_HEADER, 'Magic') - $PEHeader Local $SizeOfOptionalHeader = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfOptionalHeader') Local $NumberOfSections = DllStructGetData($IMAGE_NT_HEADER, 'NumberOfSections') Local $SectionAlignment = DllStructGetData($IMAGE_NT_HEADER, 'SectionAlignment') Local $SectionPtr = $PEHeader + $SizeOfFileHeader + $SizeOfOptionalHeader For $i = 1 To $NumberOfSections Local $Section = DllStructCreate($tagIMAGE_SECTION_HEADER, $SectionPtr) Local $VirtualAddress = DllStructGetData($Section, 'VirtualAddress') Local $SizeOfRawData = DllStructGetData($Section, 'SizeOfRawData') Local $PointerToRawData = DllStructGetData($Section, 'PointerToRawData') If $SizeOfRawData = 0 Then Local $Dest = _MemVirtualAlloc($CodeBase + $VirtualAddress, $SectionAlignment, $MEM_COMMIT, $PAGE_READWRITE) API_ZeroMemory($Dest, $SectionAlignment) Else Local $Dest = _MemVirtualAlloc($CodeBase + $VirtualAddress, $SizeOfRawData, $MEM_COMMIT, $PAGE_READWRITE) _MemMoveMemory($DllDataPtr + $PointerToRawData, $Dest, $SizeOfRawData) EndIf DllStructSetData($Section, 'VirtualSize', $Dest - $CodeBase) $SectionPtr += DllStructGetSize($Section) Next EndFunc ;==>MemLib_CopySections Func MemLib_FinalizeSections($CodeBase, $PEHeader) Local Const $IMAGE_SCN_MEM_EXECUTE = 0x20000000 Local Const $IMAGE_SCN_MEM_READ = 0x40000000 Local Const $IMAGE_SCN_MEM_WRITE = 0x80000000 Local Const $IMAGE_SCN_MEM_NOT_CACHED = 0x4000000 Local Const $IMAGE_SCN_CNT_INITIALIZED_DATA = 64 Local Const $IMAGE_SCN_CNT_UNINITIALIZED_DATA = 128 Local Const $PAGE_WRITECOPY = 0x0008 Local Const $PAGE_EXECUTE_WRITECOPY = 0x0080 Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfFileHeader = DllStructGetPtr($IMAGE_NT_HEADER, 'Magic') - $PEHeader Local $SizeOfOptionalHeader = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfOptionalHeader') Local $NumberOfSections = DllStructGetData($IMAGE_NT_HEADER, 'NumberOfSections') Local $SectionAlignment = DllStructGetData($IMAGE_NT_HEADER, 'SectionAlignment') Local $SectionPtr = $PEHeader + $SizeOfFileHeader + $SizeOfOptionalHeader For $i = 1 To $NumberOfSections Local $Section = DllStructCreate($tagIMAGE_SECTION_HEADER, $SectionPtr) Local $Characteristics = DllStructGetData($Section, 'Characteristics') Local $SizeOfRawData = DllStructGetData($Section, 'SizeOfRawData') Local $Executable = (BitAND($Characteristics, $IMAGE_SCN_MEM_EXECUTE) <> 0) Local $Readable = (BitAND($Characteristics, $IMAGE_SCN_MEM_READ) <> 0) Local $Writeable = (BitAND($Characteristics, $IMAGE_SCN_MEM_WRITE) <> 0) Local $ProtectList[8] = [$PAGE_NOACCESS, $PAGE_EXECUTE, $PAGE_READONLY, $PAGE_EXECUTE_READ, $PAGE_WRITECOPY, $PAGE_EXECUTE_WRITECOPY, $PAGE_READWRITE, $PAGE_EXECUTE_READWRITE] Local $Protect = $ProtectList[$Executable + $Readable * 2 + $Writeable * 4] If BitAND($Characteristics, $IMAGE_SCN_MEM_NOT_CACHED) Then $Protect = BitOR($Protect, $PAGE_NOCACHE) Local $Size = $SizeOfRawData If $Size = 0 Then If BitAND($Characteristics, $IMAGE_SCN_CNT_INITIALIZED_DATA) Then $Size = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfInitializedData') ElseIf BitAND($Characteristics, $IMAGE_SCN_CNT_UNINITIALIZED_DATA) Then $Size = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfUninitializedData') EndIf EndIf If $Size > 0 Then Local $PhysicalAddress = $CodeBase + DllStructGetData($Section, 'VirtualSize') API_VirtualProtect($PhysicalAddress, $Size, $Protect) EndIf $SectionPtr += DllStructGetSize($Section) Next EndFunc ;==>MemLib_FinalizeSections Func MemLib_FreeLibrary($ModulePtr) If Not MemLib_Vaild($ModulePtr) Then Return 0 Local $Module = DllStructCreate($tagModule, $ModulePtr) Local $CodeBase = DllStructGetData($Module, 'CodeBase') Local $DllEntry = DllStructGetData($Module, 'DllEntry') Local $Initialized = DllStructGetData($Module, 'Initialized') Local $ImportListPtr = DllStructGetData($Module, 'ImportList') Local $ExportListPtr = DllStructGetData($Module, 'ExportList') If $Initialized And $DllEntry Then Local $Success = MemoryFuncCall('bool', $DllEntry, 'ptr', $CodeBase, 'dword', 0, 'ptr', 0) DllStructSetData($Module, 'Initialized', 0) EndIf If $ExportListPtr Then _MemGlobalFree($ExportListPtr) If $ImportListPtr Then Local $ImportList = StringSplit(Peek('str', $ImportListPtr), ',') For $i = 1 To $ImportList[0] If $ImportList[$i] Then API_FreeLibrary($ImportList[$i]) Next _MemGlobalFree($ImportListPtr) EndIf If $CodeBase Then _MemVirtualFree($CodeBase, 0, $MEM_RELEASE) DllStructSetData($Module, 'CodeBase', 0) DllStructSetData($Module, 'ExportList', 0) _MemGlobalFree($ModulePtr) Return 1 EndFunc ;==>MemLib_FreeLibrary Func MemLib_GetExportList($CodeBase, $PEHeader) Local Const $IMAGE_DIRECTORY_ENTRY_EXPORT = 0 Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfDataDirectory = DllStructGetSize(DllStructCreate($tagIMAGE_DATA_DIRECTORY)) Local $ExportDirectoryPtr = $PEHeader + DllStructGetSize($IMAGE_NT_HEADER) + $IMAGE_DIRECTORY_ENTRY_EXPORT * $SizeOfDataDirectory Local $ExportDirectory = DllStructCreate($tagIMAGE_DATA_DIRECTORY, $ExportDirectoryPtr) Local $ExportSize = DllStructGetData($ExportDirectory, 'Size') Local $ExportVirtualAddress = DllStructGetData($ExportDirectory, 'VirtualAddress') Local $ExportList = '' If $ExportSize > 0 Then Local $IMAGE_EXPORT_DIRECTORY = DllStructCreate($tagIMAGE_EXPORT_DIRECTORY, $CodeBase + $ExportVirtualAddress) Local $NumberOfNames = DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'NumberOfNames') Local $NumberOfFunctions = DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'NumberOfFunctions') Local $AddressOfFunctions = DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'AddressOfFunctions') If $NumberOfNames = 0 Or $NumberOfFunctions = 0 Then Return '' Local $NameRef = $CodeBase + DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'AddressOfNames') Local $Ordinal = $CodeBase + DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'AddressOfNameOrdinals') For $i = 1 To $NumberOfNames Local $Ref = Peek('dword', $NameRef) Local $Idx = Peek('word', $Ordinal) Local $FuncName = Peek('str', $CodeBase + $Ref) If $Idx <= $NumberOfFunctions Then Local $Addr = $CodeBase + Peek('dword', $CodeBase + $AddressOfFunctions + $Idx * 4) $ExportList &= $FuncName & Chr(1) & $Addr & Chr(1) EndIf $NameRef += 4 $Ordinal += 2 Next EndIf Return $ExportList EndFunc ;==>MemLib_GetExportList Func MemLib_GetProcAddress($ModulePtr, $FuncName) Local $ExportPtr = Peek('ptr', $ModulePtr) If Not $ExportPtr Then Return 0 Local $ExportList = Peek('str', $ExportPtr) Local $Match = StringRegExp($ExportList, '(?i)' & $FuncName & '\001([^\001]*)\001', 3) If Not @error Then Return Ptr($Match[0]) Return 0 EndFunc ;==>MemLib_GetProcAddress Func MemLib_LoadLibrary($DllBinary) $DllBinary = Binary($DllBinary) Local $DllData = DllStructCreate('byte[' & BinaryLen($DllBinary) & ']') Local $DllDataPtr = DllStructGetPtr($DllData) DllStructSetData($DllData, 1, $DllBinary) Local $IMAGE_DOS_HEADER = DllStructCreate($tagIMAGE_DOS_HEADER, $DllDataPtr) If DllStructGetData($IMAGE_DOS_HEADER, 'e_magic') <> 0x5A4D Then Return SetError(1, 0, 0) EndIf Local $PEHeader = $DllDataPtr + DllStructGetData($IMAGE_DOS_HEADER, 'e_lfanew') Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) If DllStructGetData($IMAGE_NT_HEADER, 'Signature') <> 0x4550 Then Return SetError(1, 0, 0) EndIf Switch DllStructGetData($IMAGE_NT_HEADER, 'Magic') Case 0x10B If @AutoItX64 Then Return SetError(2, 0, 0) Case 0x20B If Not @AutoItX64 Then Return SetError(2, 0, 0) EndSwitch Local $ImageBase = DllStructGetData($IMAGE_NT_HEADER, 'ImageBase') Local $SizeOfImage = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfImage') Local $SizeOfHeaders = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfHeaders') Local $AddressOfEntryPoint = DllStructGetData($IMAGE_NT_HEADER, 'AddressOfEntryPoint') Local $ModulePtr = _MemGlobalAlloc(DllStructGetSize(DllStructCreate($tagModule)), $GPTR) If $ModulePtr = 0 Then Return SetError(3, 0, 0) Local $Module = DllStructCreate($tagModule, $ModulePtr) Local $CodeBase = _MemVirtualAlloc($ImageBase, $SizeOfImage, $MEM_RESERVE, $PAGE_READWRITE) If $CodeBase = 0 Then $CodeBase = _MemVirtualAlloc(0, $SizeOfImage, $MEM_RESERVE, $PAGE_READWRITE) If $CodeBase = 0 Then Return SetError(3, 0, 0) DllStructSetData($Module, 'CodeBase', $CodeBase) _MemVirtualAlloc($CodeBase, $SizeOfImage, $MEM_COMMIT, $PAGE_READWRITE) Local $Base = _MemVirtualAlloc($CodeBase, $SizeOfHeaders, $MEM_COMMIT, $PAGE_READWRITE) _MemMoveMemory($DllDataPtr, $Base, $SizeOfHeaders) MemLib_CopySections($CodeBase, $PEHeader, $DllDataPtr) Local $LocationDelta = $CodeBase - $ImageBase If $LocationDelta <> 0 Then MemLib_PerformBaseRelocation($CodeBase, $PEHeader, $LocationDelta) Local $ImportList = MemLib_BuildImportTable($CodeBase, $PEHeader) If @error Then MemLib_FreeLibrary($ModulePtr) Return SetError(2, 0, 0) EndIf Local $ExportList = MemLib_GetExportList($CodeBase, $PEHeader) Local $ImportListPtr = _MemGlobalAlloc(StringLen($ImportList) + 2, $GPTR) Local $ExportListPtr = _MemGlobalAlloc(StringLen($ExportList) + 2, $GPTR) DllStructSetData($Module, 'ImportList', $ImportListPtr) DllStructSetData($Module, 'ExportList', $ExportListPtr) If $ImportListPtr = 0 Or $ExportListPtr = 0 Then MemLib_FreeLibrary($ModulePtr) Return SetError(3, 0, 0) EndIf Poke('str', $ImportListPtr, $ImportList) Poke('str', $ExportListPtr, $ExportList) MemLib_FinalizeSections($CodeBase, $PEHeader) Local $DllEntry = $CodeBase + $AddressOfEntryPoint DllStructSetData($Module, 'DllEntry', $DllEntry) DllStructSetData($Module, 'Initialized', 0) If $AddressOfEntryPoint Then Local $Success = MemoryFuncCall('bool', $DllEntry, 'ptr', $CodeBase, 'dword', 1, 'ptr', 0) If Not $Success[0] Then MemLib_FreeLibrary($ModulePtr) Return SetError(4, 0, 0) EndIf DllStructSetData($Module, 'Initialized', 1) EndIf Return $ModulePtr EndFunc ;==>MemLib_LoadLibrary Func MemLib_PerformBaseRelocation($CodeBase, $PEHeader, $LocationDelta) Local Const $IMAGE_DIRECTORY_ENTRY_BASERELOC = 5 Local Const $IMAGE_REL_BASED_HIGHLOW = 3 Local Const $IMAGE_REL_BASED_DIR64 = 10 Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfDataDirectory = DllStructGetSize(DllStructCreate($tagIMAGE_DATA_DIRECTORY)) Local $RelocDirectoryPtr = $PEHeader + DllStructGetSize($IMAGE_NT_HEADER) + $IMAGE_DIRECTORY_ENTRY_BASERELOC * $SizeOfDataDirectory Local $RelocDirectory = DllStructCreate($tagIMAGE_DATA_DIRECTORY, $RelocDirectoryPtr) Local $RelocSize = DllStructGetData($RelocDirectory, 'Size') Local $RelocVirtualAddress = DllStructGetData($RelocDirectory, 'VirtualAddress') If $RelocSize > 0 Then Local $Relocation = $CodeBase + $RelocVirtualAddress While 1 Local $IMAGE_BASE_RELOCATION = DllStructCreate($tagIMAGE_BASE_RELOCATION, $Relocation) Local $VirtualAddress = DllStructGetData($IMAGE_BASE_RELOCATION, 'VirtualAddress') Local $SizeOfBlock = DllStructGetData($IMAGE_BASE_RELOCATION, 'SizeOfBlock') If $VirtualAddress = 0 Then ExitLoop Local $Dest = $CodeBase + $VirtualAddress Local $Entries = ($SizeOfBlock - 8) / 2 Local $RelInfo = DllStructCreate('word[' & $Entries & ']', $Relocation + 8) For $i = 1 To $Entries Local $Info = DllStructGetData($RelInfo, 1, $i) Local $Type = BitShift($Info, 12) If $Type = $IMAGE_REL_BASED_HIGHLOW Or $Type = $IMAGE_REL_BASED_DIR64 Then Local $Addr = DllStructCreate('ptr', $Dest + BitAND($Info, 0xFFF)) DllStructSetData($Addr, 1, DllStructGetData($Addr, 1) + $LocationDelta) EndIf Next $Relocation += $SizeOfBlock WEnd EndIf EndFunc ;==>MemLib_PerformBaseRelocation Func MemLib_Vaild($ModulePtr) Local $ModuleSize = DllStructGetSize(DllStructCreate($tagModule)) If API_IsBadReadPtr($ModulePtr, $ModuleSize) Then Return False Local $Module = DllStructCreate($tagModule, $ModulePtr) Local $CodeBase = DllStructGetData($Module, 'CodeBase') If Not $CodeBase Then Return False Return True EndFunc ;==>MemLib_Vaild Func MemoryDllCall($Module, $RetType, $FuncName, $Type1 = '', $Param1 = 0, $Type2 = '', $Param2 = 0, $Type3 = '', $Param3 = 0, $Type4 = '', $Param4 = 0, $Type5 = '', $Param5 = 0, $Type6 = '', $Param6 = 0, $Type7 = '', $Param7 = 0, $Type8 = '', $Param8 = 0, $Type9 = '', $Param9 = 0, $Type10 = '', $Param10 = 0, $Type11 = '', $Param11 = 0, $Type12 = '', $Param12 = 0, $Type13 = '', $Param13 = 0, $Type14 = '', $Param14 = 0, $Type15 = '', $Param15 = 0, $Type16 = '', $Param16 = 0, $Type17 = '', $Param17 = 0, $Type18 = '', $Param18 = 0, $Type19 = '', $Param19 = 0, $Type20 = '', $Param20 = 0) Local $Ret, $OpenFlag = False Local Const $MaxParams = 20 If (@NumParams < 3) Or (@NumParams > $MaxParams * 2 + 3) Or (Mod(@NumParams, 2) = 0) Then Return SetError(4, 0, 0) If Not IsPtr($Module) Then $OpenFlag = True $Module = MemoryDllOpen($Module) If @error Then Return SetError(1, 0, 0) EndIf Local $Addr = MemLib_GetProcAddress($Module, $FuncName) If Not $Addr Then Return SetError(3, 0, 0) Poke('ptr', $_MFHookPtr + 1 + @AutoItX64, $Addr) Switch @NumParams Case 3 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi) Case 5 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1) Case 7 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2) Case 9 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3) Case 11 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4) Case 13 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4, $Type5, $Param5) Case Else Local $DllCallStr = 'DllCall ( $_KERNEL32DLL, $RetType, $_MFHookApi', $n = 1 For $i = 5 To @NumParams Step 2 $DllCallStr &= ', $Type' & $n & ', $Param' & $n $n += 1 Next $DllCallStr &= ' )' $Ret = Execute($DllCallStr) EndSwitch Local $Err = @error If $OpenFlag Then MemoryDllClose($Module) Return SetError($Err, 0, $Ret) EndFunc ;==>MemoryDllCall Func MemoryDllClose($Module) MemLib_FreeLibrary($Module) EndFunc ;==>MemoryDllClose Func MemoryDllOpen($DllBinary) If Not IsDllStruct($_MFHookBak) Then MemoryFuncInit() Local $Module = MemLib_LoadLibrary($DllBinary) If @error Then Return SetError(@error, 0, -1) Return $Module EndFunc ;==>MemoryDllOpen Func MemoryFuncCall($RetType, $Address, $Type1 = '', $Param1 = 0, $Type2 = '', $Param2 = 0, $Type3 = '', $Param3 = 0, $Type4 = '', $Param4 = 0, $Type5 = '', $Param5 = 0, $Type6 = '', $Param6 = 0, $Type7 = '', $Param7 = 0, $Type8 = '', $Param8 = 0, $Type9 = '', $Param9 = 0, $Type10 = '', $Param10 = 0, $Type11 = '', $Param11 = 0, $Type12 = '', $Param12 = 0, $Type13 = '', $Param13 = 0, $Type14 = '', $Param14 = 0, $Type15 = '', $Param15 = 0, $Type16 = '', $Param16 = 0, $Type17 = '', $Param17 = 0, $Type18 = '', $Param18 = 0, $Type19 = '', $Param19 = 0, $Type20 = '', $Param20 = 0) If Not IsDllStruct($_MFHookBak) Then MemoryFuncInit() Poke('ptr', $_MFHookPtr + 1 + @AutoItX64, $Address) Local $Ret Switch @NumParams Case 2 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi) Case 4 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1) Case 6 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2) Case 8 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3) Case 10 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4) Case 12 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4, $Type5, $Param5) Case Else Local $DllCallStr = 'DllCall($_KERNEL32DLL, $RetType, $_MFHookApi', $n = 1 For $i = 4 To @NumParams Step 2 $DllCallStr &= ', $Type' & $n & ', $Param' & $n $n += 1 Next $DllCallStr &= ')' $Ret = Execute($DllCallStr) EndSwitch Return SetError(@error, 0, $Ret) EndFunc ;==>MemoryFuncCall Func MemoryFuncInit() Local $KernelHandle = API_LoadLibrary('kernel32.dll') API_FreeLibrary($KernelHandle) Local $HookPtr = API_GetProcAddress($KernelHandle, $_MFHookApi) Local $HookSize = 7 + @AutoItX64 * 5 $_MFHookPtr = $HookPtr $_MFHookBak = DllStructCreate('byte[' & $HookSize & ']') If Not API_VirtualProtect($_MFHookPtr, $HookSize, $PAGE_EXECUTE_READWRITE) Then Return False DllStructSetData($_MFHookBak, 1, Peek('byte[' & $HookSize & ']', $_MFHookPtr)) If @AutoItX64 Then Poke('word', $_MFHookPtr, 0xB848) Poke('word', $_MFHookPtr + 10, 0xE0FF) Else Poke('byte', $_MFHookPtr, 0xB8) Poke('word', $_MFHookPtr + 5, 0xE0FF) EndIf Return True EndFunc ;==>MemoryFuncInit Func Peek($Type, $Ptr) If $Type = 'str' Then $Type = 'char[' & API_lstrlenA($Ptr) & ']' ElseIf $Type = 'wstr' Then $Type = 'wchar[' & API_lstrlenW($Ptr) & ']' EndIf Return DllStructGetData(DllStructCreate($Type, $Ptr), 1) EndFunc ;==>Peek Func Poke($Type, $Ptr, $Value) If $Type = 'str' Then $Type = 'char[' & (StringLen($Value) + 1) & ']' ElseIf $Type = 'wstr' Then $Type = 'wchar[' & (StringLen($Value) + 1) & ']' EndIf DllStructSetData(DllStructCreate($Type, $Ptr), 1, $Value) EndFunc ;==>Poke #EndRegion Download 7-Zip archive for the UDF, DLLs and examples: WebP v0.3.1 build 2022-06-18 beta.7z
-
$img = GUICtrlCreatePic("", 500,0,1390,890) ... _GDIPlus_Startup() local $bitmap_1 = _GDIPlus_BitmapCreateFromMemory(InetRead($jpg_url)) local $bitmap_2 = _GDIPlus_ImageResize ($bitmap_1, 1390, 890) local $bitmap_3 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($bitmap_2) GUICtrlSendMsg($img, 0x0172, 0, $bitmap_3) _GDIPlus_BitmapDispose($bitmap_1) _GDIPlus_BitmapDispose($bitmap_2) _WinAPI_DeleteObject($bitmap_3) _GDIPlus_Shutdown() I think this is all the relevant code. I've never worked with any of these functions before (aside from GUICtrlCreatePic and setting it to a picture file, not setting it via memory via GUICtrlSendMsg) so I don't know how to clean up properly after loading/drawing an image to screen. I commented out everything and went line by line figuring out what stops the leak. BitmapDispose and DeleteObject work for the varables I created... $bitmap_1, 2, 3 are good. Now all that remains is the GUICtrlSendMsg line of code. When I comment just this line, the memory leak stops. Do I need to do something to clear the picture control? Or send a message to $img using GUICtrlSendMsg telling it to clear the previous image? The docs for the function don't show anything (https://www.autoitscript.com/autoit3/docs/functions/GUICtrlSendMsg.htm) but I see it's being used to start/stop a marquee scrolling text for a progress bar control with the third parameter value 0/1... I tried this with Pic control thinking making 0 is for displaying the bitmap, and 1 is for clearing it, but it doesn't clear the memory. Help would be appreciated, thanks.
- 2 replies
-
- guictrlsendmsg
- memory leak
-
(and 3 more)
Tagged with:
-
Heres a function for searching for a bitmap within another bitmap. The heart of it is written assembly (source included) and working pretty quick I feel. I have included an example which is pretty basic and should be easily enough for anyone to get the concept. You will be given a small blue window that will take a screencapture of that size: It will then take a full screenshot and highlight all locations that it found Please let me know if you have any issues or questions. Thanks! Update 8/5/2019: Rewrote for fasmg. Added full source with everything needed to modify BmpSearch_8-5-2019.7z BmpSearch.zip GAMERS - Asking for help with ANY kind of game automation is against the forum rules. DON'T DO IT.
-
Here a small tool to watermark any image supported by GDI+. This version is the enhanced version from AutoIt Windows Screenshooter. Screenshot: Download: AutoIt Watermark Image v0.89 beta build 2014-08-25.7z (942 download previously) Source code is too long to publish here -> PASTEBIN You are not allowed to sell this code or use it or just parts of it in a commercial project or modify it and distribute it with a different name! Some fonts may no be displayed properly because it is not GDI+ compatible! Appreciate any feedback (bugs, feature request, criticisms, etc.). @JScript: I created this on your request Coded and tested on Win7 x64 with Aero and AutoIt v3.3.12.0. Command line parameters Credits: Authenticity (GDIP.au3), funkey (_GetFontInfoFromFilePtr()), Yashied (WinAPIEx.au3) and Melba23 (NoFocusLines.au3) Thanks to (alph. order): davidkim, funkey, JScript and Myicq for active supporting this little project! Br, UEZ History
- 76 replies
-
I'm searching for a way to set an icon for a system menu entry in the console window. I can add / remove entries but I didn't find a way to set an icon for the entry I made. Example: #AutoIt3Wrapper_Change2CUI=y #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <GuiMenu.au3> #include <WindowsConstants.au3> Global $id_Test = 5000 Global $hConsole = HWnd(DllCall("kernel32.dll", "hwnd", "GetConsoleWindow")[0]) If Not $hConsole Then Exit HotKeySet("{ESC}", "_Exit") Global $hSysmenu = _GUICtrlMenu_GetSystemMenu($hConsole) Global $iCount = _GUICtrlMenu_GetItemCount ($hSysmenu) _GUICtrlMenu_InsertMenuItem($hSysmenu, $iCount, "Test", $id_Test) _GDIPlus_Startup() $hBitmap_GDI = _GDIPlus_BitmapCreateFromMemory(_Test(), True) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hBitmap_GDI = ' & $hBitmap_GDI & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $hBmp1 = _WinAPI_CreateSolidBitmap($hConsole, 0xFF0000, 16, 16) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hBmp1 = ' & $hBmp1 & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $hBmp2 = _WinAPI_CreateSolidBitmap($hConsole, 0x00FF00, 16, 16) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hBmp2 = ' & $hBmp2 & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console ;ConsoleWrite(_GUICtrlMenu_SetItemBmp($hSysmenu, $id_Test, $hBitmap_GDI, False) & @CRLF) ConsoleWrite(_GUICtrlMenu_SetItemBitmaps($hSysmenu, $id_Test, $hBmp1, $hBmp2, False) & ", " & @error & @CRLF) ;_GUICtrlMenu_SetItemBmp($hSysmenu, $id_Test, 8, False) ;set the default close icon _GDIPlus_Shutdown() Do Sleep(1000) Until False Func _Exit() ConsoleWrite("Bye..." & @CRLF) _GUICtrlMenu_DeleteMenu ($hSysmenu, $id_Test, False) _WinAPI_DeleteObject($hBitmap_GDI) _WinAPI_DeleteObject($hBmp1) _WinAPI_DeleteObject($hBmp2) Exit EndFunc ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2020-06-05 Func _Test($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Test $Test &= 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA3XAAAN1wFCKJt4AAADKElEQVQ4yz2RT2gcdRTHP7+Z36y7yzZZdvJv22i0rBpiAwnWCMZrUCGIBxEvpQSEHAQhePLkyUKg6Em9iZCcahH0pFYxkIqiIdHKYmPUUHcDmU2TuJnZzc7s/H7PQ5M8ePAu7/M+X56y1hKGYY+IOEDqOI6TzWY1gFIKEcF1XRzHUWmaJnF8bHBy5pfbnz9fb0hBh2F4bm5ubjWKogudTqdVqVT0/Py853kehUKBQqHA2tqaVKtVfenS2P6HH396PDri9D9+cdC/8dkXNW2t9fb29spRFPmtVqtULBaVMYZ8Pk82m8X3farVKjdv3qCn+FbpnFuXfNpQkkwlX33z3RtaKYXW2mqtcV1XtNZks9kzQCaTIeNp4sSh8rAnzSe0HO5bt1arHR51y79pEcEYo05Aylp7OqOUIk0TRp+aYO5Ki3B3VR3s70pictzZGlC5jHW0UgprLVEU4Xke29vbLCwsoLXGcRRxYjk/2MtLz2X4/tvbaO3y9XoPlUe7CI7VAMYYPM+jXC5jrcUYAwipUeSzHhV/k59+bFK5OMytOxco9ezQTQ2A4ujoqDQ+Ph4sLS2JiNiDgwM5PDyQ3SCQ/5ptubv6rsy9XJIfvnxbNv/8W+7d+9deu/aeTE9PB2EYljSAiKje3l7SNCUIAkDQXp77f3zE4uJ1Xnv9KoWRK+zs1DlfHiCXy2OtBcA5AdDpdHBdl4F+n77BEdz2z3zw/iKvvHqVZ194h0wmz0B/Ca094jjmtE4NEBFarRa7jfvkHgqp/rrKxOQzjF6+wtY/u4g9Jo5TfL+EiGCtxVqLFhGUUhhjsNZgrcvqrU948rFhKlNvEkUdtNvBoFEqPVtUSqGUQiulaDabtNttPC/D5t3fqTU0Y5dfpNFogFhEOLsaxzHtdpsgCNT6+rrSSZIwOztrhoeH' $Test &= 'qdfrRmutJp6e4q+tKsbYs3in7+7r65OhoSE9MzNjkiRBt9ttkiRxjTHkcjl3bGxMPYhjSdP0rLvdLt1uF9d1BcDzPHdyclL0yspKuLGxcT0IgkeKxaINgsADXBFxAefEQB4ImNT3/W4Yhk6z2awtLy9H/wPnrsNEnFPl4QAAAABJRU5ErkJggg==' Local $bString = _WinAPI_Base64Decode($Test) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\AutoSave_16x16_04.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Test Func _WinAPI_Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_WinAPI_Base64Decode You must compile and run it to see the menu entry in the console window. Any idea?
-
Here a little tool to display the histogram of an image (inspired by this thread): ) ;#AutoIt3Wrapper_Icon=Histogram1.ico #AutoIt3Wrapper_Compile_Both=y ;#AutoIt3Wrapper_Res_Field=CompanyName|UEZ Software Development ;#AutoIt3Wrapper_Res_Field=ProductName|GDI+ Show Histogram ;#AutoIt3Wrapper_Res_Field=ProductVersion|%AutoItVer% #AutoIt3Wrapper_Res_Fileversion=0.9.8.0 ;#AutoIt3Wrapper_Res_Field=Build|2015-07-10 #AutoIt3Wrapper_Res_LegalCopyright=UEZ Software Development #AutoIt3Wrapper_Res_Language=1033 ;#AutoIt3Wrapper_Res_Field=URL|http://www.autoitscript.com/forum/index.php?showtopic=147777 #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /pe /rm #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #AutoIt3Wrapper_UseUpx=y #AutoIt3Wrapper_UPX_Parameters=--best --lzma #AutoIt3Wrapper_Run_After=upx.exe --best --lzma "GDI+ Show Histogram_x64.exe" #AutoIt3Wrapper_UseX64=n #include <Constants.au3> #include <GUIConstantsEx.au3> #include <GDIPlus.au3> #include <WindowsConstants.au3> Opt("MustDeclareVars", 1) Opt("MouseCoordMode", 2) _GDIPlus_Startup() If @error Then Exit MsgBox(0x40010, "Error", "GDI+ Show Histogram can run on operating systems Vista or newer only!") Global $ghGDIPDll = $__g_hGDIPDll, $aRes Global Const $hFullScreen = WinGetHandle("[TITLE:Program Manager;CLASS:Progman]") Global Const $aFullScreen = WinGetPos($hFullScreen) Global Enum $HistogramFormatARGB, $HistogramFormatPARGB, $HistogramFormatRGB, $HistogramFormatGray, _ ;http://msdn.microsoft.com/en-us/library/windows/desktop/ms534129(v=vs.85).aspx $HistogramFormatB, $HistogramFormatG, $HistogramFormatR, $HistogramFormatA Global $tStructChannel0 = DllStructCreate("uint channel0[256]") Global $pStructChannel0 = DllStructGetPtr($tStructChannel0) Global $tStructChannel1 = DllStructCreate("uint channel1[256]") Global $pStructChannel1 = DllStructGetPtr($tStructChannel1) Global $tStructChannel2 = DllStructCreate("uint channel2[256]") Global $pStructChannel2 = DllStructGetPtr($tStructChannel2) Global $tStructChannel3 = DllStructCreate("uint channel3[256]") Global $pStructChannel3 = DllStructGetPtr($tStructChannel3) Global $s, $sFile, $hImage, $bImgLoaded = False, $aLuminosity[257], $aCRGB[257] Global Const $STM_SETIMAGE = 0x0172, $iLineJoinBevel = 1, $frY = 0.299, $fgY = 0.587, $fbY = 0.114 Global Const $hGUI = GUICreate("GDI+ Show Histogram v0.98 beta by UEZ build 2015-07-13", 468, 310, -1, -1, Default, Default) GUISetBkColor(0xFFFFFF, $hGUI) Global Const $sLabel_Titel_Txt = "GDI+ Show Histogram" Global Const $iPosX_Label = 20, $iPosY_Label = 12 Global Const $iLabel_Titel_Shadow = GUICtrlCreateLabel($sLabel_Titel_Txt, $iPosX_Label, $iPosY_Label, 429, 57) GUICtrlSetFont(-1, 30, 400, 0, "Comic Sans MS", 4) GUICtrlSetColor(-1, 0xC0C0D8) Global Const $iLabel_Titel = GUICtrlCreateLabel($sLabel_Titel_Txt, $iPosX_Label - 4, $iPosY_Label - 4, 429, 57) GUICtrlSetFont(-1, 30, 400, 0, "Comic Sans MS", 4) GUICtrlSetColor(-1, 0x0000C0) GUICtrlSetBkColor(-1, -2) Global Const $iPic_Histogram = GUICtrlCreatePic("", 20, 90, 255, 127, -1, $WS_EX_STATICEDGE) GUICtrlSetCursor(-1, 14) Global Const $iPic_ColorGradient = GUICtrlCreatePic("", 20, 220, 255, 24, -1, $WS_EX_STATICEDGE) Global Const $iGroup = GUICtrlCreateGroup("Channel", 290, 84, 160, 164) Global Const $iRadio_L = GUICtrlCreateRadio("Luminosit&y (gray)", 300, 100, 110, 20) GUICtrlSetTip(-1, $frY & "*R, " & $fgY & "*G, " & $fbY & "*B") GUICtrlSetState($iRadio_L, $GUI_CHECKED) Global Const $iRadio_C = GUICtrlCreateRadio("&cRGB", 300, 130, 60, 20) GUICtrlSetTip(-1, "Combined average of RGB values") Global Const $iRadio_R = GUICtrlCreateRadio("&Red", 300, 160, 60, 20) Global Const $iRadio_G = GUICtrlCreateRadio("&Green", 300, 190, 60, 20) Global Const $iRadio_B = GUICtrlCreateRadio("&Blue", 300, 220, 60, 20) GUICtrlCreateGroup("", -99, -99, 1, 1) Global Const $iButton_Save = GUICtrlCreateButton("&Save", 209, 265, 70, 30) GUICtrlSetTip(-1, "Click button to save all histogram images") GUICtrlSetState(-1, $GUI_DISABLE) Global Const $iButton_Load = GUICtrlCreateButton("&Load", 290, 265, 70, 30) GUICtrlSetTip(-1, "Click button to load an image") Global Const $iButton_Exit = GUICtrlCreateButton("E&xit", 390, 265, 60, 30) Global $sLabelCredit_Txt = "coded by UEZ'13" Global $aLabelCredit_Pos[StringLen($sLabelCredit_Txt)][4], $u, $iFS = 6.5, $iY = 280 For $u = 0 To UBound($aLabelCredit_Pos) - 1 $aLabelCredit_Pos[$u][0] = StringMid($sLabelCredit_Txt, $u + 1, 1) $aLabelCredit_Pos[$u][1] = 20 + $u * ($iFS - 0.25) $aLabelCredit_Pos[$u][2] = $iY $aLabelCredit_Pos[$u][3] = GUICtrlCreateLabel($aLabelCredit_Pos[$u][0], $aLabelCredit_Pos[$u][1], $aLabelCredit_Pos[$u][2], $iFS, $iFS * 1.8) GUICtrlSetFont(-1, $iFS, 400, 0, "Comic Sans MS", 2) GUICtrlSetColor(-1, 0x006000) Next Global $aLabelCredit_AnimPos[300] For $u = 0 To UBound($aLabelCredit_AnimPos) - 1 $aLabelCredit_AnimPos[$u] = $iY Next Global Const $fLimes = 2.2, $fStep = 0.1 Global $iPT = 0, $z = Int((UBound($aLabelCredit_AnimPos) - ($fLimes * $fStep * 100)) / 2) For $u = 0 To $fLimes Step $fStep $aLabelCredit_AnimPos[$z] = $iY + Sin($iPT * 4) * 10 $z += 1 $iPT += 0.075 Next Global $ihGui_PreviewSize = 256, $iBGColor = 0xF0F0F0 Global $hGui_Preview = GUICreate("", $ihGui_PreviewSize, $ihGui_PreviewSize + 58, -1, -1, $WS_POPUP + $WS_BORDER, $WS_EX_TOPMOST, $hGUI) Global $iPic_Preview = GUICtrlCreatePic("", 0, 0, $ihGui_PreviewSize, $ihGui_PreviewSize) Global $idLabel_Info = GUICtrlCreateLabel("", 0, $ihGui_PreviewSize, $ihGui_PreviewSize * 2, 58) GUICtrlSetFont(-1, 8.5, 400, 0, "Arial", 5) GUICtrlSetColor(-1, $iBGColor) GUICtrlSetBkColor(-1, 0x333333) Global Const $hTexture_Checkerboard = _GDIPlus_CreateCheckerboardTexture(8, 0xFFFBFBFB, 0xFFFFFFFF) Global $hHBmp_L = _GDIPlus_CreateColorGradient("L", 256, 24) Global $hHBmp_C = _GDIPlus_CreateColorGradient("C", 256, 24) Global $hHBmp_R = _GDIPlus_CreateColorGradient("R", 256, 24) Global $hHBmp_G = _GDIPlus_CreateColorGradient("G", 256, 24) Global $hHBmp_B = _GDIPlus_CreateColorGradient("B", 256, 24) Global Const $hHBmp_HL = _GDIPlus_BitmapCreateFromScan0(256, 127) Global Const $hCtxt_HL = _GDIPlus_ImageGetGraphicsContext($hHBmp_HL) Global Const $hHBmp_HC = _GDIPlus_BitmapCloneArea($hHBmp_HL, 0, 0, 256, 127, 0x0026200A) Global Const $hCtxt_HC = _GDIPlus_ImageGetGraphicsContext($hHBmp_HC) Global Const $hHBmp_HR = _GDIPlus_BitmapCloneArea($hHBmp_HL, 0, 0, 256, 127, 0x0026200A) Global Const $hCtxt_HR = _GDIPlus_ImageGetGraphicsContext($hHBmp_HR) Global Const $hHBmp_HG = _GDIPlus_BitmapCloneArea($hHBmp_HL, 0, 0, 256, 127, 0x0026200A) Global Const $hCtxt_HG = _GDIPlus_ImageGetGraphicsContext($hHBmp_HG) Global Const $hHBmp_HB = _GDIPlus_BitmapCloneArea($hHBmp_HL, 0, 0, 256, 127, 0x0026200A) Global Const $hCtxt_HB = _GDIPlus_ImageGetGraphicsContext($hHBmp_HB) _GDIPlus_GraphicsClear($hCtxt_HL, 0xFFFFFFFF) _hBmpToPicControl($iPic_ColorGradient, $hHBmp_L) Global $hB_H = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hHBmp_HL) _hBmpToPicControl($iPic_Histogram, $hB_H, 1) GUISetState(@SW_HIDE, $hGui_Preview) GUISetState(@SW_SHOW, $hGUI) ControlFocus($hGUI, "", $iButton_Load) Global $hPen_H = _GDIPlus_PenCreate() $s = "L" Global $iDummyL = GUICtrlCreateDummy(), $iDummyC = GUICtrlCreateDummy(), $iDummyR = GUICtrlCreateDummy(), $iDummyG = GUICtrlCreateDummy(), $iDummyB = GUICtrlCreateDummy() Global $iHistogramFormat, $hHBmp_Preview, $aPosCtrl, $aPosWin, $aMouseInfo, $aPos_hWnd, $imp, $iVal, $iMpos_oldx, $iMpos_oldy, $sType, $iPaletteType, $iPixelFormat Global $fAverage_L, $fAverage_cRGB, $iAverage_R, $iAverage_B, $iAverage_G, $o = 0 Global $bShow = False, $bHide = False, $bIsAlpha = False, $bIsGray = False Global Const $iEntries = 256 Global Const $tagCOLORPALETTE = "uint Flags;" & _ ; Palette flags "uint Count;" & _ ; Number of color entries "uint ARGB[" & $iEntries & "];" ; Palette color AdlibRegister("AnimateLabel", 60) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $iButton_Exit AdlibUnRegister("AnimateLabel") GUIDelete($hGui_Preview) GUIDelete($hGUI) _WinAPI_DeleteObject($hHBmp_L) _WinAPI_DeleteObject($hHBmp_C) _WinAPI_DeleteObject($hHBmp_L) _WinAPI_DeleteObject($hHBmp_R) _WinAPI_DeleteObject($hHBmp_G) _WinAPI_DeleteObject($hHBmp_B) If $hHBmp_Preview Then _WinAPI_DeleteObject($hHBmp_Preview) _GDIPlus_PenDispose($hPen_H) _GDIPlus_BrushDispose($hTexture_Checkerboard) _GDIPlus_GraphicsDispose($hCtxt_HL) _GDIPlus_GraphicsDispose($hCtxt_HC) _GDIPlus_GraphicsDispose($hCtxt_HR) _GDIPlus_GraphicsDispose($hCtxt_HG) _GDIPlus_GraphicsDispose($hCtxt_HB) _GDIPlus_BitmapDispose($hHBmp_HL) _GDIPlus_BitmapDispose($hHBmp_HC) _GDIPlus_BitmapDispose($hHBmp_HR) _GDIPlus_BitmapDispose($hHBmp_HG) _GDIPlus_BitmapDispose($hHBmp_HB) _GDIPlus_Shutdown() $tStructChannel0 = 0 $tStructChannel1 = 0 $tStructChannel2 = 0 $tStructChannel3 = 0 Exit Case $iRadio_L, $iDummyL If $s <> "L" Then _hBmpToPicControl($iPic_ColorGradient, $hHBmp_L) If $bImgLoaded Then $hB_H = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hHBmp_HL) _hBmpToPicControl($iPic_Histogram, $hB_H, 1) EndIf $s = "L" EndIf Case $iRadio_C, $iDummyC If $s <> "C" Then _hBmpToPicControl($iPic_ColorGradient, $hHBmp_C) If $bImgLoaded Then $hB_H = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hHBmp_HC) _hBmpToPicControl($iPic_Histogram, $hB_H, 1) EndIf $s = "C" EndIf Case $iRadio_R, $iDummyR If $s <> "R" Then _hBmpToPicControl($iPic_ColorGradient, $hHBmp_R) If $bImgLoaded Then $hB_H = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hHBmp_HR) _hBmpToPicControl($iPic_Histogram, $hB_H, 1) EndIf $s = "R" EndIf Case $iRadio_G, $iDummyG If $s <> "G" Then _hBmpToPicControl($iPic_ColorGradient, $hHBmp_G) If $bImgLoaded Then $hB_H = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hHBmp_HG) _hBmpToPicControl($iPic_Histogram, $hB_H, 1) EndIf $s = "G" EndIf Case $iRadio_B, $iDummyB If $s <> "B" Then _hBmpToPicControl($iPic_ColorGradient, $hHBmp_B) If $bImgLoaded Then $hB_H = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hHBmp_HB) _hBmpToPicControl($iPic_Histogram, $hB_H, 1) EndIf $s = "B" EndIf Case $iButton_Load $sFile = FileOpenDialog("Select an image", "", "Images (*.jpg;*.png;*.bmp;*.gif)", 3) If @error Then ContinueCase If $bImgLoaded Then _GDIPlus_ImageDispose($hImage) $hImage = _GDIPlus_ImageLoadFromFile($sFile) If @error Then MsgBox(0x40010, "Error", "Unable to load image", 30) ContinueCase EndIf GUICtrlSetState($iButton_Save, $GUI_ENABLE) $aRes = _GDIPlus_ImageGetFlags($hImage) If BitAND($aRes[0], $GDIP_IMAGEFLAGS_HASALPHA) Then $bIsAlpha = True Else $bIsAlpha = False EndIf If BitAND($aRes[0], $GDIP_IMAGEFLAGS_COLORSPACE_GRAY) Then $bIsGray = True Else $bIsGray = False EndIf $hHBmp_Preview = _GetImage($sFile, $ihGui_PreviewSize, $iBGColor) _hBmpToPicControl($iPic_Preview, $hHBmp_Preview, 1) If Not $bIsAlpha Then $pStructChannel3 = 0 $iHistogramFormat = $HistogramFormatRGB Else $pStructChannel3 = DllStructGetPtr($tStructChannel3) $iHistogramFormat = $HistogramFormatARGB EndIf _GDIPlus_BitmapGetHistogram($hImage, $iHistogramFormat, _GDIPlus_BitmapGetHistogramSize($iHistogramFormat), $pStructChannel0, $pStructChannel1, $pStructChannel2, $pStructChannel3) _GDIPlus_CreateHistogram() $bImgLoaded = True If BitAND(GUICtrlRead($iRadio_L), $GUI_CHECKED) Then $s = "" GUICtrlSendToDummy($iDummyL) ElseIf BitAND(GUICtrlRead($iRadio_C), $GUI_CHECKED) Then $s = "" GUICtrlSendToDummy($iDummyC) ElseIf BitAND(GUICtrlRead($iRadio_R), $GUI_CHECKED) Then $s = "" GUICtrlSendToDummy($iDummyR) ElseIf BitAND(GUICtrlRead($iRadio_G), $GUI_CHECKED) Then $s = "" GUICtrlSendToDummy($iDummyG) Else $s = "" GUICtrlSendToDummy($iDummyB) EndIf Case $iButton_Save If $sFile = "" Then ContinueLoop $sType = "png" $o += _GDIPlus_ImageSaveToFile($hHBmp_HL, StringRegExpReplace($sFile, "(.*)\..*", "$1") & "_Luminosity." & $sType) $o += _GDIPlus_ImageSaveToFile($hHBmp_HC, StringRegExpReplace($sFile, "(.*)\..*", "$1") & "_cRGB." & $sType) $o += _GDIPlus_ImageSaveToFile($hHBmp_HR, StringRegExpReplace($sFile, "(.*)\..*", "$1") & "_Red." & $sType) $o += _GDIPlus_ImageSaveToFile($hHBmp_HG, StringRegExpReplace($sFile, "(.*)\..*", "$1") & "_Green." & $sType) $o += _GDIPlus_ImageSaveToFile($hHBmp_HB, StringRegExpReplace($sFile, "(.*)\..*", "$1") & "_Blue." & $sType) If $o = 5 Then MsgBox(64 + 262144, "Information", "Images properly saved to " & StringRegExpReplace($sFile, "(.*)\\.*", "$1"), 30, $hGUI) Else MsgBox(16 + 262144, "Error", "One or more images could not saved to " & StringRegExpReplace($sFile, "(.*)\\.*", "$1") & ".", 30, $hGUI) EndIf EndSwitch If WinActive($hGUI) Then $aMouseInfo = GUIGetCursorInfo($hGUI) Switch $aMouseInfo[4] Case $iPic_Histogram If $bImgLoaded Then $aPos_hWnd = WinGetPos($hGUI) $imp = Max(1, Min(256, -19 + $aMouseInfo[0])) Switch $s Case "L" $iVal = $aLuminosity[$imp] Case "C" $iVal = $aCRGB[$imp] Case "R" $iVal = DllStructGetData($tStructChannel0, "channel0", $imp) Case "G" $iVal = DllStructGetData($tStructChannel1, "channel1", $imp) Case "B" $iVal = DllStructGetData($tStructChannel2, "channel2", $imp) EndSwitch If $iMpos_oldx <> $aMouseInfo[0] Or $iMpos_oldy <> $aMouseInfo[1] Then ToolTip("Index: " & $imp & ", Value: " & Round($iVal, 0) & ", Average: " & Round($fAverage_L, 2), $aPos_hWnd[0] + $aMouseInfo[0] - 60, $aMouseInfo[1] + $aPos_hWnd[1] - 20) $iMpos_oldx = $aMouseInfo[0] $iMpos_oldy = $aMouseInfo[1] EndIf ShowPreview($iPic_Histogram) $bShow = True $bHide = False EndIf Case Else If Not $bHide Then GUISetState(@SW_HIDE, $hGui_Preview) $bHide = True ToolTip("") EndIf $bShow = False EndSwitch EndIf WEnd Func AnimateLabel() Local Static $v = Int((UBound($aLabelCredit_AnimPos) - ($fLimes * $fStep * 100)) / 2) Local $u For $u = 0 To UBound($aLabelCredit_Pos) - 1 GUICtrlSetPos($aLabelCredit_Pos[$u][3], $aLabelCredit_Pos[$u][1], $aLabelCredit_AnimPos[$v - $u]) Next If $v - $u < 0 Then $v = UBound($aLabelCredit_AnimPos) - 1 $v -= 1 EndFunc ;==>AnimateLabel Func Min($a, $b) If $a < $b Then Return $a Return $b EndFunc ;==>Min Func Max($a, $b) If $a > $b Then Return $a Return $b EndFunc ;==>Max Func ShowPreview($iCtrl) $aPosWin = WinGetPos($hGUI) $aPosCtrl = ControlGetPos($hGUI, "", $iCtrl) Local $iNewX, $iNewX1 = $aPosWin[0] - $ihGui_PreviewSize + 10, $iNewX2 = $aPosWin[0] + $aPosWin[2] - 10 $iNewX = $iNewX1 If $iNewX1 < $aFullScreen[0] Then $iNewX = $iNewX2 EndIf WinMove($hGui_Preview, "", $iNewX, $aPosWin[1] + 50) GUISetState(@SW_SHOWNOACTIVATE, $hGui_Preview) EndFunc ;==>ShowPreview Func _GetImage($sFile, $iWH, $iBkClr = 0xFFFFFF, $bCheckerboard_Bg = True) Local $hBmp1, $hBitmap, $hGraphic, $hImage, $iW, $iH, $aGS, $hBmp2, $aFTS $aFTS = FileGetTime($sFile) If @error Then Return SetError(1, 0, 0) $hBmp1 = _WinAPI_CreateBitmap($iWH, $iWH, 1, 32) $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBmp1) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hBitmap) _WinAPI_DeleteObject($hBmp1) $hImage = _GDIPlus_ImageLoadFromFile($sFile) $iW = _GDIPlus_ImageGetWidth($hImage) $iH = _GDIPlus_ImageGetHeight($hImage) GUICtrlSetData($idLabel_Info, StringRegExpReplace($sFile, ".*\\(.*)", "$1") & @LF & Round(FileGetSize($sFile) / 1024, 0) & " kb (" & $iW & " x " & $iH & ")" & @LF & $aFTS[0] & "/" & $aFTS[1] & "/" & $aFTS[2] & " " & $aFTS[3] & ":" & $aFTS[4] & ":" & $aFTS[5] & @LF & "Alpha: " & $bIsAlpha & ", Gray: " & $bIsGray) $aGS = _GetScale($iW, $iH, $iWH) Switch $bCheckerboard_Bg Case True ;~ _GDIPlus_GraphicsFillRect($hGraphic, 0, 0, $iWH, $iWH, $hTexture_Checkerboard) _GDIPlus_GraphicsClear($hGraphic, BitOR(0xFF000000, $iBkClr)) _GDIPlus_GraphicsFillRect($hGraphic, $aGS[0], $aGS[1], $aGS[2], $aGS[3], $hTexture_Checkerboard) Case False _GDIPlus_GraphicsClear($hGraphic, BitOR(0xFF000000, $iBkClr)) EndSwitch _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, $aGS[0], $aGS[1], $aGS[2], $aGS[3]) _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGraphic) $hBmp2 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hBmp2 EndFunc ;==>_GetImage Func _GetScale($iW, $iH, $iWH) Local $aRet[4] If $iW <= $iWH And $iH <= $iWH Then $aRet[2] = $iW $aRet[3] = $iH $aRet[0] = ($iWH - $aRet[2]) / 2 $aRet[1] = ($iWH - $aRet[3]) / 2 ElseIf $iW > $iH Then $aRet[2] = $iWH $aRet[3] = $iH / ($iW / $iWH) $aRet[0] = 0 $aRet[1] = ($iWH - $aRet[3]) / 2 ElseIf $iW < $iH Then $aRet[2] = $iW / ($iH / $iWH) $aRet[3] = $iWH $aRet[0] = ($iWH - $aRet[2]) / 2 $aRet[1] = 0 ElseIf $iW = $iH Then $aRet[2] = $iWH $aRet[3] = $iWH $aRet[0] = 0 $aRet[1] = 0 EndIf Return $aRet EndFunc ;==>_GetScale Func _hBmpToPicControl($iCID, ByRef $hBmp, $iFlag = 0) Local $hOldBmp $hOldBmp = GUICtrlSendMsg($iCID, $STM_SETIMAGE, $IMAGE_BITMAP, $hBmp) If $hOldBmp Then _WinAPI_DeleteObject($hOldBmp) If $iFlag Then _WinAPI_DeleteObject($hBmp) EndFunc ;==>_hBmpToPicControl Func _GDIPlus_CreateHistogram($sRounding = "Ceiling") Local $iMaxL, $iMaxC, $iMaxR, $iMaxG, $iMaxB, $a, $r, $g, $b, $yR, $yG, $yB, $iRedAv, $iGreenAv, $iBlueAv For $i = 1 + $bIsAlpha To 256 If $bIsAlpha Then ;~ ConsoleWrite("Alpha: " & DllStructGetData($tStructChannel0, "channel0", $i) & @CRLF) $r = DllStructGetData($tStructChannel1, "channel1", $i) $yR = $r * $frY If DllStructGetData($tStructChannel1 , "channel1", $i) > $iMaxR Then $iMaxR = $r $g = DllStructGetData($tStructChannel2, "channel2", $i) $yG = $g * $fgY If DllStructGetData($tStructChannel2 , "channel2", $i) > $iMaxG Then $iMaxG = $g $b = DllStructGetData($tStructChannel3, "channel3", $i) $yB = $b * $fbY If DllStructGetData($tStructChannel3 , "channel3", $i) > $iMaxB Then $iMaxB = $b $fAverage_cRGB += $r + $g + $b $fAverage_L += $yR + $yG + $yB Else $r = DllStructGetData($tStructChannel0, "channel0", $i) $yR = $r * $frY If DllStructGetData($tStructChannel0 , "channel0", $i) > $iMaxR Then $iMaxR = $r $g = DllStructGetData($tStructChannel1, "channel1", $i) $yG = $g * $fgY If DllStructGetData($tStructChannel1 , "channel1", $i) > $iMaxG Then $iMaxG = $g $b = DllStructGetData($tStructChannel2, "channel2", $i) $yB = $b * $fbY If DllStructGetData($tStructChannel2 , "channel2", $i) > $iMaxB Then $iMaxB = $b EndIf $fAverage_cRGB += $r + $g + $b $fAverage_L += $yR + $yG + $yB $aLuminosity[$i] = $yR + $yG + $yB If $aLuminosity[$i] > $iMaxL Then $iMaxL = $aLuminosity[$i] $aCRGB[$i] = ($r + $g + $b) / 3 If $aCRGB[$i] > $iMaxC Then $iMaxC = $aCRGB[$i] Next $fAverage_cRGB /= 256 * 3 $fAverage_L /= 256 _GDIPlus_GraphicsClear($hCtxt_HL, 0xFFFFFFFF) _GDIPlus_GraphicsClear($hCtxt_HC, 0xFFFFFFFF) _GDIPlus_GraphicsClear($hCtxt_HR, 0xFFFFFFFF) _GDIPlus_GraphicsClear($hCtxt_HG, 0xFFFFFFFF) _GDIPlus_GraphicsClear($hCtxt_HB, 0xFFFFFFFF) Local $iDL = 1, $iDC = 1, $iDR = 1, $iDG = 1, $iDB = 1 Local $sRoundings = "Round,Ceiling,Floor," If Not StringInStr($sRoundings, $sRounding) Then $sRounding = "Ceiling" If $iMaxL > 128 Then ;~ $iDL = Ceiling($iMaxL / 128) $iDL = Execute($sRounding & "(" & $iMaxL / 128 & ")") Else $iDL = 1 / (128 / $iMaxL) EndIf If $iMaxC > 128 Then ;~ $iDC = Ceiling($iMaxC / 128) $iDC = Execute($sRounding & "(" & $iMaxC / 128 & ")") Else $iDC = 1 / (128 / $iMaxC) EndIf If $iMaxR > 128 Then ;~ $iDR = Ceiling($iMaxR / 128) $iDR = Execute($sRounding & "(" & $iMaxR / 128 & ")") Else $iDR = 1 / (128 / $iMaxR) EndIf If $iMaxG > 128 Then ;~ $iDG = Ceiling($iMaxG / 128) $iDG = Execute($sRounding & "(" & $iMaxG / 128 & ")") Else $iDG = 1 / (128 / $iMaxG) EndIf If $iMaxB > 128 Then ;~ $iDB = Ceiling($iMaxB / 128) $iDB = Execute($sRounding & "(" & $iMaxB / 128 & ")") Else $iDB = 1 / (128 / $iMaxB) EndIf For $i = 1 To 256 _GDIPlus_PenSetColor($hPen_H, 0xFF000000) _GDIPlus_GraphicsDrawLine($hCtxt_HL, $i - 1, 127, $i - 1, 127 - (Int($aLuminosity[$i] / $iDL)), $hPen_H) _GDIPlus_PenSetColor($hPen_H, 0xFF000000) _GDIPlus_GraphicsDrawLine($hCtxt_HC, $i - 1, 127, $i - 1, 127 - (Int($aCRGB[$i] / $iDC)), $hPen_H) _GDIPlus_PenSetColor($hPen_H, 0xFFB00000) If $bIsAlpha Then _GDIPlus_GraphicsDrawLine($hCtxt_HR, $i - 1, 127, $i - 1, 127 - (Int(DllStructGetData($tStructChannel1, "channel1", $i) / $iDR)), $hPen_H) _GDIPlus_PenSetColor($hPen_H, 0xFF00B000) _GDIPlus_GraphicsDrawLine($hCtxt_HG, $i - 1, 127, $i - 1, 127 - (Int(DllStructGetData($tStructChannel2, "channel2", $i) / $iDG)), $hPen_H) _GDIPlus_PenSetColor($hPen_H, 0xFF0000B0) _GDIPlus_GraphicsDrawLine($hCtxt_HB, $i - 1, 127, $i - 1, 127 - (Int(DllStructGetData($tStructChannel3, "channel3", $i) / $iDB)), $hPen_H) Else _GDIPlus_GraphicsDrawLine($hCtxt_HR, $i - 1, 127, $i - 1, 127 - (Int(DllStructGetData($tStructChannel0, "channel0", $i) / $iDR)), $hPen_H) _GDIPlus_PenSetColor($hPen_H, 0xFF00B000) _GDIPlus_GraphicsDrawLine($hCtxt_HG, $i - 1, 127, $i - 1, 127 - (Int(DllStructGetData($tStructChannel1, "channel1", $i) / $iDG)), $hPen_H) _GDIPlus_PenSetColor($hPen_H, 0xFF0000B0) _GDIPlus_GraphicsDrawLine($hCtxt_HB, $i - 1, 127, $i - 1, 127 - (Int(DllStructGetData($tStructChannel2, "channel2", $i) / $iDB)), $hPen_H) EndIf Next EndFunc ;==>_GDIPlus_CreateHistogram Func _GDIPlus_CreateColorGradient($sColorChannel, $iW, $iH, $bHBitmap = True) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) ;~ _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2) Local $hPen = _GDIPlus_PenCreate() _GDIPlus_PenSetLineJoin($hPen, $iLineJoinBevel) Local $i, $c For $i = 0 To $iW $c = Hex($i, 2) Switch $sColorChannel Case "L" _GDIPlus_PenSetColor($hPen, "0xFF" & $c & $c & $c) Case "C" _GDIPlus_PenSetColor($hPen, "0xFF" & $c & $c & $c) Case "R" _GDIPlus_PenSetColor($hPen, "0xFF" & $c & "0000") Case "G" _GDIPlus_PenSetColor($hPen, "0xFF00" & $c & "00") Case "B" _GDIPlus_PenSetColor($hPen, "0xFF0000" & $c) EndSwitch _GDIPlus_GraphicsDrawLine($hCtxt, $i, 0, $i, $iH, $hPen) Next _GDIPlus_GraphicsDispose($hCtxt) _GDIPlus_PenDispose($hPen) If $bHBitmap Then Local $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hHBmp EndIf Return $hBitmap EndFunc ;==>_GDIPlus_CreateColorGradient Func _GDIPlus_CreateCheckerboardTexture($iSquareSize = 80, $iCol1 = 0xFFECECEC, $iCol2 = 0xFFDFDFDF) Local $hPatternBitmap = _GDIPlus_BitmapCreateFromScan0(2 * $iSquareSize, 2 * $iSquareSize) Local $hCtxt = _GDIPlus_ImageGetGraphicsContext($hPatternBitmap) Local $hBrush0 = _GDIPlus_BrushCreateSolid($iCol1) Local $hBrush1 = _GDIPlus_BrushCreateSolid($iCol2) _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iSquareSize, $iSquareSize, $hBrush0) _GDIPlus_GraphicsFillRect($hCtxt, $iSquareSize, 0, $iSquareSize, $iSquareSize, $hBrush1) _GDIPlus_GraphicsFillRect($hCtxt, 0, $iSquareSize, $iSquareSize, $iSquareSize, $hBrush1) _GDIPlus_GraphicsFillRect($hCtxt, $iSquareSize, $iSquareSize, $iSquareSize, $iSquareSize, $hBrush0) Local $hTexture = _GDIPlus_TextureCreate($hPatternBitmap) _GDIPlus_GraphicsDispose($hCtxt) _GDIPlus_BitmapDispose($hPatternBitmap) _GDIPlus_BitmapDispose($hBrush0) _GDIPlus_BitmapDispose($hBrush1) Return $hTexture EndFunc ;==>_CreatePatternTexture GdipBitmapGetHistogram(), GdipBitmapGetHistogramSize() and 2 more GDI+ functions requires GDI+ v1.1 which means this will only run on Vista or higher operating systems. I hope the values are correct especially the value for luminosity. Br, UEZ
-
I have a bunch of SDL_Surfaces loaded into memory. I want to list them in a ComboBox. Using this code, I can load images to the combobox from file but not from existing SDL_Surface memory CODE ISN"T MEANT TO RUN ; Create combobox pic list example $aControl[$iControl_id][$eControl_data] = _GUICtrlComboBoxEx_Create($gui, $data_value, $data_x, $data_y, $data_w, $data_h, $CBS_DROPDOWNLIST) ; Image List for ComboboxEx Local $hImage = _GUIImageList_Create($gTile_w, $gTile_h, 6) ; Fill hImage with SDL_Surfaces stored in memory: aNPC_surf[scale][type][way][frame] For $i = 0 To 1 ; This works but only from file: ;_GUIImageList_AddBitmap($hImage, $gFolder_graphics & $gaWorld_info[$player.iWorld_cur][$eWi_filename] & "Tiles\" & $i & ".bmp") ; I've broken up a sprite sheet and want to insert into combobox from memory ;_GUIImageList_Add($hImage, $aNPC_surf[1][1][1][$i]) _GUIImageList_Add($hImage, _GDIPlus_BitmapCreateFromMemory($aNPC_surf[1][1][1][$i]), True) ;_GDIPlus_BitmapCreateFromMemory($aNPC_surf[1][1][1][$i]) ; Add the index number to combobox item _GUICtrlComboBoxEx_AddString($aControl[$eNPC_iPic_type][$eControl_data], $i, $i, $i) Next ; Set hImage list to combobox control _GUICtrlComboBoxEx_SetImageList($aControl[$eNPC_iPic_type][$eControl_data], $hImage) Anyone know if I can convert from SDL_Surface to hBitmap? Maybe I'm doing something else wrong. I've seen hBitmap converted to SDL_Surface but I don't really understand it yet: My full script can be found here:
-
- combobox
- comboboxex
-
(and 3 more)
Tagged with:
-
I am busy with building a solution for change monitoring of VOIP call program and to be properly automated means among others need for some limited OCR functionality. Current works of others are way too much overkill for this case what makes the need to build it myself. But to do it properly I significantly have to increase my knowledge about digital graphics management. For now I already have discovered here and there some mind blowing Autoit miracles what can be achieved with Windows own possibilities to manipulate that what is output to the monitor. And as far I can judge there are 2 options to process graphics without use of any external libraries like ImageMagick, FreeImage and so on. These are: WinAPI GDIPlus It is for me quite obvious to have various holes in general understanding of graphics and it is once more very clear what advantages gives consistent general study in 1 or another official institutions like University. Cause there you are introduced into certain domain of knowledge in a way which usually has been perfected over long period of time. So you are not overloaded by stuff which requires a certain amount of information to be initially clear for you. For example, before starting to solve physics you first learn to read, count and so on and then move to subjects like physics. Though in my case opportunity to study in such educational system I had only for 8 years, from my 7th to 15th year of age in the country that was falling apart now Ukraine but used to be USSR, was all what it was. After have immigrated to Netherlands possibilities to study further haven't occur. And this therefor causes often various implications when going deep in that or another field of practical knowledge acquiring for any needed physical result, like programming to perform enormous amount of tasks. In this particular case automating VOIP call program. Anyway, right now I think the best direction to move is to concentrate on as basic as possible image management and if someone would maybe explain in general what is a pixel will definitely help. Particularly I am very curious about how to do picture manipulations in Autoit. Especially would help a lot to produce eventually following functions: createImage($imageFileName, $width, $height, $color) readImagePixel($imageFileName, $x, $y) writeImagePixel($imageFileName, $x, $y) I do not know exactly how image is handled in computer but preferably above mentioned functions should deal with so far possible origin of graphics creation on computer. But nevertheless I definitely would love to hear any proposition for solution. The problem with explaining screenshots: VOIPConnect full Window Part of Window with control to monitor for changes Exact location of area where actual changes occur and have to be processed It comes down to a rectangle of approximately 51 pixel wide and 7 pixel high. In fact if I get to learn as far as to be able exactly read, write and compare 2 images consistently across different computers I could narrow down then even further the area to watch as little as a square of 2-5 pixels wide. To finish here is last detail about particularly no need for ultra fast solution at all. This because it is needed only once when it is first run on a new computer and to have to wait few minutes while it is being set instead of just a few seconds make no sence. This is it and what I too think to do beside this very particular case is to purify out beautiful generic Autoit functions for core image manipulation by using WinAPI or/and GDIPlus.
-
Hi all, I'm trying to find how to draw an image (create a label in mspaint) and save it as .bmp. And set it to be a wallpaper I also need to know what wallpaper is use now, for restore it when the script is closed. What is the best way to do it? Do I need Gdi+ for it? I use this code (which I found here in forum) to set a .bmp file as wallpaper: Func _ChangeWallpaper($sFile,$iType) ; Changes the wallpaper to $sFilename using $iType as: ; 1 Tiled ; 2 Centered ; 3 Stretched ; any other value (usually 0) unchanged ; ; Returns ; 0 if everything is allright. ; -1 if $sFile does not exist. @error is set to 1 ; -2 if £sFile is not a .bmp file. @error is set to 2 If Not FileExists($sFile) Then SetError(1) Return -1 EndIf If StringTrimLeft($sFile,StringInStr($sFile,'.',0,-1)) <> 'bmp' Then SetError(2) Return -2 EndIf Select Case $iType = 1 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','1') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 2 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 3 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','2') Case Else EndSelect RegWrite('HKCU\Control Panel\Desktop','Wallpaper','reg_sz',$sFile) DllCall("User32.dll","int","SystemParametersInfo","int",20,"int",0,"str",$sFile,"int",0) Return 0 EndFunc The flow that I understand should be: 1) Check what wallpaper is in use now. I can find the path to it by going to registry key named "wallpaper" here :[HKEY_CURRENT_USER\Control Panel\Desktop] 2) Create a file mspaint 3) Create a label with its properties (size,color) in this file 3) Save this file in some temporary directory 4) Set a created file as a wallpaper using the above code 5) When the script is closed restore the old wallpaper. So again, my question is how to create a .bmp file with label in it?
- 1 reply
-
- wallpapper
- mspaint
-
(and 3 more)
Tagged with:
-
Here a small function to mark a region on the desktop and capture that region to a bitmap handle or to the clipboard: #include-once #include <Clipboard.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WinAPIGdi.au3> #include <WindowsConstants.au3> #Region Example ;capture manual coordinates FileDelete(@ScriptDir & "\Captured.bmp") Global $hHBitmap = _WinAPI_MarkScreenRegionAndCapture(0, False, True, 0, 0, 99, 99) _WinAPI_SaveHBITMAPToFile(@ScriptDir & "\Captured.bmp", $hHBitmap) _WinAPI_DeleteObject($hHBitmap) If FileExists(@ScriptDir & "\Captured.bmp") Then ShellExecute(@ScriptDir & "\Captured.bmp") ;save the captured bitmap to a file FileDelete(@ScriptDir & "\Captured.bmp") Global $hHBitmap = _WinAPI_MarkScreenRegionAndCapture() _WinAPI_SaveHBITMAPToFile(@ScriptDir & "\Captured.bmp", $hHBitmap) _WinAPI_DeleteObject($hHBitmap) If FileExists(@ScriptDir & "\Captured.bmp") Then ShellExecute(@ScriptDir & "\Captured.bmp") ;copy captured bitmap to clipboard Switch _WinAPI_MarkScreenRegionAndCapture(1, True) Case 1 MsgBox($MB_ICONINFORMATION, "Information", "Marked region was properly captured to clipboard!", 30) Case 0 MsgBox($MB_ICONERROR, "ERROR", "An error has occured!", 30) EndSwitch #EndRegion ; #FUNCTION# ==================================================================================================================== ; Name ..........: _WinAPI_MarkScreenRegionAndCapture ; Description ...: Selected area on desktop will be captured and save to clipbord or GDI bitmap handle will be returned. ; Syntax ........: _WinAPI_MarkScreenRegionAndCapture([$iFillMode = 0[, $bClipboard = True]]) ; Parameters ....: $iFillMode - [optional] an integer value. Default is 0. ; 0: marked area filled with solid color ; 1: marked area filled with hatch pattern ($HS_DIAGCROSS) ; 2: marked area without any fill pattern / color - only red border ; $bClipboard - [optional] a boolean value. Default is False. If True then no GDI bitmap handle will be returned. ; If false then GDI bitmap handle will be returned. ; $bManual - [optional] a boolean value. Default is False. If True manual capturing is activated. ; $iX1 - [optional] an integer value. Default is 0. If $bManual is true enter the x1 screen pos. ; $iY1 - [optional] an integer value. Default is 0. If $bManual is true enter the Y1 screen pos. ; $iX2 - [optional] an integer value. Default is 0. If $bManual is true enter the x2 screen pos. ; $iY2 - [optional] an integer value. Default is 0. If $bManual is true enter the y2 screen pos. ; Return values .: 0 / 1 / -1 / GDI bitmap handle ; Author ........: UEZ ; Version .......: 0.92 build 2017-01-22 ; Modified ......: ; Remarks .......: Do not forget to dispose returned GDI bitmap handle for non clipboard mode using _WinAPI_DeleteObject! ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _WinAPI_MarkScreenRegionAndCapture($iFillMode = 0, $bClipboard = False, $bManual = False, $iX1 = 0, $iY1 = 0, $iX2 = 0, $iY2 = 0) If @OSBuild > 6299 Then ;https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx DllCall("Shcore.dll", "long", "PROCESS_DPI_AWARENESS", 1) ;PROCESS_SYSTEM_DPI_AWARE = 1 (https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx) Else DllCall("User32.dll", "bool", "SetProcessDPIAware") EndIf Local $iOld = AutoItSetOption("MouseCoordMode", 1) If Not $bManual Then Local Const $hDesktop = WinGetHandle("[TITLE:Program Manager;CLASS:Progman]") Local Const $aFullScreen = WinGetPos($hDesktop) ;should work also on multi screens Local Const $iW = $aFullScreen[2], $iH = $aFullScreen[3] Local Const $hGUI_Screencapture = GUICreate("", $iW, $iH, $aFullScreen[0], $aFullScreen[1], $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED)) GUISetState(@SW_SHOW, $hGUI_Screencapture) Local Const $hDC = _WinAPI_GetDC($hGUI_Screencapture) Local Const $hGfxDC = _WinAPI_CreateCompatibleDC($hDC) Local Const $hBitmapGDI = _WinAPI_CreateCompatibleBitmap($hDC, $iW, $iH) Local $hObjOld = _WinAPI_SelectObject($hGfxDC, $hBitmapGDI) Local $tSize = DllStructCreate($tagSIZE) $tSize.x = $iW $tSize.y = $iH Local $tSource = DllStructCreate($tagPOINT) Local $tBlend = DllStructCreate($tagBLENDFUNCTION) $tBlend.Alpha = 0xFF $tBlend.Format = 1 Local $tDest = DllStructCreate($tagPOINT), $pPoint = DllStructGetPtr($tDest) $tDest.x = $aFullScreen[0] $tDest.y = $aFullScreen[1] Local Const $hPen = _WinAPI_CreatePen($PS_SOLID, 1, 0x0000FF) Local Const $hPen_Orig = _WinAPI_SelectObject($hGfxDC, $hPen) Local $hBrush, $iAlpha2, $iFlag $iFillMode = $iFillMode > 2 ? 2 : $iFillMode < 0 ? 0 : $iFillMode Switch $iFillMode Case 0 $hBrush = _WinAPI_CreateBrushIndirect($BS_SOLID, 0x808080) $iAlpha2 = 0xA0 $iFlag = $ULW_ALPHA Case 1 $hBrush = _WinAPI_CreateBrushIndirect($BS_HATCHED, 0x808000, $HS_DIAGCROSS) $iAlpha2 = 0x30 $iFlag = $ULW_ALPHA Case 2 $hBrush = _WinAPI_CreateBrushIndirect($BS_HOLLOW, 0x000000) $iAlpha2 = 0xFF ;not needed $iFlag = $ULW_COLORKEY EndSwitch Local $hBrush_Orig = _WinAPI_SelectObject($hGfxDC, $hBrush) Else If Not BitOr($iX1, $iX2, $iY1, $iY2) Then Return SetError(4, 0, 0) EndIf Local $aMPos[5], $aMPos_old[4], $tRECT = _WinAPI_CreateRect(0, 0, 0, 0) Do If $bManual Then $aMPos[2] = 1 Else GUISetCursor(16, 1, $hGUI_Screencapture) $aMPos = GUIGetCursorInfo($hGUI_Screencapture) $aMPos_old[0] = $aMPos[0] $aMPos_old[1] = $aMPos[1] $aMPos_old[2] = MouseGetPos(0) $aMPos_old[3] = MouseGetPos(1) EndIf Switch $aMPos[2] Case 0 ;display crosshair _WinAPI_BitBlt($hGfxDC, 0, 0, $iW, $iH, $hGfxDC, 0, 0, $CAPTUREBLT) _WinAPI_DrawLine($hGfxDC, $tDest.x, $aMPos[1], $iW, $aMPos[1]) _WinAPI_DrawLine($hGfxDC, $aMPos[0], $tDest.y, $aMPos[0], $iH) _WinAPI_UpdateLayeredWindow($hGUI_Screencapture, $hDC, $tDest, $tSize, $hGfxDC, $tSource, 0, $tBlend, $ULW_COLORKEY) Case 1 ;capture selected region If Not $bManual Then $tBlend.Alpha = $iAlpha2 While $aMPos[2] ;mark region GUISetCursor(14, 1, $hGUI_Screencapture) ;WinGetHandle(AutoItWinGetTitle())) $aMPos = GUIGetCursorInfo($hGUI_Screencapture) _WinAPI_BitBlt($hGfxDC, 0, 0, $iW, $iH, $hGfxDC, 0, 0, $CAPTUREBLT) ;clear bitmap ;draw rectangle $tRECT.Left = $aMPos_old[0] $tRECT.Top = $aMPos_old[1] $tRECT.Right = $aMPos[0] $tRECT.Bottom = $aMPos[1] _WinAPI_Rectangle($hGfxDC, $tRECT) If $iFillMode <> 2 Then _WinAPI_InvertRect($hGfxDC, $tRECT) _WinAPI_UpdateLayeredWindow($hGUI_Screencapture, $hDC, $tDest, $tSize, $hGfxDC, $tSource, 0, $tBlend, $iFlag) Sleep(10) WEnd _WinAPI_SelectObject($hGfxDC, $hObjOld) _WinAPI_ReleaseDC($hGUI_Screencapture, $hDC) _WinAPI_DeleteDC($hGfxDC) _WinAPI_DeleteObject($hBitmapGDI) _WinAPI_SelectObject($hGfxDC, $hPen_Orig) _WinAPI_DeleteObject($hPen) _WinAPI_SelectObject($hGfxDC, $hBrush_Orig) _WinAPI_DeleteObject($hBrush) GUIDelete($hGUI_Screencapture) ;capture region $aMPos[0] = MouseGetPos(0) $aMPos[1] = MouseGetPos(1) Else $aMPos_old[2] = $iX1 $aMPos_old[3] = $iY1 $aMPos[0] = $iX2 $aMPos[1] = $iY2 EndIf Local Const $hDC_Region = _WinAPI_GetDC(0) Local Const $hMemDC = _WinAPI_CreateCompatibleDC($hDC_Region) Local Const $iW_Region = Abs($aMPos[0] - $aMPos_old[2]) + 1, $iH_Region = Abs($aMPos[1] - $aMPos_old[3]) + 1 Local $hHBitmap_Captured = _WinAPI_CreateCompatibleBitmap($hDC_Region, $iW_Region, $iH_Region) $hObjOld = _WinAPI_SelectObject($hMemDC, $hHBitmap_Captured) _WinAPI_BitBlt($hMemDC, 0, 0, $iW_Region, $iH_Region, $hDC_Region, _ $aMPos[0] > $aMPos_old[2] ? $aMPos_old[2] : $aMPos[0], _ $aMPos[1] > $aMPos_old[3] ? $aMPos_old[3] : $aMPos[1], BitOR($SRCCOPY, $CAPTUREBLT)) Local $hHBitmap_Clipboard = _WinAPI_CopyImage($hHBitmap_Captured, 0, 0, 0, BitOR($LR_COPYDELETEORG, $LR_COPYRETURNORG)) _WinAPI_SelectObject($hHBitmap_Captured, $hObjOld) _WinAPI_DeleteDC($hHBitmap_Captured) _WinAPI_ReleaseDC(0, $hDC_Region) AutoItSetOption("MouseCoordMode", $iOld) If $bClipboard Then ;put captured region to clipboard If Not _ClipBoard_Open(0) Then _WinAPI_DeleteObject($hHBitmap_Clipboard) Return SetError(1, 0, 0) EndIf If Not _ClipBoard_Empty() Then _WinAPI_DeleteObject($hHBitmap_Clipboard) Return SetError(2, 0, 0) EndIf Local Const $hCP = _ClipBoard_SetDataEx($hHBitmap_Clipboard, $CF_BITMAP) If Not $hCP Or @error Then _WinAPI_DeleteObject($hHBitmap_Clipboard) Return SetError(3, 0, 0) EndIf _ClipBoard_Close() _WinAPI_DeleteObject($hHBitmap_Clipboard) Return 1 Else Return $hHBitmap_Clipboard EndIf EndSwitch Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _WinAPI_SelectObject($hGfxDC, $hObjOld) _WinAPI_ReleaseDC($hGUI_Screencapture, $hDC) _WinAPI_DeleteDC($hGfxDC) _WinAPI_DeleteObject($hBitmapGDI) _WinAPI_SelectObject($hGfxDC, $hPen_Orig) _WinAPI_DeleteObject($hPen) GUIDelete($hGUI_Screencapture) AutoItSetOption("MouseCoordMode", $iOld) Return -1 EndSwitch Until False EndFunc ;==>_WinAPI_MarkScreenRegionAndCapture Might be useful... Download: _WinAPI_MarkScreenRegionAndCapture.au3 (same as above in the code box) Tested only on Win10 x64 but should work also on other Window versions. If not please reply.
-
Hey I'm not really familliar with GDI Plus , I am looking for how tocConvert a bitmap image to JPG in memory without saving it to disk Because I want to send it later via TCP directly without using FileRead and other stuff .. The only function I found is below but it saves the image in disk Func SaveBmp2JPG($Bitmap, $sSave = "Converted.jpg", $iQuality = 20) ;coded by UEZ 2013 If Not IsPtr($Bitmap) Then $Bitmap = _GDIPlus_ImageLoadFromFile($sFile) If @error Then Return SetError(1, 0, 0) EndIf Local $sCLSID = _GDIPlus_EncodersGetCLSID("JPG") Local $tParams = _GDIPlus_ParamInit(1) Local $tData = DllStructCreate("int Quality") Local $pData = DllStructGetPtr($tData) Local $pParams = DllStructGetPtr($tParams) DllStructSetData($tData, "Quality", $iQuality) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) If Not _GDIPlus_ImageSaveToFileEx($Bitmap, $sSave, $sCLSID, $pParams) Then Return SetError(2, 0, 0) Return True EndFunc what my code now looks like : #include <ScreenCapture.au3> #include <guiconstantsex.au3> #include <gdiplus.au3> #include <memory.au3> #include <staticconstants.au3> Global $ghGDIPDLL = $__g_hGDIPDll Example() Func Example() _GDIPlus_Startup() Local $hHBmp = _ScreenCapture_Capture("") ;create a GDI bitmap by capturing my desktop Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBmp) ;convert GDI bitmap to GDI+ bitmap _WinAPI_DeleteObject($hHBmp) ;release GDI bitmap resource because not needed anymore Local $hBitmap_Scaled2 = _GDIPlus_ImageResize($hBitmap, @DesktopWidth / 1.5, @DesktopHeight / 1.5) ;resize image SaveBmp2JPG($hBitmap_Scaled2,'Test.jpg',99) ; ===> Saving to disk ?? _GDIPlus_Shutdown() EndFunc ;==>Example Func SaveBmp2JPG($Bitmap, $sSave , $iQuality) ;coded by UEZ 2013 If Not IsPtr($Bitmap) Then $Bitmap = _GDIPlus_ImageLoadFromFile($sFile) If @error Then Return SetError(1, 0, 0) EndIf Local $sCLSID = _GDIPlus_EncodersGetCLSID("JPG") Local $tParams = _GDIPlus_ParamInit(1) Local $tData = DllStructCreate("int Quality") Local $pData = DllStructGetPtr($tData) Local $pParams = DllStructGetPtr($tParams) DllStructSetData($tData, "Quality", $iQuality) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) If Not _GDIPlus_ImageSaveToFileEx($Bitmap, $sSave, $sCLSID, $pParams) Then Return SetError(2, 0, 0) Return True EndFunc
- 17 replies
-
- screenshot
- gdiplus
-
(and 3 more)
Tagged with:
-
Do not expect a SVG file as Sodipodi, Inkscape or Adobe Illustrator can generate. This "converter" doesn't actually trace or convert the image to vector. It just embed the bitmap image within an SVG container. #Region ;************ Includes ************ #Include <GDIPlus.au3> #Include <Memory.au3> #EndRegion ;************ Includes ************ Global $_B64E_CodeBuffer, $_B64E_CodeBufferMemory, $_B64E_Init, $_B64E_EncodeData, $_B64E_EncodeEnd Global $sFile, $hImage, $iW, $iH, $sType, $hFile, $sBase64String, $sFileRead, $sSvgPath, $sString _GDIPlus_Startup() $sFile = FileOpenDialog ( 'Select an Image', @DesktopDir, 'Images (*.jpg;*.png;*.gif;*.bmp)', 1+2 ) If @error Then Exit $sType = _FileGetType ( $sFile ) If @error Then ConsoleWrite ( '! File Type not supported, error : ' & @error & @Crlf ) Else $hFile = FileOpen ( $sFile, 16 ) If $hFile=-1 Then Exit MsgBox ( 262144+4096+16, 'Error', 'Can not Access this file.', 4 ) $hImage = _GDIPlus_ImageLoadFromFile ( $sFile ) $iW = _GDIPlus_ImageGetWidth ( $hImage ) $iH = _GDIPlus_ImageGetHeight ( $hImage ) _GDIPlus_ImageDispose ( $hImage ) $sFileRead = FileRead ( $hFile ) FileClose ( $hFile ) $sBase64String = _Base64Encode ( $sFileRead, 4000 ) $sString = '<svg' & @CRLF & _ ' version="1.1"' & @CRLF & _ ' xmlns="http://www.w3.org/2000/svg"' & @CRLF & _ ' xmlns:xlink="http://www.w3.org/1999/xlink"' & @CRLF & _ ' width="' & $iW & 'px" height="' & $iH & 'px"' & @CRLF & _ ' viewBox="0 0 ' & $iW & ' ' & $iH & '" preserveAspectRatio="none">' & @CRLF & _ ' <g>' & @CRLF & _ '<image width="' & $iW & '" height="' & $iH & '" xlink:href="data:image/' & $sType & ';base64,' & @CRLF & _ $sBase64String & @CRLF & _ '"/>' & @CRLF & _ ' </g>' & @CRLF & _ '</svg>' & @CRLF $sSvgPath = @TempDir & '\' & @HOUR & @MIN & @SEC & @MSEC & '-' & $iW & 'x' & $iH & '.svg' $hFile = FileOpen ( $sSvgPath, 1+2+8 ) If $hFile = -1 Then MsgBox ( 262144+4096+16, '', 'An error occurred whilst writing the temporary file.' ) Else FileWrite ( $hFile, $sString ) FileClose ( $hFile ) ShellExecute ( 'iexplore.exe', $sSvgPath ) EndIf EndIf _GDIPlus_Shutdown() Exit Func _FileGetType ( $sFilePath ) If Not FileExists ( $sFilePath ) Then Return SetError ( -1 ) If FileGetSize ( $sFilePath ) = 0 Then Return SetError ( 1, 0, 0 ) Local $hFile, $Binary, $Ret $hFile = FileOpen ( $sFilePath, 16 ) If $hFile = -1 Then Return SetError ( 3, 0, 0 ) $Binary = FileRead ( $hFile ) FileClose ( $hFile ) Local $sString = StringTrimLeft ( $Binary, 2 ) Local $sStringLeft = StringReplace ( StringTrimLeft ( StringLeft ( $Binary, 14 ), 2 ), '00', '' ) Local $sStringLeft12 = StringLeft ( $sStringLeft, 12 ) Local $sStringLeft8 = StringLeft ( $sStringLeft, 8 ) Local $sStringLeft4 = StringLeft ( $sStringLeft, 4 ) Select Case $sStringLeft12 = '474946383961' Or $sStringLeft12 = '474946383761' $Ret = 'GIF' Case $sStringLeft4 = 'FFD8' $Ret = 'JPG' Case $sStringLeft4 = '424D' $Ret = 'BMP' Case $sStringLeft8 = '89504E47' $Ret = 'PNG' Case Else Return SetError ( 2, 0, '' ) EndSelect If $Ret = 'GIF' Then StringReplace ( $sString, '0021F904', '0021F904' ) If @extended > 1 Then Return SetError ( 3, 0, '' ) ; animated gif. EndIf Return $Ret EndFunc ;==> _FileGetType() Func _Base64E_Exit() ; by Ward $_B64E_CodeBuffer = 0 _MemVirtualFree ( $_B64E_CodeBufferMemory, 0, $MEM_RELEASE ) EndFunc ;==> _Base64E_Exit() Func _Base64Encode ( $Data, $LineBreak=76 ) ; by Ward Local $State = _Base64EncodeInit ( $LineBreak ) Return _Base64EncodeData ( $State, $Data ) & _Base64EncodeEnd ( $State ) EndFunc ;==> _Base64Encode() Func _Base64EncodeData ( ByRef $State, $Data ) ; by Ward If Not IsDllStruct ( $_B64E_CodeBuffer ) Or Not IsDllStruct ( $State ) Then Return SetError ( 1, 0, '' ) $Data = Binary ( $Data ) Local $InputLen = BinaryLen ( $Data ) Local $Input = DllStructCreate ( 'byte[' & $InputLen & ']' ) DllStructSetData ( $Input, 1, $Data ) Local $OputputLen = Ceiling ( BinaryLen ( $Data )*1.4 )+3 Local $Output = DllStructCreate ( 'char[' & $OputputLen & ']' ) DllCall ( 'user32.dll', 'int', 'CallWindowProc', 'ptr', DllStructGetPtr ( $_B64E_CodeBuffer )+$_B64E_EncodeData, 'ptr', DllStructGetPtr ( $Input ), 'uint', $InputLen, 'ptr', DllStructGetPtr ( $Output ), 'ptr', DllStructGetPtr ( $State ) ) Return DllStructGetData ( $Output, 1 ) EndFunc ;==> _Base64EncodeData() Func _Base64EncodeEnd ( ByRef $State ) ; by Ward If Not IsDllStruct ( $_B64E_CodeBuffer ) Or Not IsDllStruct ( $State ) Then Return SetError ( 1, 0, '' ) Local $Output = DllStructCreate ( 'char[5]' ) DllCall ( 'user32.dll', 'int', 'CallWindowProc', 'ptr', DllStructGetPtr ( $_B64E_CodeBuffer ) + $_B64E_EncodeEnd, 'ptr', DllStructGetPtr ( $Output ), 'ptr', DllStructGetPtr ( $State ), 'int', 0, 'int', 0 ) Return DllStructGetData ( $Output, 1 ) EndFunc ;==> _Base64EncodeEnd() Func _Base64EncodeInit ( $LineBreak=76 ) ; by Ward If Not IsDllStruct ( $_B64E_CodeBuffer ) Then If @AutoItX64 Then Local $Opcode = '0x89C08D42034883EC0885D2C70100000000C64104000F49C2C7410800000000C1F80283E20389410C740683C00189410C4883C408C389C94883EC3848895C242848897424304889CB8B0A83F901742083F9024889D87444C6000A4883C001488B74243029D8488B5C24284883C438C30FB67204E803020000BA3D0000004080FE3F7F08480FBEF60FB614308813C643013D488D4303C643023DEBBC0FB67204E8D7010000BA3D0000004080FE3F7F08480FBEF60FB614308813C643013D488D4302EB9489DB4883EC68418B014863D248895C242848897424304C89C348897C24384C896424484C89CE83F80148896C24404C896C24504C897424584C897C24604C8D2411410FB6790474434D89C64989CD0F82F700000083F8024C89C5747B31C0488B5C2428488B742430488B7C2438488B6C24404C8B6424484C8B6C24504C8B7424584C8B7C24604883C468C34C89C54989CF4D39E70F840B010000450FBE374D8D6F014489F025F0000000C1F80409C7E8040100004080FF3FBA3D0000007F08480FBEFF0FB614384489F78855004883C50183E70FC1E7024D39E50F84B2000000450FB675004983C5014489F025C0000000C1F80609C7E8BD0000004080FF3FBA3D0000007F08480FBEFF0FB61438BF3F0000008855004421F74C8D7502E896000000480FBED70FB604108845018B460883C0013B460C89460875104C8D7503C645020AC7460800000000904D39E5742E410FBE7D004D8D7D01498D6E01E8560000004889FA83E70348C1EA02C1E70483E23F0FB60410418806E913FFFFFF4489F040887E04C7060000000029D8E9CCFEFFFF89E840887E04C7060200000029D8E9B9FEFFFF89E840887E04C7060100000029D8E9A6FEFFFFE8400000004142434445464748494A4B4C4D4E4F505152535455565758595A6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435363738392B2F58C3' Else Local $Opcode = '0x89C08B4C24088B44240489CAC1FA1FC1EA1E01CAC1FA0283E103C70000000000C6400400C740080000000089500C740683C20189500CC2100089C983EC0C8B4C2414895C24048B5C2410897424088B1183FA01741D83FA0289D87443C6000A83C0018B74240829D88B5C240483C40CC210000FB67104E80C020000BA3D00000089F180F93F7F0989F20FBEF20FB6143088138D4303C643013DC643023DEBBD0FB67104E8DF010000BA3D00000089F180F93F7F0989F20FBEF20FB6143088138D4302C643013DEB9489DB83EC3C895C242C8B5C244C896C24388B542440897424308B6C2444897C24348B030FB6730401D583F801742D8B4C24488954241C0F820101000083F80289CF747D31C08B5C242C8B7424308B7C24348B6C243883C43CC210008B4C244889D739EF0F84400100008D57010FBE3F89542418894C241489F825F0000000C1F80409C6897C241CE8330100008B542418C644240C3D8B4C241489C789F03C3F7F0B0FBEF00FB604378844240C0FB644240C8D790188018B74241C83E60FC1E60239EA0F84CB0000000FB60A83C2018954241C89C825C0000000C1F80609C6884C2414E8D8000000BA3D0000000FB64C24148944240C89F03C3F7F0B0FBEF08B44240C0FB6143083E13F881789CEE8AD00000089F10FBED18D4F020FB604108847018B430883C0013B430C894308750EC647020A8D4F03C7430800000000396C241C743A8B44241C8B7C241C0FBE30894C241483C701E8650000008B4C241489F283E60381E2FC000000C1EA02C1E6040FB60410880183C101E9E4FEFFFF89F088430489C8C703000000002B442448E9B2FEFFFF89F189F8884B04C703020000002B442448E99CFEFFFF89F088430489C8C703010000002B442448E986FEFFFFE8400000004142434445464748494A4B4C4D4E4F505152535455565758595A6162636465666768696A6B6C6D6E6F707172737475767778797A303132333435363738392B2F58C3' EndIf $_B64E_Init = ( StringInStr ( $Opcode, '89C0' )-3 ) / 2 $_B64E_EncodeData = ( StringInStr ( $Opcode, '89DB' )-3 ) / 2 $_B64E_EncodeEnd = ( StringInStr ( $Opcode, '89C9' )-3 ) / 2 $Opcode = Binary ( $Opcode ) $_B64E_CodeBufferMemory = _MemVirtualAlloc ( 0, BinaryLen ( $Opcode ), $MEM_COMMIT, $PAGE_EXECUTE_READWRITE ) $_B64E_CodeBuffer = DllStructCreate ( 'byte[' & BinaryLen ( $Opcode ) & ']', $_B64E_CodeBufferMemory ) DllStructSetData ( $_B64E_CodeBuffer, 1, $Opcode ) OnAutoItExitRegister ( '_Base64E_Exit' ) EndIf Local $State = DllStructCreate ( 'byte[16]' ) DllCall ( 'user32.dll', 'none', 'CallWindowProc', 'ptr', DllStructGetPtr ( $_B64E_CodeBuffer )+$_B64E_Init, 'ptr', DllStructGetPtr ( $State ), 'uint', $LineBreak, 'int', 0, 'int', 0 ) Return $State EndFunc ;==> _Base64EncodeInit() Thanks to Ward for his Base64 functions.
-
Here's the goal: Create a handle to a bitmap object using _WinApi_PrintWindow (this is done and working properly, I can take a screenshot of the window even when it's hidden or offscreen, does not work minimized)Be able to search for a pixel color in memory on the handle. I can get it to work if I create a Bitmap from an HBITMAP (_GDIPlus_BitmapCreateFromHBITMAP) and then go through each pixel and check it using _GDIPlus_BitmapGetPixel but it's too slow. I've tried doing the _WinApi_GetPIxel using an $hDC but it's much slower than GDI+ (GD+ takes about 20seconds to search for almost 500,000 pixels, GetPixel takes almost 60seconds)I found the FastFind library but, honestly, it's sloppy and I'm wanting to search a defined area, not set the starting position and then search the rest of the window. I also found a few examples on the forums but I could not get them to work. Here's the CaptureWindow function. I'm only wanting to capture the client area (Not the border around the client, hence the -16 for the width and the -38 for the height, gets rid of the title bar and the resize bars on the sides. Also I'm wanting to keep the coordinates relative to the window, so if you only want to capture the screen from 480, 200 to 680, 400, then the rest of the area is black on purpose) #include-once Func CaptureWindow(Const $iLeft = 0, Const $iTop = 0, Const $iWidth = -1, Const $iHeight = -1, Const $hWindow = WinGetHandle("[Active]")) Local $rect_window = WinGetPos($hWindow) Local $hDC = _WinAPI_GetWindowDC($hWindow) Local $hDestDC = _WinAPI_CreateCompatibleDC($hDC) Local $hBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $rect_window[2] - 16, $rect_window[3] - 38) Local $hDestSv = _WinAPI_SelectObject($hDestDC, $hBitmap) Local $hSrcDC = _WinAPI_CreateCompatibleDC($hDC) Local $hBmp = _WinAPI_CreateCompatibleBitmap($hDC, $rect_window[2] - 16, $rect_window[3] - 38) Local $hSrcSv = _WinAPI_SelectObject($hSrcDC, $hBmp) _WinAPI_PrintWindow($hWindow, $hSrcDC, True) If ($iWidth > 0 and $iHeight > 0) Then _WinAPI_BitBlt($hDestDC, $iLeft, $iTop, $iWidth, $iHeight, $hSrcDC, $iLeft, $iTop, $MERGECOPY) Else _WinAPI_BitBlt($hDestDC, $iLeft, $iTop, $rect_window[2] - 16 - $iLeft, $rect_window[3] - 38 - $iTop, $hSrcDC, $iLeft, $iTop, $MERGECOPY) EndIf _WinAPI_SelectObject($hDestDC, $hDestSv) _WinAPI_SelectObject($hSrcDC, $hSrcSv) _WinAPI_ReleaseDC($hWindow, $hDC) _WinAPI_DeleteDC($hDestDC) _WinAPI_DeleteDC($hSrcDC) _WinAPI_DeleteObject($hBmp) Return $hBitmap EndFunc ;==>CaptureWindowAnd the first attempt for PixelSearch, using GDI+ (Fastest) Func PixelSearchInhBitmap(Const ByRef $hHBmp, Const ByRef $color, Const $tolerance = 10, Const $iLeft = 0, Const $iTop = 0, $iWidth = -1, $iHeight = -1, Const $iStep = 1) Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBmp) Local $rbg_color = _ColorGetRGB("0x" & Hex($color, 6)) Local $found_color = False Local $abscoord_color[2] = [0, 0] Local $red_low = 0 Local $green_low = 0 Local $blue_low = 0 Local $red_high = 0 Local $green_high = 0 Local $blue_high = 0 $red_low = ($tolerance > $rbg_color[0] ? 0 : $rbg_color[0] - $tolerance) $green_low = ($tolerance > $rbg_color[1] ? 0 : $rbg_color[1] - $tolerance) $blue_low = ($tolerance > $rbg_color[2] ? 0 : $rbg_color[2] - $tolerance) $red_high = ($tolerance > 255 - $rbg_color[0] ? 255 : $rbg_color[0] + $tolerance) $green_high = ($tolerance > 255 - $rbg_color[1] ? 255 : $rbg_color[1] + $tolerance) $blue_high = ($tolerance > 255 - $rbg_color[2] ? 255 : $rbg_color[2] + $tolerance) If ($iWidth = -1) Then $iWidth = _GDIPlus_ImageGetWidth($hBitmap) If ($iHeight = -1) Then $iHeight = _GDIPlus_ImageGetHeight($hBitmap) Local $start_time = TimerInit() For $iY = $iTop To $iHeight Step $iStep For $iX = $iLeft To $iWidth Step $iStep Local $get_pixel = _GDIPlus_BitmapGetPixel($hBitmap, $iX, $iY) If (@Error) Then ContinueLoop Local $pixel_color = _ColorGetRGB("0x" & Hex($get_pixel, 6)) If (@Error) Then ContinueLoop If (($pixel_color[0] >= $red_low and $pixel_color[0] <= $red_high) and ($pixel_color[1] >= $green_low and $pixel_color[1] <= $green_high) and ($pixel_color[2] >= $blue_low and $pixel_color[2] <= $blue_high)) Then $found_color = True $abscoord_color[0] = $iX $abscoord_color[1] = $iY ExitLoop 2 EndIf Next Next MsgBox("", "", TimerDiff($start_time) / 1000) _GDIPlus_BitmapDispose($hBitmap) If ($found_color) Then Return $abscoord_color Else Return SetError(-1, 0, 0) EndIf EndFuncSecond attempt using _WInApi_GetPixel (Note. I replaced the Autoit function with my own where I replaced the string "gdi32.dll" with a handle to the opened DLL. In the hopes it would improve time. The time difference was not noticable) Global $HWND_DLL_GDI32 = DLLopen("gdi32.dll") Func PixelSearchInhDC(Const ByRef $color, Const $tolerance = 10, Const $iLeft = 0, Const $iTop = 0, $iWidth = -1, $iHeight = -1, Const $iStep = 1, Const $hWnd_window = WinGetHandle("[Active]")) Local $hDC = _WinAPI_GetWindowDC($hWnd_window) Local $rbg_color = _ColorGetRGB("0x" & Hex($color, 6)) Local $found_color = False Local $abscoord_color[2] = [0, 0] Local $start_time, $end_time Local $red_low = 0 Local $green_low = 0 Local $blue_low = 0 Local $red_high = 0 Local $green_high = 0 Local $blue_high = 0 If (Not $hDC) Then Return SetError(1, 0, 0) EndIf If ($iWidth = -1 or $iHeight = -1) Then Local $rect_window = WinGetPos($hWnd_window) If ($iWidth = -1) Then $iWidth = $rect_window[2] - $iLeft If ($iHeight = -1) Then $iHeight = $rect_window[3] - $iTop EndIf $red_low = ($tolerance > $rbg_color[0] ? 0 : $rbg_color[0] - $tolerance) $green_low = ($tolerance > $rbg_color[1] ? 0 : $rbg_color[1] - $tolerance) $blue_low = ($tolerance > $rbg_color[2] ? 0 : $rbg_color[2] - $tolerance) $red_high = ($tolerance > 255 - $rbg_color[0] ? 255 : $rbg_color[0] + $tolerance) $green_high = ($tolerance > 255 - $rbg_color[1] ? 255 : $rbg_color[1] + $tolerance) $blue_high = ($tolerance > 255 - $rbg_color[2] ? 255 : $rbg_color[2] + $tolerance) $start_time = TimerInit() For $iY = $iTop To $iHeight Step $iStep For $iX = $iLeft To $iWidth Step $iStep Local $get_pixel = __WinAPI_GetPixel($hDC, $iX, $iY) If (@Error) Then ContinueLoop Local $pixel_color = _ColorGetRGB("0x" & Hex($get_pixel, 6)) If (@Error) Then ContinueLoop If (($pixel_color[0] >= $red_low and $pixel_color[0] <= $red_high) and ($pixel_color[1] >= $green_low and $pixel_color[1] <= $green_high) and ($pixel_color[2] >= $blue_low and $pixel_color[2] <= $blue_high)) Then $found_color = True $abscoord_color[0] = $iX $abscoord_color[1] = $iY ExitLoop 2 EndIf Next Next MsgBox("", "", TimerDiff($start_time) / 1000 & "s") If ($found_color) Then Return $abscoord_color Else Return SetError(1, 0, 0) EndIf EndFunc Func __WinAPI_GetPixel($hDC, $iX, $iY) Local $aRet = DllCall($HWND_DLL_GDI32, 'dword', 'GetPixel', 'handle', $hDC, 'int', $iX, 'int', $iY) If @error Or ($aRet[0] = 4294967295) Then Return SetError(@error, @extended, -1) ; If $aRet[0] = 4294967295 Then Return SetError(1000, 0, -1) Return __RGB($aRet[0]) EndFunc ;==>__WinAPI_GetPixel
-
I have lot's of images like this http://postimg.org/image/uz24d8z27/ http://postimg.org/image/5isx6mc61/ i would like to crop the page number (the arabic number on the top of the page) so it would be something like this ... any ideas ?
-
As already annouced in >this topic here the GUI version of the GDI+ v1.1 color effects. GDI+ Color Transformer.au3: ;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 the program in compiled pe format (exe) must be free of any fee! ;~ #AutoIt3Wrapper_AutoIt3Dir=c:\Program Files (x86)\AutoIt3\3.3.8.1\ ;~ #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Icon=Color_32x32.ico #AutoIt3Wrapper_Res_Field=CompanyName|UEZ Software Development #AutoIt3Wrapper_Res_Field=ProductName|GDI+ Color Transformer #AutoIt3Wrapper_Res_Field=ProductVersion|%AutoItVer% #AutoIt3Wrapper_Res_Fileversion=0.9.7.0 #AutoIt3Wrapper_Res_Field=Build|2016-04-23 #AutoIt3Wrapper_Res_LegalCopyright=UEZ Software Development #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_Res_Field=URL|http://www.autoitscript.com/forum/index.php?showtopic=151155 #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_UPX_Parameters=--best --lzma #include <Clipboard.au3> #include <Constants.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <GUIMenu.au3> #include <Misc.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> Global $iResult = _GDIPlus_Startup() If @error Then If @error = 2 Or @extended < 6 Then Global $sUrl = "http://www.winsxs.org/?OtherTech/thread-13-1-1" Global $iChoice = MsgBox(4 + 16 + 262144, "Error", _ "GDIPlus.dll v1.1 is needed to run this script properly!" & @CRLF & _ "How to use GDI+ v1.1 e.g. on WinXP: " & $sUrl & @CRLF & @CRLF & "Open site with default browser?") If $iChoice = 6 Then ShellExecute($sUrl) Exit Else Exit MsgBox(16 + 262144, "Error", "Cannot initialize GDI+", 120) Endif EndIf Global Const $ghGDIPDll = $__g_hGDIPDll DllCall("Kernel32.dll", "long", "SetProcessDEPPolicy", "long", False) ;disable DEP for this process Global $tRECTF = DllStructCreate($tagGDIPRECTF) DllStructSetData($tRECTF, "X", 0) DllStructSetData($tRECTF, "Y", 0) Global Enum $iAdjustExposure = 0, $iAdjustDensity, $iAdjustContrast, $iAdjustHighlight, $iAdjustShadow, _ ;http://msdn.microsoft.com/en-us/library/windows/desktop/ms534098(v=vs.85).aspx $iAdjustMidtone, $iAdjustWhiteSaturation, $iAdjustBlackSaturation Global Enum $iCurveChannelAll = 0, $iCurveChannelRed, $iCurveChannelGreen, $iCurveChannelBlue ;http://msdn.microsoft.com/en-us/library/windows/desktop/ms534100(v=vs.85).aspx Global $iType = $iAdjustExposure, $iChannel = $iCurveChannelAll Global $bUpdatePreview = False Global $hGUI = GUICreate("GDI+ Color Transformer by UEZ v0.9.7 build 2016-04-23", 1200, 690, -1, -1, Default, $WS_EX_TOPMOST + $WS_EX_ACCEPTFILES) GUISetFont(12, 400, 0, "Times New Roman") GUISetBkColor(0xFFFFFF, $hGUI) Global $iTab = GUICtrlCreateTab(824, 232, 369, 393, $TCS_MULTILINE, $TCS_EX_FLATSEPARATORS) Global $iSlider_BWThreshold_Default = 50, $iSlider_BlurRadius_Default = 0, $iSlider_BCBrightness_Default = 0, $iSlider_BCContrast_Default = 0, _ $iSlider_CBCyanRed_Default = 0, $iSlider_CBMagentaGreen_Default = 0, $iSlider_CBYellowBlue_Default = 0, _ $iSlider_CMRed_Default = 100, $iSlider_CMGreen_Default = 100, $iSlider_CMBlue_Default = 100, $iSlider_SharpenRadius_Default = 0, $iSlider_SharpenAmount_Default = 0, _ $iSlider_HSLLightnLevel_Default = 0, $iSlider_HSLHueLevel_Default = 0, $iSlider_HSLSatLevel_Default = 0, _ $iSlider_LevelsShadow_Default = 0, $iSlider_LevelsHighlight_Default = 100, $iSlider_LevelsMidtone_Default = 0, _ $iSlider_TintHue_Default = 0, $iSlider_TintAmount_Default = 0, _ $iSlider_GSLumRed_Default = 31, $iSlider_GSLumGreen_Default = 61, $iSlider_GSLumBlue_Default = 8 Global $GDIP__RLUM = $iSlider_GSLumRed_Default / 100, $GDIP__GLUM = $iSlider_GSLumGreen_Default / 100, $GDIP__BLUM = $iSlider_GSLumBlue_Default / 100; ; Colors luminace Global $iTabSelection = 0, $iBGDefColor = 0xFFFFFF #Region Tabs #Region B/W Global $iBW = GUICtrlCreateTabItem("Black / White") Global $iLabel_BWThreshold = GUICtrlCreateLabel("Threshold", 837, 411, 93, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_BWThreshold = GUICtrlCreateSlider(837, 443, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, $iSlider_BWThreshold_Default) GUICtrlSetTip(-1, "Range is from 0 to 1") Global $hSlider_BWThreshold = GUICtrlGetHandle($iSlider_BWThreshold) Global $iInp_BWThreshold = GUICtrlCreateInput(StringFormat("%04.2f", $iSlider_BWThreshold_Default / 100), 1126, 455, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) #EndRegion B/W #Region Blur Global $iBlur = GUICtrlCreateTabItem("Blur") ;~ GUICtrlSetState(-1, $GUI_SHOW) Global $iCheckbox_BlurExpandEdge = GUICtrlCreateCheckbox("Expand Edge", 838, 381, 177, 25) GUICtrlSetFont(-1, 12, 400, 0, "Arial") GUICtrlSetTip(-1, "If set, the bitmap expands by an amount equal to the radius so that it can have soft edges." & @CRLF & _ "the bitmap remains the same size and the soft edges are clipped.") Global $iLabel_BlurRadius = GUICtrlCreateLabel("Radius", 838, 445, 64, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_BlurRadius = GUICtrlCreateSlider(838, 477, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetLimit(-1, 255, 0) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetTip(-1, "Range is from 0 to 255") GUICtrlSetData(-1, $iSlider_BlurRadius_Default) Global $hSlider_BlurRadius = GUICtrlGetHandle($iSlider_BlurRadius) Global $iInp_BlurRadius = GUICtrlCreateInput($iSlider_BlurRadius_Default, 1126, 489, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) #EndRegion Blur #Region BC Global $iBC = GUICtrlCreateTabItem("Brightness / Contrast") Global $iLabel_BCBrightness = GUICtrlCreateLabel("Brightness", 838, 377, 99, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_BCBrightness = GUICtrlCreateSlider(838, 409, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetLimit(-1, 255, -255) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetTip(-1, "Range is from -255 to 255") GUICtrlSetData(-1, $iSlider_BCBrightness_Default) Global $hSlider_BCBrightness = GUICtrlGetHandle($iSlider_BCBrightness) Global $iInp_BCBrightness = GUICtrlCreateInput($iSlider_BCBrightness_Default, 1126, 421, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) Global $iLabel_BCContrast = GUICtrlCreateLabel("Contrast", 838, 504, 80, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_BCContrast = GUICtrlCreateSlider(838, 541, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetLimit(-1, 100, -100) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetTip(-1, "Range is from -100 to 100") GUICtrlSetData(-1, $iSlider_BCContrast_Default) Global $hSlider_BCContrast = GUICtrlGetHandle($iSlider_BCContrast) Global $iInp_BCContrast = GUICtrlCreateInput($iSlider_BCContrast_Default, 1126, 553, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) #EndRegion BC #Region CB Global $iCB = GUICtrlCreateTabItem("Color Balance") Global $iLabel_CBCyanRed = GUICtrlCreateLabel("Cyan Red", 838, 355, 87, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_CBCyanRed = GUICtrlCreateSlider(838, 387, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetLimit(-1, 100, -100) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetData(-1, $iSlider_CBCyanRed_Default) GUICtrlSetTip(-1, "Range is from -100 to 100") Global $hSlider_CBCyanRed = GUICtrlGetHandle($iSlider_CBCyanRed) Global $iInp_CBCyanRed = GUICtrlCreateInput($iSlider_CBCyanRed_Default, 1126, 399, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) Global $iLabel_CBMagentaGreen = GUICtrlCreateLabel("Magenta Green", 838, 445, 139, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_CBMagentaGreen = GUICtrlCreateSlider(838, 477, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetLimit(-1, 100, -100) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetData(-1, $iSlider_CBMagentaGreen_Default) GUICtrlSetTip(-1, "Range is from -100 to 100") Global $hSlider_CBMagentaGreen = GUICtrlGetHandle($iSlider_CBMagentaGreen) Global $iInp_CBMagentaGreen = GUICtrlCreateInput($iSlider_CBMagentaGreen_Default, 1126, 489, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) Global $iLabel_CBYellowBlue = GUICtrlCreateLabel("Yellow Blue", 838, 535, 107, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_CBYellowBlue = GUICtrlCreateSlider(838, 567, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetLimit(-1, 100, -100) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetData(-1, $iSlider_CBYellowBlue_Default) GUICtrlSetTip(-1, "Range is from -100 to 100") Global $hSlider_CBYellowBlue = GUICtrlGetHandle($iSlider_CBYellowBlue) Global $iInp_CBYellowBlue = GUICtrlCreateInput($iSlider_CBYellowBlue_Default, 1126, 579, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) #EndRegion CB #Region CC Global $iCC = GUICtrlCreateTabItem("Color Curve") Global $iLabel_CCCurveAdjust = GUICtrlCreateLabel("Curve Adjustments", 838, 355, 171, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlCreateGroup("", 0, 0, 0, 0) Global $iRadio_CCExposure = GUICtrlCreateRadio("Exposure", 837, 387, 73, 17) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlSetState(-1, $GUI_CHECKED) Global $iRadio_CCDensity = GUICtrlCreateRadio("Density", 927, 387, 73, 17) GUICtrlSetFont(-1, 8, 400, 0, "Arial") Global $iRadio_CCContrast = GUICtrlCreateRadio("Contrast", 1017, 387, 73, 17) GUICtrlSetFont(-1, 8, 400, 0, "Arial") Global $iRadio_CCHighlight = GUICtrlCreateRadio("Highlight", 1107, 387, 65, 17) GUICtrlSetFont(-1, 8, 400, 0, "Arial") Global $iRadio_CCShadow = GUICtrlCreateRadio("Shadow", 837, 411, 73, 17) GUICtrlSetFont(-1, 8, 400, 0, "Arial") Global $iRadio_CCMidtone = GUICtrlCreateRadio("Midtone", 927, 411, 73, 17) GUICtrlSetFont(-1, 8, 400, 0, "Arial") Global $iRadio_CCWhiteSaturation = GUICtrlCreateRadio("White Satur.", 1017, 411, 81, 17) GUICtrlSetFont(-1, 8, 400, 0, "Arial") Global $iRadio_CCBlackSaturation = GUICtrlCreateRadio("Black Satur.", 1107, 411, 73, 17) GUICtrlSetFont(-1, 8, 400, 0, "Arial") Global $iLabel_CCCurveChannel = GUICtrlCreateLabel("Curve Channel", 838, 445, 132, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("", 0, 0, 0, 0) Global $iRadio_CCCurveAllChannel = GUICtrlCreateRadio("All Channel", 837, 477, 73, 17) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlSetState(-1, $GUI_CHECKED) Global $iRadio_CCCurveRed = GUICtrlCreateRadio("Red", 927, 477, 73, 17) GUICtrlSetFont(-1, 8, 400, 0, "Arial") Global $iRadio_CCCurveGreen = GUICtrlCreateRadio("Green", 1017, 477, 73, 17) GUICtrlSetFont(-1, 8, 400, 0, "Arial") Global $iRadio_CCCurveBlue = GUICtrlCreateRadio("Blue", 1107, 477, 65, 17) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlCreateGroup("", -99, -99, 1, 1) Global $iLabel_CCValue = GUICtrlCreateLabel("Value", 838, 535, 54, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_CCValue = GUICtrlCreateSlider(838, 567, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 255, -255) GUICtrlSetData(-1, 0) GUICtrlSetTip(-1, "Range is from -255 to 255") Global $hSlider_CCValue = GUICtrlGetHandle($iSlider_CCValue) Global $iInp_CCValue = GUICtrlCreateInput(0, 1126, 579, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) #EndRegion CC #Region CLUT Global $iCL = GUICtrlCreateTabItem("Color LUT") Global $iLabel_CLUT = GUICtrlCreateLabel("Coming soon!", 838, 425, 340, 60) GUICtrlSetFont(-1, 34, 400, 0, "Arial Black", 4) GUICtrlSetBkColor(-1, 0xFFFFFF) #EndRegion CLUT #Region CM Global $iCM = GUICtrlCreateTabItem("Color Matrix") Global $iLabel_CMRed = GUICtrlCreateLabel("Red", 838, 355, 38, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_CMRed = GUICtrlCreateSlider(838, 387, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, $iSlider_CMRed_Default) GUICtrlSetTip(-1, "Range is from 0 to 1") Global $hSlider_CMRed = GUICtrlGetHandle($iSlider_CMRed) Global $iInp_CMRed = GUICtrlCreateInput(StringFormat("%04.2f", $iSlider_CMRed_Default / 100), 1126, 399, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) Global $iLabel_CMGreen = GUICtrlCreateLabel("Green", 838, 445, 57, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_CMGreen = GUICtrlCreateSlider(838, 477, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, $iSlider_CMGreen_Default) GUICtrlSetTip(-1, "Range is from 0 to 1") Global $hSlider_CMGreen = GUICtrlGetHandle($iSlider_CMGreen) Global $iInp_CMGreen = GUICtrlCreateInput(StringFormat("%04.2f", $iSlider_CMGreen_Default / 100), 1126, 489, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) Global $iLabel_CMBlue = GUICtrlCreateLabel("Blue", 838, 535, 43, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_CMBlue = GUICtrlCreateSlider(838, 567, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, $iSlider_CMBlue_Default) GUICtrlSetTip(-1, "Range is from 0 to 1") Global $hSlider_CMBlue = GUICtrlGetHandle($iSlider_CMBlue) Global $iInp_CMBlue = GUICtrlCreateInput(StringFormat("%04.2f", $iSlider_CMBlue_Default / 100), 1126, 579, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) #EndRegion CM #Region Greyscale Global $iGreyscale = GUICtrlCreateTabItem("Greyscale") Global $iLabel_GSLumRed = GUICtrlCreateLabel("Luminance Red", 838, 355, 138, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_GSLumRed = GUICtrlCreateSlider(838, 387, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, $iSlider_GSLumRed_Default) GUICtrlSetTip(-1, "Range is from 0 to 1") Global $hSlider_GSLumRed = GUICtrlGetHandle($iSlider_GSLumRed) Global $iInp_GSLumRed = GUICtrlCreateInput(StringFormat("%04.2f", $iSlider_GSLumRed_Default / 100), 1126, 399, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) Global $iLabel_GSLumGreen = GUICtrlCreateLabel("Luminance Green", 838, 445, 157, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_GSLumGreen = GUICtrlCreateSlider(838, 477, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, $iSlider_GSLumGreen_Default) GUICtrlSetTip(-1, "Range is from 0 to 1") Global $hSlider_GSLumGreen = GUICtrlGetHandle($iSlider_GSLumGreen) Global $iInp_GSLumGreen = GUICtrlCreateInput(StringFormat("%04.2f", $iSlider_GSLumGreen_Default / 100), 1126, 489, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) Global $iLabel_GSLumBlue = GUICtrlCreateLabel("Luminance Blue", 838, 535, 143, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_GSLumBlue = GUICtrlCreateSlider(838, 567, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, $iSlider_GSLumBlue_Default) GUICtrlSetTip(-1, "Range is from 0 to 1") Global $hSlider_GSLumBlue = GUICtrlGetHandle($iSlider_GSLumBlue) Global $iInp_GSLumBlue = GUICtrlCreateInput(StringFormat("%04.2f", $iSlider_GSLumBlue_Default / 100), 1126, 579, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) #EndRegion Greyscale #Region HSL Global $iHSL = GUICtrlCreateTabItem("Hue / Sat. / Lightn.") Global $iLabel_HSLHueLevel = GUICtrlCreateLabel("Hue Level", 838, 355, 92, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_HSLHueLevel = GUICtrlCreateSlider(838, 387, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetLimit(-1, 180, -180) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetData(-1, $iSlider_HSLHueLevel_Default) GUICtrlSetTip(-1, "Range is from -180 to 180") Global $hSlider_HSLHueLevel = GUICtrlGetHandle($iSlider_HSLHueLevel) Global $iInp_HSLHueLevel = GUICtrlCreateInput($iSlider_HSLHueLevel_Default, 1126, 399, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) Global $iLabel_HSLSatLevel = GUICtrlCreateLabel("Saturation Level", 838, 445, 150, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_HSLSatLevel = GUICtrlCreateSlider(838, 477, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetLimit(-1, 100, -100) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetData(-1, $iSlider_HSLSatLevel_Default) GUICtrlSetTip(-1, "Range is from -100 to 100") Global $hSlider_HSLSatLevel = GUICtrlGetHandle($iSlider_HSLSatLevel) Global $iInp_HSLSatLevel = GUICtrlCreateInput($iSlider_HSLSatLevel_Default, 1126, 489, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) Global $iLabel_HSLLightnLevel = GUICtrlCreateLabel("Lightness Level", 838, 535, 144, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_HSLLightnLevel = GUICtrlCreateSlider(838, 567, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetLimit(-1, 100, -100) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 100, -100) GUICtrlSetData(-1, $iSlider_HSLLightnLevel_Default) GUICtrlSetTip(-1, "Range is from -100 to 100") Global $hSlider_HSLLightnLevel = GUICtrlGetHandle($iSlider_HSLLightnLevel) Global $iInp_HSLLightnLevel = GUICtrlCreateInput($iSlider_HSLLightnLevel_Default, 1126, 579, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) #EndRegion HSL #Region Levels Global $iLevels = GUICtrlCreateTabItem("Levels") Global $iLabel_LevelsHighlight = GUICtrlCreateLabel("Highlight", 838, 355, 83, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_LevelsHighlight = GUICtrlCreateSlider(838, 387, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, $iSlider_LevelsHighlight_Default) GUICtrlSetTip(-1, "Range is from 0 to 100") Global $hSlider_LevelsHighlight = GUICtrlGetHandle($iSlider_LevelsHighlight) Global $iInp_LevelsHighlight = GUICtrlCreateInput($iSlider_LevelsHighlight_Default, 1126, 399, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) Global $iLabel_LevelsMidtone = GUICtrlCreateLabel("Midtone", 838, 445, 75, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_LevelsMidtone = GUICtrlCreateSlider(838, 477, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetLimit(-1, 100, -100) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 100, -100) GUICtrlSetData(-1, $iSlider_LevelsMidtone_Default) GUICtrlSetTip(-1, "Range is from -100 to 100") Global $hSlider_LevelsMidtone = GUICtrlGetHandle($iSlider_LevelsMidtone) Global $iInp_LevelsMidtone = GUICtrlCreateInput($iSlider_LevelsMidtone_Default, 1126, 489, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) Global $iLabel_LevelsShadow = GUICtrlCreateLabel("Shadow", 838, 535, 75, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_LevelsShadow = GUICtrlCreateSlider(838, 567, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, $iSlider_LevelsShadow_Default) GUICtrlSetTip(-1, "Range is from 0 to 100") Global $hSlider_LevelsShadow = GUICtrlGetHandle($iSlider_LevelsShadow) Global $iInp_LevelsShadow = GUICtrlCreateInput($iSlider_LevelsShadow_Default, 1126, 579, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) #EndRegion Levels #Region Negative Global $iNegative = GUICtrlCreateTabItem("Negative") Global $iLabel_Negative = GUICtrlCreateLabel("Nothing to configure", 838, 445, 340, 60) GUICtrlSetFont(-1, 23, 400, 0, "Arial Black", 4) GUICtrlSetBkColor(-1, 0xFFFFFF) #EndRegion Negative #Region Sharpen Global $iSharpen = GUICtrlCreateTabItem("Sharpen") Global $iLabel_SharpenRadius = GUICtrlCreateLabel("Radius", 838, 377, 64, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_SharpenRadius = GUICtrlCreateSlider(838, 409, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 255, 0) GUICtrlSetData(-1, $iSlider_SharpenRadius_Default) GUICtrlSetTip(-1, "Range is from 0 to 255") Global $hSlider_SharpenRadius = GUICtrlGetHandle($iSlider_SharpenRadius) Global $iInp_SharpenRadius = GUICtrlCreateInput($iSlider_SharpenRadius_Default, 1126, 421, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) Global $iLabelSharpenAmount = GUICtrlCreateLabel("Amount", 838, 504, 72, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_SharpenAmount = GUICtrlCreateSlider(838, 541, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 100, 0) GUICtrlSetData(-1, $iSlider_SharpenAmount_Default) GUICtrlSetTip(-1, "Range is from 0 to 100") Global $hSlider_SharpenAmount = GUICtrlGetHandle($iSlider_SharpenAmount) Global $iInp_SharpenAmount = GUICtrlCreateInput($iSlider_SharpenAmount_Default, 1126, 553, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) #EndRegion Sharpen #Region Tint Global $iTint = GUICtrlCreateTabItem("Tint") ;~ GUICtrlSetState(-1, $GUI_SHOW) Global $iLabel_TintHue = GUICtrlCreateLabel("Hue", 838, 377, 39, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_TintHue = GUICtrlCreateSlider(838, 409, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 180, -180) GUICtrlSetData(-1, $iSlider_TintHue_Default) GUICtrlSetTip(-1, "Range is from -180 to 180") Global $hSlider_TintHue = GUICtrlGetHandle($iSlider_TintHue) Global $iInp_TintHue = GUICtrlCreateInput($iSlider_TintHue_Default, 1126, 421, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) Global $iLabel_TintAmount = GUICtrlCreateLabel("Amount", 838, 504, 72, 27) GUICtrlSetFont(-1, 12, 400, 0, "Arial Black") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $iSlider_TintAmount = GUICtrlCreateSlider(838, 541, 278, 45, BitOR($GUI_SS_DEFAULT_SLIDER, $TBS_BOTH, $TBS_ENABLESELRANGE)) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 100, -100) GUICtrlSetData(-1, $iSlider_TintAmount_Default) GUICtrlSetTip(-1, "Range is from -100 to 100") Global $hSlider_TintAmount = GUICtrlGetHandle($iSlider_TintAmount) Global $iInp_TintAmount = GUICtrlCreateInput($iSlider_TintAmount_Default, 1126, 553, 49, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER, $ES_READONLY)) #EndRegion Tint GUICtrlCreateTabItem("") #EndRegion Tabs ;~ Global Const $STM_SETIMAGE = 0x0172; $IMAGE_BITMAP = 0 Global $hTmp = _GDIPlus_BitmapCreateFromMemory(_Logo(), True) Global $iPicLogo = GUICtrlCreatePic("", 8, 8, 1184, 196, BitOR($SS_CENTERIMAGE, $GUI_SS_DEFAULT_PIC, $WS_BORDER)) Global $hB = GUICtrlSendMsg($iPicLogo, $STM_SETIMAGE, $IMAGE_BITMAP, $hTmp) If $hB Then _WinAPI_DeleteObject($hB) _WinAPI_DeleteObject($hTmp) Global $iW_Prev = 800, $iH_Prev = 450 Global $iPicPreview = GUICtrlCreatePic("", 8, 232, $iW_Prev, $iH_Prev, BitOR($GUI_SS_DEFAULT_PIC, $WS_BORDER, $SS_CENTERIMAGE)) Global $hPicPreview = GUICtrlGetHandle($iPicPreview) Global $iBtnSave = GUICtrlCreateButton("&Save Image", 1117, 634, 75, 49, $BS_MULTILINE) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetTip(-1, "Press right mouse buttom to copy image to clipboard") Global $iBtnLoad = GUICtrlCreateButton("&Load Image", 1036, 634, 75, 49, $BS_MULTILINE) Global $iBtnApply = GUICtrlCreateButton("&Apply Effect", 825, 634, 75, 49, $BS_MULTILINE) GUICtrlSetState(-1, $GUI_DISABLE) Global $iBtnUndo = GUICtrlCreateButton("&Undo Effect", 905, 634, 75, 49, $BS_MULTILINE) GUICtrlSetState(-1, $GUI_DISABLE) Global $iLabelImg = GUICtrlCreateLabel(" Image Info:", 8, 214, 68, 16) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman", 4) GUICtrlSetColor(-1, 0xF0F0F0) GUICtrlSetBkColor(-1, 0x0) Global $i, $j = 89, $k = 256 For $i = 0 To 731 ;76 + 732 GUICtrlCreateLabel("", 76 + $i, 214, 1, 16) GUICtrlSetBkColor(-1, 0x10000 * Int($j * $i / $k) + 0x100 * Int($j * $i / $k) + Int($j * $i / $k)) Next Global $iLabelImgInfo = GUICtrlCreateLabel(" no image loaded", 76, 214, 732, 16) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman", 5) GUICtrlSetColor(-1, 0xB0F0B0) GUICtrlSetBkColor(-1, -2) Global $iLabel_BgColor = GUICtrlCreateLabel("Bg Color", 984, 634, 47, 19) GUICtrlSetFont(-1, 9, 400, 0, "Times New Roman") GUICtrlSetBkColor(-1, -2) Global $iBtnBgColor = GUICtrlCreateButton("", 992, 654, 32, 28, $WS_BORDER) GUICtrlSetBkColor(-1, $iBGDefColor) GUICtrlSetTip(-1, "Change image background color (used also for save format)." & @CRLF & "PNG file format is excluded by background color") Global Enum $iReset = 0x400, $iClipboard Global $hQMenu = _GUICtrlMenu_CreatePopup() _GUICtrlMenu_InsertMenuItem($hQMenu, 0, "Reset to default", $iReset) $hTmp = _GDIPlus_BitmapCreateFromMemory(Reset_Icon()) Global $hBmp_Reset = _GDIPlus_Convert2HBitmap($hTmp, $COLOR_MENU) _GUICtrlMenu_SetItemBmp($hQMenu, 0, $hBmp_Reset) _GDIPlus_BitmapDispose($hTmp) Global $hQMenu2 = _GUICtrlMenu_CreatePopup() _GUICtrlMenu_InsertMenuItem($hQMenu2, 0, "Copy image to clipboard", $iClipboard) Global $hBmp_Clipboard = _GDIPlus_BitmapCreateFromMemory(_Clipboard(), True) _GUICtrlMenu_SetItemBmp($hQMenu2, 0, $hBmp_Clipboard) GUISetState(@SW_SHOW) Global $hDLL_GDI32 = DllOpen("gdi32.dll") Global $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iW_Prev, "int", $iH_Prev, "int", 0, "int", $GDIP_PXF32ARGB, "ptr", 0, "int*", 0) Global $hHBitmap_Preview = _GDIPlus_BitmapCreateHBITMAPFromBitmap($aResult[6]) _GDIPlus_BitmapDispose($aResult[6]) Global $hDC = _WinAPI_GetWindowDC($hPicPreview) Global $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) Global $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBitmap_Preview) Global $hGraphic = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) _GDIPlus_GraphicsClear($hGraphic, 0xFF000000 + $iBGDefColor) Global $tGUID = DllStructCreate($tagGUID) Global $hImage = 0, $hImage_tmp, $hBmp_Preview = 0, $hBmp_tmp = 0, $hBmp_Save = 0, $hBmp_Save_1bpp = 0, $hCtx_tmp, $hBmp_Undo, $hBmp_Empty, _ $iWidth, $iHeight, $aPixelFormat, $aImageRawFormat, $hEffect, $aAnim, $sPrefix, $sFile, $iBGColor = $iBGDefColor, _ $bDnD = False, $bStart = False, $bDrawFX = False, $t, $iOld GUIRegisterMsg($WM_HSCROLL, "WM_HSCROLL") GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUIRegisterMsg($WM_PAINT, "WM_PAINT") GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES") GUIRegisterMsg($WM_CONTEXTMENU, "WM_CONTEXTMENU") GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIRegisterMsg($WM_HSCROLL, "") GUIRegisterMsg($WM_NOTIFY, "") GUIRegisterMsg($WM_PAINT, "") GUIRegisterMsg($WM_DROPFILES, "") GUIRegisterMsg($WM_CONTEXTMENU, "") GUIRegisterMsg($WM_COMMAND, "") If $hBmp_tmp Then _GDIPlus_GraphicsDispose($hCtx_tmp) _GDIPlus_BitmapDispose($hBmp_tmp) EndIf _WinAPI_DeleteObject($hBmp_Reset) _WinAPI_DeleteObject($hBmp_Clipboard) _GDIPlus_GraphicsDispose($hGraphic) _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_DeleteObject($hHBitmap_Preview) _WinAPI_ReleaseDC($hPicPreview, $hDC) _WinAPI_DeleteDC($hDC) If $hImage Then _GDIPlus_ImageDispose($hImage) GUIDelete() _GDIPlus_Shutdown() DllClose($hDLL_GDI32) Exit Case $iBtnApply If $hBmp_Undo Then _GDIPlus_BitmapDispose($hBmp_Undo) $hBmp_Undo = _GDIPlus_ImageClone($hImage) Switch $iTabSelection Case 0 _GDIPlus_BlackAndWhite($hImage, $hCtx_tmp, GUICtrlRead($iInp_BWThreshold), False) Case 7 _GDIPlus_Greyscale($hImage, $hCtx_tmp, False) EndSwitch _GDIPlus_BitmapDispose($hImage) $hImage = _GDIPlus_ImageClone($hBmp_tmp) $bUpdatePreview = True GUICtrlSetState($iBtnUndo, $GUI_ENABLE) GUICtrlSetState($iBtnSave, $GUI_ENABLE) ResetSettings() Case $iBtnUndo _GDIPlus_BitmapDispose($hImage) $hImage = _GDIPlus_ImageClone($hBmp_Undo) If $hBmp_tmp Then _GDIPlus_GraphicsDispose($hCtx_tmp) _GDIPlus_BitmapDispose($hBmp_tmp) EndIf $hBmp_tmp = _GDIPlus_ImageClone($hImage) $hCtx_tmp = _GDIPlus_ImageGetGraphicsContext($hBmp_tmp) $bUpdatePreview = True Case $iBtnBgColor $t = $iBGColor $iBGColor = _ChooseColor(2, 0xFF0000, 2, $hGUI) If @error Then $iBGColor = $t _GDIPlus_GraphicsClear($hGraphic, 0xFF000000 + $iBGColor) GUICtrlSetBkColor($iBtnBgColor, $iBGColor) $bUpdatePreview = True Case $iBtnLoad If Not $bDnD Then $sFile = FileOpenDialog("Load an image", "", "Images (*.jpg;*.bmp;*.png;*.gif;*.tif)|All (*.*)", 3, "", $hGUI) If @error Then ContinueLoop EndIf If $hImage Then _GDIPlus_ImageDispose($hImage) $hImage = _GDIPlus_ImageLoadFromFile($sFile) If Not $hImage Then ContinueLoop $iWidth = _GDIPlus_ImageGetWidth($hImage) $iHeight = _GDIPlus_ImageGetHeight($hImage) $aAnim = DllCall($ghGDIPDll, "uint", "GdipImageGetFrameDimensionsCount", "handle", $hImage, "int*", 0) DllCall($ghGDIPDll, "uint", "GdipImageGetFrameDimensionsList", "handle", $hImage, "struct*", $tGUID, "int", $aAnim[2]) $aAnim = DllCall($ghGDIPDll, "uint", "GdipImageGetFrameCount", "handle", $hImage, "struct*", $tGUID, "uint*", 0) $aPixelFormat = _GDIPlus_ImageGetPixelFormat($hImage) $aImageRawFormat = _GDIPlus_ImageGetRawFormat($hImage) $sPrefix = "" If $aAnim[3] > 1 Then $sPrefix = "animated " ;~ CopyImage2Gfx($hImage, $hGraphic, $hDC, $hDC_backbuffer, $iWidth, $iHeight) GUICtrlSetData($iLabelImgInfo, StringRegExpReplace($sFile, ".*\\(.*)", "$1") & ", " & $sPrefix & $aImageRawFormat[1] & ", " & $iWidth & "x" & $iHeight & ", " & $aPixelFormat[1] & ", " & Round(FileGetSize($sFile) / 1024, 2) & " kb") $bDnD = False $bStart = True $bUpdatePreview = True DllStructSetData($tRECTF, "Width", $iWidth) DllStructSetData($tRECTF, "Height", $iHeight) If $hBmp_tmp Then _GDIPlus_GraphicsDispose($hCtx_tmp) _GDIPlus_BitmapDispose($hBmp_tmp) EndIf $hBmp_tmp = _GDIPlus_ImageClone($hImage) $hCtx_tmp = _GDIPlus_ImageGetGraphicsContext($hBmp_tmp) GUICtrlSetState($iBtnApply, $GUI_ENABLE) If $hBmp_Undo Then _GDIPlus_BitmapDispose($hBmp_Undo) $hBmp_Undo = _GDIPlus_ImageClone($hImage) If $hBmp_Empty Then _GDIPlus_BitmapDispose($hBmp_Empty) $hBmp_Empty = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) $iOld = $iTabSelection For $iTabSelection = 0 To 12 ResetSettings() Next $iTabSelection = $iOld Case $iBtnSave $sFile = FileSaveDialog("Save Image", "", "Image (*.png;*.jpg;*.bmp;*.gif;*.tif)", 2, "", $hGUI) If @error Then ContinueLoop If $hBmp_tmp Then _GDIPlus_GraphicsDispose($hCtx_tmp) _GDIPlus_BitmapDispose($hBmp_tmp) EndIf $hBmp_tmp = _GDIPlus_ImageClone($hBmp_Empty) $hCtx_tmp = _GDIPlus_ImageGetGraphicsContext($hBmp_tmp) DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "handle", $hCtx_tmp, "int", 7) Switch $iTabSelection Case 0 ;Black & White DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "handle", $hCtx_tmp, "int", 5) _GDIPlus_BlackAndWhite($hImage, $hCtx_tmp, GUICtrlRead($iInp_BWThreshold), False) Case 1 ;Blur $hEffect = _GDIPlus_EffectCreateBlur(GUICtrlRead($iInp_BlurRadius), BitAND(GUICtrlRead($iCheckbox_BlurExpandEdge), $GUI_CHECKED)) Case 2 ;Brightness / Contrast $hEffect = _GDIPlus_EffectCreateBrightnessContrast(GUICtrlRead($iInp_BCBrightness), GUICtrlRead($iInp_BCContrast)) Case 3 ;Color Balance $hEffect = _GDIPlus_EffectCreateColorBalance(GUICtrlRead($iInp_CBCyanRed), GUICtrlRead($iInp_CBMagentaGreen), GUICtrlRead($iInp_CBYellowBlue)) Case 4 ;Color Curve $hEffect = _GDIPlus_EffectCreateColorCurve($iType, $iChannel, GUICtrlRead($iInp_CCValue)) Case 5 ;Color LUT Case 6 ;Color Matrix Local $tColorMatrix = DllStructCreate($tagGDIPCOLORMATRIX) DllStructSetData($tColorMatrix, "m", GUICtrlRead($iInp_CMRed), 1) DllStructSetData($tColorMatrix, "m", GUICtrlRead($iInp_CMGreen), 7) DllStructSetData($tColorMatrix, "m", GUICtrlRead($iInp_CMBlue), 13) DllStructSetData($tColorMatrix, "m", 1, 19) DllStructSetData($tColorMatrix, "m", 1, 25) $hEffect = _GDIPlus_EffectCreateColorMatrix($tColorMatrix) Case 7 ;Greyscale _GDIPlus_Greyscale($hImage, $hCtx_tmp, False) Case 8 ;Hue / Saturation / Lightness $hEffect = _GDIPlus_EffectCreateHueSaturationLightness(GUICtrlRead($iInp_HSLHueLevel), GUICtrlRead($iInp_HSLSatLevel), GUICtrlRead($iInp_HSLLightnLevel)) Case 9 ;Levels $hEffect = _GDIPlus_EffectCreateLevels(GUICtrlRead($iInp_LevelsHighlight), GUICtrlRead($iInp_LevelsMidtone), GUICtrlRead($iInp_LevelsShadow)) Case 10;Negative _GDIPlus_Negative($hImage, $hCtx_tmp) Case 11;Sharpen $hEffect = _GDIPlus_EffectCreateSharpen(GUICtrlRead($iInp_SharpenRadius), GUICtrlRead($iInp_SharpenAmount)) Case 12;Tint $hEffect = _GDIPlus_EffectCreateTint(GUICtrlRead($iInp_TintHue), GUICtrlRead($iInp_TintAmount)) EndSwitch If $iTabSelection <> 0 And $iTabSelection <> 7 Then _GDIPlus_BitmapApplyEffect($hImage, $hEffect) _GDIPlus_EffectDispose($hEffect) EndIf _GDIPlus_SaveBitmap($sFile, $hBmp_tmp, 90, $iBGColor) ;~ Switch _GDIPlus_ImageSaveToFile($hBmp_tmp, $sFile) ;~ Case 0 ;~ MsgBox(16 + 262144, "Error", "Image couldn't be saved!", 20, $hGUI) ;~ Case Else ;~ MsgBox(64 + 262144, "Information", "Image has been successfully saved!", 20, $hGUI) ;~ EndSwitch Case $iRadio_CCExposure, $iRadio_CCDensity GUICtrlSetLimit($iSlider_CCValue, 255, -255) GUICtrlSetData($iSlider_CCValue, 0) GUICtrlSetData($iInp_CCValue, 0) GUICtrlSetTip($iSlider_CCValue, "Range is from -255 to 255") If BitAND(GUICtrlRead($iRadio_CCExposure), $GUI_CHECKED) Then $iType = $iAdjustExposure Else $iType = $iAdjustDensity EndIf $bUpdatePreview = True Case $iRadio_CCBlackSaturation, $iRadio_CCWhiteSaturation If BitAND(GUICtrlRead($iRadio_CCBlackSaturation), $GUI_CHECKED) Then $iType = $iAdjustBlackSaturation GUICtrlSetLimit($iSlider_CCValue, 254, 0) GUICtrlSetData($iSlider_CCValue, 0) GUICtrlSetData($iInp_CCValue, 0) GUICtrlSetTip($iSlider_CCValue, "Range is from 0 to 254") Else $iType = $iAdjustWhiteSaturation GUICtrlSetLimit($iSlider_CCValue, 255, 1) GUICtrlSetData($iSlider_CCValue, 255) GUICtrlSetData($iInp_CCValue, 255) GUICtrlSetTip($iSlider_CCValue, "Range is from 1 to 255") EndIf $bUpdatePreview = True Case $iRadio_CCContrast, $iRadio_CCHighlight, $iRadio_CCShadow, $iRadio_CCMidtone GUICtrlSetLimit($iSlider_CCValue, 100, -100) GUICtrlSetData($iSlider_CCValue, 0) GUICtrlSetData($iInp_CCValue, 0) GUICtrlSetTip($iSlider_CCValue, "Range is from -100 to 100") If BitAND(GUICtrlRead($iRadio_CCBlackSaturation), $GUI_CHECKED) Then $iType = $iAdjustContrast ElseIf BitAND(GUICtrlRead($iRadio_CCHighlight), $GUI_CHECKED) Then $iType = $iAdjustHighlight ElseIf BitAND(GUICtrlRead($iRadio_CCShadow), $GUI_CHECKED) Then $iType = $iAdjustShadow Else $iType = $iAdjustMidtone EndIf $bUpdatePreview = True Case $iRadio_CCCurveAllChannel $iChannel = $iCurveChannelAll $bUpdatePreview = True Case $iRadio_CCCurveRed $iChannel = $iCurveChannelRed $bUpdatePreview = True Case $iRadio_CCCurveGreen $iChannel = $iCurveChannelGreen $bUpdatePreview = True Case $iRadio_CCCurveBlue $iChannel = $iCurveChannelBlue $bUpdatePreview = True Case $iCheckbox_BlurExpandEdge $bUpdatePreview = True Case $iTab Switch GUICtrlRead($iTab) Case 0 ;Black & White $iTabSelection = 0 Case 1 ;Blur $iTabSelection = 1 Case 2 ;Brightness / Contrast $iTabSelection = 2 Case 3 ;Color Balance $iTabSelection = 3 Case 4 ;Color Curve $iTabSelection = 4 Case 5 ;Color LUT $iTabSelection = 5 Case 6 ;Color Matrix $iTabSelection = 6 Case 7 ;Greyscale $iTabSelection = 7 Case 8 ;Hue / Saturation / Lightness $iTabSelection = 8 Case 9 ;Levels $iTabSelection = 9 Case 10;Negative $iTabSelection = 10 Case 11;Sharpen $iTabSelection = 11 Case 12;Tint $iTabSelection = 12 EndSwitch $bUpdatePreview = True EndSwitch If $bUpdatePreview And $bStart Then $bUpdatePreview = False DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "handle", $hGraphic, "int", 7) $hImage_tmp = _GDIPlus_ImageClone($hImage) Switch $iTabSelection Case 0 ;Black & White DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "handle", $hGraphic, "int", 5) _GDIPlus_BlackAndWhite($hImage_tmp, $hGraphic, GUICtrlRead($iInp_BWThreshold)) $bDrawFX = False Case 1 ;Blur $hEffect = _GDIPlus_EffectCreateBlur(GUICtrlRead($iInp_BlurRadius), BitAND(GUICtrlRead($iCheckbox_BlurExpandEdge), $GUI_CHECKED)) $bDrawFX = True Case 2 ;Brightness / Contrast $hEffect = _GDIPlus_EffectCreateBrightnessContrast(GUICtrlRead($iInp_BCBrightness), GUICtrlRead($iInp_BCContrast)) $bDrawFX = True Case 3 ;Color Balance $hEffect = _GDIPlus_EffectCreateColorBalance(GUICtrlRead($iInp_CBCyanRed), GUICtrlRead($iInp_CBMagentaGreen), GUICtrlRead($iInp_CBYellowBlue)) $bDrawFX = True Case 4 ;Color Curve $hEffect = _GDIPlus_EffectCreateColorCurve($iType, $iChannel, GUICtrlRead($iInp_CCValue)) $bDrawFX = True Case 5 ;Color LUT $bDrawFX = False Case 6 ;Color Matrix Local $tColorMatrix = DllStructCreate($tagGDIPCOLORMATRIX) DllStructSetData($tColorMatrix, "m", GUICtrlRead($iInp_CMRed), 1) DllStructSetData($tColorMatrix, "m", GUICtrlRead($iInp_CMGreen), 7) DllStructSetData($tColorMatrix, "m", GUICtrlRead($iInp_CMBlue), 13) DllStructSetData($tColorMatrix, "m", 1, 19) DllStructSetData($tColorMatrix, "m", 1, 25) $hEffect = _GDIPlus_EffectCreateColorMatrix($tColorMatrix) $bDrawFX = True Case 7 ;Greyscale _GDIPlus_Greyscale($hImage_tmp, $hGraphic) $bDrawFX = False Case 8 ;Hue / Saturation / Lightness $hEffect = _GDIPlus_EffectCreateHueSaturationLightness(GUICtrlRead($iInp_HSLHueLevel), GUICtrlRead($iInp_HSLSatLevel), GUICtrlRead($iInp_HSLLightnLevel)) $bDrawFX = True Case 9 ;Levels $hEffect = _GDIPlus_EffectCreateLevels(GUICtrlRead($iInp_LevelsHighlight), GUICtrlRead($iInp_LevelsMidtone), GUICtrlRead($iInp_LevelsShadow)) $bDrawFX = True Case 10;Negative _GDIPlus_Negative($hImage_tmp, $hGraphic) $bDrawFX = False Case 11;Sharpen $hEffect = _GDIPlus_EffectCreateSharpen(GUICtrlRead($iInp_SharpenRadius), GUICtrlRead($iInp_SharpenAmount)) $bDrawFX = True Case 12;Tint $hEffect = _GDIPlus_EffectCreateTint(GUICtrlRead($iInp_TintHue), GUICtrlRead($iInp_TintAmount)) $bDrawFX = True EndSwitch If $bDrawFX Then _GDIPlus_GraphicsClear($hCtx_tmp, 0xFF000000 + $iBGColor) _GDIPlus_BitmapApplyEffect($hImage_tmp, $hEffect) _GDIPlus_GraphicsDrawImageRect($hCtx_tmp, $hImage_tmp, 0, 0, $iWidth, $iHeight) _GDIPlus_EffectDispose($hEffect) CopyImage2Gfx($hBmp_tmp, $hGraphic, $hDC, $hDC_backbuffer, $iWidth, $iHeight) Else DllCall($hDLL_GDI32, "bool", "BitBlt", "handle", $hDC, "int", 2, "int", 2, "int", $iW_Prev - 4, "int", $iH_Prev - 4, "handle", $hDC_backbuffer, "int", 0, "int", 0, "dword", $SRCCOPY) EndIf _GDIPlus_ImageDispose($hImage_tmp) EndIf WEnd Func ResetSettings() Switch $iTabSelection Case 0 ;Black & White GUICtrlSetData($iSlider_BWThreshold, $iSlider_BWThreshold_Default) GUICtrlSetData($iInp_BWThreshold, StringFormat("%04.2f", $iSlider_BWThreshold_Default / 100)) $bUpdatePreview = True Case 1 ;Blur GUICtrlSetData($iSlider_BlurRadius, $iSlider_BlurRadius_Default) GUICtrlSetData($iInp_BlurRadius, $iSlider_BlurRadius_Default) GUICtrlSetState($iCheckbox_BlurExpandEdge, $GUI_UNCHECKED) $bUpdatePreview = True Case 2 ;Brightness / Contrast GUICtrlSetData($iSlider_BCBrightness, $iSlider_BCBrightness_Default) GUICtrlSetData($iInp_BCBrightness, $iSlider_BCBrightness_Default) GUICtrlSetData($iSlider_BCContrast, $iSlider_BCContrast_Default) GUICtrlSetData($iInp_BCContrast, $iSlider_BCContrast_Default) $bUpdatePreview = True Case 3 ;Color Balance GUICtrlSetData($iSlider_CBCyanRed, $iSlider_CBCyanRed_Default) GUICtrlSetData($iInp_CBCyanRed, $iSlider_CBCyanRed_Default) GUICtrlSetData($iSlider_CBMagentaGreen, $iSlider_CBMagentaGreen_Default) GUICtrlSetData($iInp_CBMagentaGreen, $iSlider_CBMagentaGreen_Default) GUICtrlSetData($iSlider_CBYellowBlue, $iSlider_CBYellowBlue_Default) GUICtrlSetData($iInp_CBYellowBlue, $iSlider_CBYellowBlue_Default) $bUpdatePreview = True Case 4 ;Color Curve GUICtrlSetData($iSlider_CCValue, 0) GUICtrlSetData($iInp_CCValue, 0) GUICtrlSetState($iRadio_CCExposure, $GUI_CHECKED) GUICtrlSetState($iRadio_CCCurveAllChannel, $GUI_CHECKED) $bUpdatePreview = True Case 5 ;Color LUT ;~ $bUpdatePreview = True Case 6 ;Color Matrix GUICtrlSetData($iSlider_CMRed, $iSlider_CMRed_Default) GUICtrlSetData($iInp_CMRed, StringFormat("%04.2f", $iSlider_CMRed_Default / 100)) GUICtrlSetData($iSlider_CMGreen, $iSlider_CMGreen_Default) GUICtrlSetData($iInp_CMGreen, StringFormat("%04.2f", $iSlider_CMGreen_Default / 100)) GUICtrlSetData($iSlider_CMBlue, $iSlider_CMBlue_Default) GUICtrlSetData($iInp_CMBlue, StringFormat("%04.2f", $iSlider_CMBlue_Default / 100)) $bUpdatePreview = True Case 7 ;Greyscale GUICtrlSetData($iSlider_GSLumRed, $iSlider_GSLumRed_Default) GUICtrlSetData($iInp_GSLumRed, StringFormat("%04.2f", $iSlider_GSLumRed_Default / 100)) GUICtrlSetData($iSlider_GSLumGreen, $iSlider_GSLumGreen_Default) GUICtrlSetData($iInp_GSLumGreen, StringFormat("%04.2f", $iSlider_GSLumGreen_Default / 100)) GUICtrlSetData($iSlider_GSLumBlue, $iSlider_GSLumBlue_Default) GUICtrlSetData($iInp_GSLumBlue, StringFormat("%04.2f", $iSlider_GSLumBlue_Default / 100)) $GDIP__RLUM = $iSlider_GSLumRed_Default / 100 $GDIP__GLUM = $iSlider_GSLumGreen_Default / 100 $GDIP__BLUM = $iSlider_GSLumBlue_Default / 100 $bUpdatePreview = True Case 8 ;Hue / Saturation / Lightness GUICtrlSetData($iSlider_HSLHueLevel, $iSlider_HSLHueLevel_Default) GUICtrlSetData($iInp_HSLHueLevel, $iSlider_HSLHueLevel_Default) GUICtrlSetData($iSlider_HSLSatLevel, $iSlider_HSLSatLevel_Default) GUICtrlSetData($iInp_HSLSatLevel, $iSlider_HSLSatLevel_Default) GUICtrlSetData($iSlider_HSLLightnLevel, $iSlider_HSLLightnLevel_Default) GUICtrlSetData($iInp_HSLLightnLevel, $iSlider_HSLLightnLevel_Default) $bUpdatePreview = True Case 9 ;Levels GUICtrlSetData($iSlider_LevelsHighlight, $iSlider_LevelsHighlight_Default) GUICtrlSetData($iInp_LevelsHighlight, $iSlider_LevelsHighlight_Default) GUICtrlSetData($iSlider_LevelsMidtone, $iSlider_LevelsMidtone_Default) GUICtrlSetData($iInp_LevelsMidtone, $iSlider_LevelsMidtone_Default) GUICtrlSetData($iSlider_LevelsShadow, $iSlider_LevelsShadow_Default) GUICtrlSetData($iInp_LevelsShadow, $iSlider_LevelsShadow_Default) $bUpdatePreview = True Case 10;Negative $bUpdatePreview = True Case 11;Sharpen GUICtrlSetData($iSlider_SharpenRadius, $iSlider_SharpenRadius_Default) GUICtrlSetData($iInp_SharpenRadius, $iSlider_SharpenRadius_Default) GUICtrlSetData($iSlider_SharpenAmount, $iSlider_SharpenAmount_Default) GUICtrlSetData($iInp_SharpenAmount, $iSlider_SharpenAmount_Default) $bUpdatePreview = True Case 12;Tint GUICtrlSetData($iSlider_TintHue, $iSlider_TintHue_Default) GUICtrlSetData($iInp_TintHue, $iSlider_TintHue_Default) GUICtrlSetData($iSlider_TintAmount, $iSlider_TintAmount_Default) GUICtrlSetData($iInp_TintAmount, $iSlider_TintAmount_Default) $bUpdatePreview = True EndSwitch EndFunc ;==>ResetSettings #Region GDI+ FX functions Func _GDIPlus_BlackAndWhite($hBitmap, $hGraphic, $iThreshold, $bUpdate = True) Local Const $hIA = _GDIPlus_ImageAttributesCreate() _GDIPlus_ImageAttributesSetThreshold($hIA, $iThreshold) Local $pBWMatrix = DllStructGetPtr(_GDIPlus_ColorMatrixCreateGrayScale()) _GDIPlus_ImageAttributesSetColorMatrix($hIA, $GDIP_COLORADJUSTTYPE_DEFAULT, True, $pBWMatrix) Local $iW = _GDIPlus_ImageGetWidth($hBitmap), $iH = _GDIPlus_ImageGetHeight($hBitmap) If $bUpdate Then CopyImage2Gfx($hBitmap, $hGraphic, $hDC, $hDC_backbuffer, $iW, $iH, $hIA) Else _GDIPlus_GraphicsClear($hGraphic, 0xFF000000 + $iBGColor) _GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hBitmap, 0, 0, $iW, $iH, 0, 0, $iW, $iH, $hIA) EndIf _GDIPlus_ImageAttributesDispose($hIA) EndFunc ;==>_GDIPlus_BlackAndWhite Func _GDIPlus_Greyscale($hBitmap, $hGraphic, $bUpdate = True) Local $ii, $iJ, $tColorMatrix, $aLums[4] = [GUICtrlRead($iInp_GSLumRed), GUICtrlRead($iInp_GSLumGreen), GUICtrlRead($iInp_GSLumBlue), 0] $tColorMatrix = DllStructCreate($tagGDIPCOLORMATRIX) For $ii = 0 To 3 For $iJ = 1 To 3 DllStructSetData($tColorMatrix, "m", $aLums[$ii], $ii * 5 + $iJ) Next Next DllStructSetData($tColorMatrix, "m", 1, 19) DllStructSetData($tColorMatrix, "m", 1, 25) Local Const $hIA = _GDIPlus_ImageAttributesCreate() _GDIPlus_ImageAttributesSetColorMatrix($hIA, 0, True, $tColorMatrix) Local $iW = _GDIPlus_ImageGetWidth($hBitmap), $iH = _GDIPlus_ImageGetHeight($hBitmap) If $bUpdate Then CopyImage2Gfx($hBitmap, $hGraphic, $hDC, $hDC_backbuffer, $iW, $iH, $hIA) Else _GDIPlus_GraphicsClear($hGraphic, 0xFF000000 + $iBGColor) _GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hBitmap, 0, 0, $iW, $iH, 0, 0, $iW, $iH, $hIA) EndIf _GDIPlus_ImageAttributesDispose($hIA) EndFunc ;==>_GDIPlus_Greyscale Func _GDIPlus_Negative(ByRef $hBitmap, ByRef $hGraphic) Local Const $hIA = _GDIPlus_ImageAttributesCreate() _GDIPlus_ImageAttributesSetColorMatrix($hIA, 0, True, _GDIPlus_ColorMatrixCreateNegative()) CopyImage2Gfx($hBitmap, $hGraphic, $hDC, $hDC_backbuffer, _GDIPlus_ImageGetWidth($hBitmap), _GDIPlus_ImageGetHeight($hBitmap), $hIA) _GDIPlus_ImageAttributesDispose($hIA) EndFunc ;==>_GDIPlus_Negative #EndRegion GDI+ FX functions #Region Message Functions Func WM_HSCROLL($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $wParam Switch $lParam Case $hSlider_BWThreshold GUICtrlSetData($iInp_BWThreshold, StringFormat("%04.2f", GUICtrlRead($iSlider_BWThreshold) / 100)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_BlurRadius GUICtrlSetData($iInp_BlurRadius, GUICtrlRead($iSlider_BlurRadius)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_BCBrightness GUICtrlSetData($iInp_BCBrightness, GUICtrlRead($iSlider_BCBrightness)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_BCContrast GUICtrlSetData($iInp_BCContrast, GUICtrlRead($iSlider_BCContrast)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_CBCyanRed GUICtrlSetData($iInp_CBCyanRed, GUICtrlRead($iSlider_CBCyanRed)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_CBMagentaGreen GUICtrlSetData($iInp_CBMagentaGreen, GUICtrlRead($iSlider_CBMagentaGreen)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_CBYellowBlue GUICtrlSetData($iInp_CBYellowBlue, GUICtrlRead($iSlider_CBYellowBlue)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_CCValue GUICtrlSetData($iInp_CCValue, GUICtrlRead($iSlider_CCValue)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_CMBlue GUICtrlSetData($iInp_CMBlue, StringFormat("%04.2f", GUICtrlRead($iSlider_CMBlue) / 100)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_CMGreen GUICtrlSetData($iInp_CMGreen, StringFormat("%04.2f", GUICtrlRead($iSlider_CMGreen) / 100)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_CMRed GUICtrlSetData($iInp_CMRed, StringFormat("%04.2f", GUICtrlRead($iSlider_CMRed) / 100)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_GSLumBlue GUICtrlSetData($iInp_GSLumBlue, StringFormat("%04.2f", GUICtrlRead($iSlider_GSLumBlue) / 100)) $GDIP__BLUM = GUICtrlRead($iSlider_GSLumBlue) / 100 $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_GSLumGreen GUICtrlSetData($iInp_GSLumGreen, StringFormat("%04.2f", GUICtrlRead($iSlider_GSLumGreen) / 100)) $GDIP__GLUM = GUICtrlRead($iSlider_GSLumGreen) / 100 $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_GSLumRed GUICtrlSetData($iInp_GSLumRed, StringFormat("%04.2f", GUICtrlRead($iSlider_GSLumRed) / 100)) $GDIP__RLUM = GUICtrlRead($iSlider_GSLumRed) / 100 $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_HSLHueLevel GUICtrlSetData($iInp_HSLHueLevel, GUICtrlRead($iSlider_HSLHueLevel)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_HSLLightnLevel GUICtrlSetData($iInp_HSLLightnLevel, GUICtrlRead($iSlider_HSLLightnLevel)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_HSLSatLevel GUICtrlSetData($iInp_HSLSatLevel, GUICtrlRead($iSlider_HSLSatLevel)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_LevelsHighlight GUICtrlSetData($iInp_LevelsHighlight, GUICtrlRead($iSlider_LevelsHighlight)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_LevelsMidtone GUICtrlSetData($iInp_LevelsMidtone, GUICtrlRead($iSlider_LevelsMidtone)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_LevelsShadow GUICtrlSetData($iInp_LevelsShadow, GUICtrlRead($iSlider_LevelsShadow)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_SharpenAmount GUICtrlSetData($iInp_SharpenAmount, GUICtrlRead($iSlider_SharpenAmount)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_SharpenRadius GUICtrlSetData($iInp_SharpenRadius, GUICtrlRead($iSlider_SharpenRadius)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_TintAmount GUICtrlSetData($iInp_TintAmount, GUICtrlRead($iSlider_TintAmount)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) Case $hSlider_TintHue GUICtrlSetData($iInp_TintHue, GUICtrlRead($iSlider_TintHue)) $bUpdatePreview = True If BitAND(GUICtrlGetState($iBtnSave), $GUI_ENABLE) = $GUI_ENABLE Then GUICtrlSetState($iBtnSave, $GUI_DISABLE) EndSwitch Return "GUI_RUNDEFMSG" EndFunc ;==>WM_HSCROLL Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $lParam Switch $wParam Case $iReset ResetSettings() Case $iClipboard Local $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp_tmp) Local $hClipboard_Bitmap = _WinAPI_CopyImage($hHBmp, 0, 0, 0, $LR_COPYDELETEORG + $LR_COPYRETURNORG) _ClipBoard_Open(HWnd($hGUI)) _ClipBoard_Empty() _ClipBoard_SetDataEx($hClipboard_Bitmap, $CF_BITMAP) If Not @error Then MsgBox(64 + 262144, "Information", "Image put to clipboard!", 10) Else MsgBox(16 + 262144, "Error", "An error has occured: " & @error, 10) EndIf _ClipBoard_Close() _WinAPI_DeleteObject($hHBmp) _WinAPI_DeleteObject($hClipboard_Bitmap) EndSwitch Return "GUI_RUNDEFMSG" EndFunc ;==>WM_COMMAND Func WM_CONTEXTMENU($hWnd, $Msg, $wParam, $lParam) #forceref $Msg, $wParam, $lParam Local $aCI = GUIGetCursorInfo(HWnd($hGUI)) If Not @error Then Switch $aCI[4] Case $iTab _GUICtrlMenu_TrackPopupMenu($hQMenu, $hWnd) Return True Case $iBtnSave _GUICtrlMenu_TrackPopupMenu($hQMenu2, $hWnd) Return True EndSwitch EndIf Return "GUI_RUNDEFMSG" EndFunc ;==>WM_CONTEXTMENU Func WM_PAINT($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg,$wParam, $lParam DllCall($hDLL_GDI32, "bool", "BitBlt", "handle", $hDC, "int", 2, "int", 2, "int", $iW_Prev - 4, "int", $iH_Prev - 4, "handle", $hDC_backbuffer, "int", 0, "int", 0, "dword", $SRCCOPY) Return "GUI_RUNDEFMSG" EndFunc ;==>WM_PAINT Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg,$wParam, $lParam DllCall($hDLL_GDI32, "bool", "BitBlt", "handle", $hDC, "int", 2, "int", 2, "int", $iW_Prev - 4, "int", $iH_Prev - 4, "handle", $hDC_backbuffer, "int", 0, "int", 0, "dword", $SRCCOPY) Return "GUI_RUNDEFMSG" EndFunc ;==>WM_NOTIFY Func WM_DROPFILES($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $lParam Local $aRet = DllCall("shell32.dll", "int", "DragQueryFile", "int", $wParam, "int", -1, "ptr", 0, "int", 0) If @error Then Return SetError(1, 0, 0) Local $sDroppedFile, $tBuffer = DllStructCreate("char[256]") If $aRet[0] = 1 Then DllCall("shell32.dll", "int", "DragQueryFile", "int", $wParam, "int", 0, "ptr", DllStructGetPtr($tBuffer), "int", DllStructGetSize($tBuffer)) $sDroppedFile = DllStructGetData($tBuffer, 1) If StringInStr(FileGetAttrib($sDroppedFile), "D") Then DllCall("shell32.dll", "none", "DragFinish", "int", $wParam) Return MsgBox(16 + 262144, "Error", "This is not a file ;-)", 20, $hGUI) EndIf EndIf DllCall("shell32.dll", "none", "DragFinish", "int", $wParam) $sFile = $sDroppedFile $bDnD = True GUICtrlSendMsg($iBtnLoad, $BM_CLICK, 0, 0) Return "GUI_RUNDEFMSG" EndFunc ;==>WM_DROPFILES #EndRegion Message Functions #Region needed additional functions Func _GDIPlus_SaveBitmap($sFilename, $hBmp, $iJPGQual = 90, $iTpColor = 0) Local $bError = False, $bResult, $aResult, $hBmp_BG, $hBmp1bpp, $hCtxt1bpp; $hBmp8bpp, $hCtxt8bpp Local $sSaveTypes = "|jpg|bmp|gif|png|tif|", $sSaveType = "jpg" Local $sSuffix = StringRight($sFilename, 3) If StringInStr($sSaveTypes, $sSuffix) Then $sSaveType = $sSuffix Else $sFilename &= "." & $sSaveType EndIf If FileExists($sFilename) Then Local $iChoice = MsgBox(4 + 32 + 256 + 262144, "Warning", "'" & $sFilename & "' already exists!" & @CRLF & @CRLF & "Overwrite file?", 0, $hGUI) If $iChoice = 7 Then Return 0 FileDelete($sFilename) EndIf If Not $iTabSelection Then $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", 0, "int", $GDIP_PXF01INDEXED, "ptr", 0, "int*", 0) ;create empty 32 bit bitmap $hBmp1bpp = $aResult[6] $hCtxt1bpp = _GDIPlus_ImageGetGraphicsContext($hBmp1bpp) DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "handle", $hCtxt1bpp, "int", 5) _GDIPlus_GraphicsDrawImageRect($hCtxt1bpp, $hBmp, 0, 0, $iWidth, $iHeight) _GDIPlus_GraphicsDispose($hCtxt1bpp) $hBmp = $hBmp1bpp ;~ ElseIf $iTabSelection = 7 Then ;~ $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", 0, "int", $GDIP_PXF08INDEXED, "ptr", 0, "int*", 0) ;create empty 32 bit bitmap ;~ $hBmp8bpp = $aResult[6] ;~ $hCtxt8bpp = _GDIPlus_ImageGetGraphicsContext($hBmp8bpp) ;~ DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "handle", $hCtxt8bpp, "int", 0) ;~ _GDIPlus_GraphicsDrawImageRect($hCtxt8bpp, $hBmp, 0, 0, $iWidth, $iHeight) ;~ _GDIPlus_GraphicsDispose($hCtxt8bpp) ;~ $hBmp = $hBmp8bpp EndIf Switch $sSaveType Case "jpg" Local $sCLSID = _GDIPlus_EncodersGetCLSID("JPG") Local $tParams = _GDIPlus_ParamInit(1) Local $tData = DllStructCreate("int Quality") DllStructSetData($tData, "Quality", $iJPGQual) Local $pData = DllStructGetPtr($tData) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) Local $pParams = DllStructGetPtr($tParams) If $iTpColor Then $hBmp_BG = _GDIPlus_ChangeBGColor($hBmp, 0xFF000000 + $iTpColor) $bResult = _GDIPlus_ImageSaveToFileEx($hBmp_BG, $sFilename, $sCLSID, $pParams) _GDIPlus_BitmapDispose($hBmp_BG) Else $bResult = _GDIPlus_ImageSaveToFileEx($hBmp, $sFilename, $sCLSID, $pParams) EndIf If Not $bResult Then $bError = True Else $bError = False EndIf $tData = "" $tParams = "" Case Else If $iTpColor And $sSuffix <> "png" Then $hBmp_BG = _GDIPlus_ChangeBGColor($hBmp, 0xFF000000 + $iTpColor) $bResult = _GDIPlus_ImageSaveToFile($hBmp_BG, $sFilename) _GDIPlus_BitmapDispose($hBmp_BG) Else $bResult = _GDIPlus_ImageSaveToFile($hBmp, $sFilename) EndIf If Not $bResult Then $bError = True Else $bError = False EndIf EndSwitch If Not $iTabSelection Then _GDIPlus_BitmapDispose($hBmp) If $bError Then MsgBox(16 + 262144, "ERROR", "An error has occured - the image couldn't saved!", 30, $hGUI) Return 0 EndIf MsgBox(64 + 262144, "Information", "Image successfully saved to '" & $sFilename & "'", 10, $hGUI) Return 1 EndFunc ;==>_GDIPlus_SaveBitmap Func _GDIPlus_ChangeBGColor($hBitmap, $iBGColor) Local $iW_TP = _GDIPlus_ImageGetWidth($hBitmap), $iH_TP = _GDIPlus_ImageGetHeight($hBitmap) Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iW_TP, "int", $iH_TP, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0) ;create empty 32 bit bitmap Local $hBmp_TP = $aResult[6] Local $hCtxt_TP = _GDIPlus_ImageGetGraphicsContext($hBmp_TP) _GDIPlus_GraphicsClear($hCtxt_TP, $iBGColor) _GDIPlus_GraphicsDrawImageRect($hCtxt_TP, $hBitmap, 0, 0, $iW_TP, $iH_TP) _GDIPlus_GraphicsDispose($hCtxt_TP) Return $hBmp_TP EndFunc ;==>_GDIPlus_ChangeBGColor Func CopyImage2Gfx($hBmp, $hGraphic, $hDC, $hDC_backbuffer, $bW, $bH, $hIA = 0) Local $f, $iXPos, $iYPos, $iImgW, $iImgH _GDIPlus_GraphicsClear($hGraphic, 0xFF000000 + $iBGColor) If $bW < $iW_Prev And $bH < $iH_Prev Then $iXPos = ($iW_Prev - $bW) / 2 $iYPos = ($iH_Prev - $bH) / 2 $iImgW = $bW $iImgH = $bH Else If $bW > $bH Then $f = $bW / $iW_Prev If ($bH / $f) > $iH_Prev Then $f = $bH / $iH_Prev Else $f = $bH / $iH_Prev EndIf $iImgW = Int($bW / $f) $iImgH = Int($bH / $f) $iXPos = ($iW_Prev - $iImgW) / 2 - 2 $iYPos = ($iH_Prev - $iImgH) / 2 - 2 EndIf If $hIA Then _GDIPlus_GraphicsDrawImageRectRect($hGraphic, $hBmp, 0, 0, $bW, $bH, $iXPos, $iYPos, $iImgW, $iImgH, $hIA) Else _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBmp, $iXPos, $iYPos, $iImgW, $iImgH) EndIf DllCall($hDLL_GDI32, "bool", "BitBlt", "handle", $hDC, "int", 2, "int", 2, "int", $iW_Prev - 4, "int", $iH_Prev - 4, "handle", $hDC_backbuffer, "int", 0, "int", 0, "dword", $SRCCOPY) EndFunc ;==>CopyImage2Gfx Func _GDIPlus_Convert2HBitmap($hBitmap, $iColor); removes alpha backround using system color and converts to gdi bitmap Local $iBGColor = _WinAPI_GetSysColor($iColor) $iBGColor = 0x10000 * BitAND($iBGColor, 0xFF) + BitAND($iBGColor, 0x00FF00) + BitShift($iBGColor, 16) Local $iWidth = _GDIPlus_ImageGetWidth($hBitmap), $iHeight = _GDIPlus_ImageGetHeight($hBitmap) Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0) Local $hBitmap_New = $aResult[6] Local $hCtx_new = _GDIPlus_ImageGetGraphicsContext($hBitmap_New) Local $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000 + $iBGColor) _GDIPlus_GraphicsFillRect($hCtx_new, 0, 0, $iWidth, $iHeight, $hBrush) _GDIPlus_GraphicsDrawImageRect($hCtx_new, $hBitmap, 0, 0, $iWidth, $iHeight) Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_New) _GDIPlus_BrushDispose($hBrush) _GDIPlus_BitmapDispose($hBitmap_New) _GDIPlus_GraphicsDispose($hCtx_new) Return $hHBitmap EndFunc ;==>_GDIPlus_Convert2HBitmap ;Code below was generated by: 'File to Base64 String' Code Generator v1.12 Build 2013-05-17 Func Reset_Icon() Local $Reset_Icon $Reset_Icon &= "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACC0lEQVR42mNkIAKwxjMJM/9i8vjx9M86hkMM35HlGAlpZslmcFMxllssrMcidq7/Ydr3pX9nE2dANIOImD7HXCltAT9hUX4GEUkhhps7vj+/kHpBCq8B7BHMvPwezFUCnHylopI8zOxM7AyszGwMAvwCDPwK3Axz9Hf6/rv9fwtOA5itGIPlUvjXiMryMPDy8jFwMHMwcLJzMgjw8jNoK6gwrF9y/vGh2MNy+L3AwcDGYMRgoJMivdLQWUOBm4WbgYebh4HxNyPDP5FvDPNd92S92/N5OsFAtFqj8cDCVVeenY2D4fyxa3c4jkvclnDm9fzw4BvDishNjAQNCDhu/VbfREPo28/vDA8OvPq42mePQGRKLPfyOYu/EhWNQUdt3uiaawh//PKR4cdhln8zfJczo6vBa4DHJtPHZj66Mm/fvWf4tov5//yoNUwwuf///7MwMjL+wWuAzUyd97ZpJgJvnr5h2H/i9Ls7IS+FQeJrVq1nDAkL/E/QBYELvK+yeX3UYv/Ew7Dn7u4HDGdzjJ9VTXxHtBeCZwR1vOO9H8tjwyL15fC3R5/OftQ62//kK9EGgIDaZMmez4ovikV5JRmYtvBmXui+OQMkPmPxSsaM2PD/BA0AgfA6t9gzpqcX/WT6yiC6V0n3fN+NK/uOXmZ0stYlzgAQiOwOdb/14+yEs5z3/jOUMGjBxAESN7ER3OAlewAAAABJRU5ErkJggg==" Return Binary(_Base64Decode($Reset_Icon)) EndFunc ;==>Reset_Icon Func _Clipboard($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Clipboard $Clipboard &= 'iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAMAAAAVv241AAABBVBMVEX8/f/s7vD49vj5+vv4+fuQSBTh4eH4+vvk5ujt7u/t7vDj5efAwMDy8vP09fbS0tLc2tr49/j9/v/59/jw8PD7/f/Tizba2trDkFbQgSTg29OtfUTq2MDk5OTj4+Pk4uHPfyLk4+LdkTLSiTbSgiPLeyLj4+Tn5+e2il62mn/m5ube1cvs7u+zgU+5cCnk5ebWlEOufEHNzc3Fdyazbi7Ozs7MzMytcDiyczq2k2+vd0fj5OaxbzauflatajSvh2bk5eenZjKyknahYTGleVbv7Ozz8vPHxcOudkHz9PXw8fLl5uedXS6ZURuxcDaQRxSMRhSJRhaMTiOTXDSYaEWUXjeYTxv6l0DeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAlElEQVR4Xj2M1a6EUAADe3CHdXd3d3eXq///KbtLgHlpJm0K7xtOUQKfhL/ZOrR1vdePpDPIho1CjOPi5Uo0iFCCgglPSkimXJZII+TyltBSER3BmjHVGuoNj9uEFo/oypTPhCEDDAVH7hhPnNkUM7vhyRyLpX0trrCW7WuywdbY7VVV007nyxU3ln2wz6/vn9+//xdk9BJOUsHn+gAAAABJRU5ErkJggg==' Local $bString = Binary(_Base64Decode($Clipboard)) If $bSaveBinary Then Local $hFile = FileOpen($sSavePath & "\clipboard_paper_16x16.png", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Clipboard Func _Logo($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Logo $Logo &= '/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAQDAwQDAwQEAwQFBAQFBgoHBgYGBg0JCggKDw0QEA8NDw4RExgUERIXEg4PFRwVFxkZGxsbEBQdHx0aHxgaGxr/2wBDAQQFBQYFBgwHBwwaEQ8RGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhr/wgARCADEBKMDASIAAhEBAxEB/8QAGwABAAIDAQEAAAAAAAAAAAAAAAQFAQMGAgf/xAAaAQEAAwEBAQAAAAAAAAAAAAAAAgMEBQEG/9oADAMBAAIQAxAAAAH7+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYMgAAAAAAGDLGQAAAAAAAAAAAAAAYMsZAA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= FileOpen($sSavePath & "\GDI+ Color Transformer 07.2.2.1.jpg", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Logo Func _Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_Base64Decode Func _WinAPI_LZNTDecompress(ByRef $tInput, ByRef $tOutput, $iBufferSize) $tOutput = DllStructCreate("byte[" & $iBufferSize & "]") If @error Then Return SetError(1, 0, 0) Local $aRet = DllCall("ntdll.dll", "uint", "RtlDecompressBuffer", "ushort", 0x0002, "struct*", $tOutput, "ulong", $iBufferSize, "struct*", $tInput, "ulong", DllStructGetSize($tInput), "ulong*", 0) If @error Then Return SetError(2, 0, 0) If $aRet[0] Then Return SetError(3, $aRet[0], 0) Return $aRet[6] EndFunc ;==>_WinAPI_LZNTDecompress #EndRegion needed additional functions Requirements: Vista or higher operating system! Souce Code is made for AutoIt version 3.3.8.1 only! Please report any bug if found (I'm sure you will ) Download: GDI+ Color Transformer v0.9.7 build 2016-04-23.7z (previous downloads: 347) Br, UEZ
-
Hi, What I would like to accomplish is to take a screenshot and upload it to a remote php file via _winHTTP. Previously, we were taking the screenshots and saving them to a network folder. However, we would now like to alter this so that it posts the information instead through win http. Please see the following code sample (note it does NOT run, it's just for reference). $hbitmap = _ScreenCapture_Capture('', $iScreenCapDimensions[1] , $iScreenCapDimensions[2], $iScreenCapDimensions[3], $iScreenCapDimensions[4]) _SavehBitmapEx($hbitmap, 100000000, _WinAPI_GetSystemMetrics(78), _WinAPI_GetSystemMetrics(79)) Func _SavehBitmapEx($hbitmap, $iID, $iWidth, $iHeight) Local $save_result = true $bitmap = _GDIPlus_BitmapCreateFromHBITMAP($hbitmap) $graphics = _GDIPlus_ImageGetGraphicsContext($bitmap) $resizedbitmap = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $graphics) $graphics2 = _GDIPlus_ImageGetGraphicsContext($resizedbitmap) _GDIPLUS_GraphicsSetInterpolationMode($graphics2, $InterpolationModeHighQualityBicubic) _GDIPlus_GraphicsDrawImageRect($graphics2, $bitmap, 0, 0, $iWidth, $iHeight) ;;; - CODE THAT REQUIRES UPDATE Local $locImgFile = "C:\temp\" & _GetImageFolderPathFromId($iID, '') $save_result = _GDIPlus_ImageSaveToFile($resizedbitmap, $locImgFile) ;saves to temp file PostImage(_GetImageFolderPathFromId($iID, '/'), FileRead($locImgFile)) ;file reads image and uploads to http server FileDelete($locImgFile) ;deletes image when done ;;; - END CODE THAT REQUIRES UPDATE _GDIPlus_GraphicsDispose($graphics) _GDIPlus_GraphicsDispose($graphics2) _GDIPlus_BitmapDispose($bitmap) _GDIPlus_BitmapDispose($resizedbitmap) return $save_result EndFunc ;==>_SavehBitmapEx Func _GetImageFolderPathFromId($id, $sep = '\') Local $aLastImageSplit $aLastImageSplit = StringSplit(String($id), '') $return = $aLastImageSplit[1] & $aLastImageSplit[2] & $aLastImageSplit[3] & $sep & _ $aLastImageSplit[4] & $aLastImageSplit[5] & $aLastImageSplit[6] & $sep & _ $aLastImageSplit[7] & $aLastImageSplit[8] & $aLastImageSplit[9] & $sep & _ $aLastImageSplit[10] & $aLastImageSplit[11] & $aLastImageSplit[12] & '.jpg' return $return EndFunc Func _GDIPlus_SaveImage2BinaryString($hBitmap, $iQuality = 100) ;coded by Andreik, modified by UEZ Local $sImgCLSID = _GDIPlus_EncodersGetCLSID("jpg") Local $tGUID = _WinAPI_GUIDFromString($sImgCLSID) Local $pEncoder = DllStructGetPtr($tGUID) Local $tParams = _GDIPlus_ParamInit(1) Local $tData = DllStructCreate("int Quality") DllStructSetData($tData, "Quality", $iQuality) ;quality 0-100 Local $pData = DllStructGetPtr($tData) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) Local $pParams = DllStructGetPtr($tParams) Local $hStream = DllCall("ole32.dll", "uint", "CreateStreamOnHGlobal", "ptr", 0, "bool", True, "ptr*", 0) ;http://msdn.microsoft.com/en-us/library/ms864401.aspx If @error Then Return SetError(1, 0, 0) $hStream = $hStream[3] DllCall($ghGDIPDll, "uint", "GdipSaveImageToStream", "ptr", $hBitmap, "ptr", $hStream, "ptr", $pEncoder, "ptr", $pParams) _GDIPlus_BitmapDispose($hBitmap) Local $hMemory = DllCall("ole32.dll", "uint", "GetHGlobalFromStream", "ptr", $hStream, "ptr*", 0) ;http://msdn.microsoft.com/en-us/library/aa911736.aspx If @error Then Return SetError(2, 0, 0) $hMemory = $hMemory[2] Local $iMemSize = _MemGlobalSize($hMemory) Local $pMem = _MemGlobalLock($hMemory) $tData = DllStructCreate("byte[" & $iMemSize & "]", $pMem) Local $bData = DllStructGetData($tData, 1) Local $tVARIANT = DllStructCreate("word vt;word r1;word r2;word r3;ptr data;ptr") Local $aCall = DllCall("oleaut32.dll", "long", "DispCallFunc", "ptr", $hStream, "dword", 8 + 8 * @AutoItX64, "dword", 4, "dword", 23, "dword", 0, "ptr", 0, "ptr", 0, "ptr", DllStructGetPtr($tVARIANT)) ;http://msdn.microsoft.com/en-us/library/windows/desktop/ms221473(v=vs.85).aspx _MemGlobalFree($hMemory) Return $bData EndFunc ;==>_GDIPlus_SaveImage2BinaryString The above method works but I would like to change it. It saves a temp jpg, file reads it, uploads to server and deletes the temp file. I would like to utilize the "_GDIPlus_SaveImage2BinaryString" method instead rather than using a temp file. Changing: ;;; - CODE THAT REQUIRES UPDATE Local $locImgFile = "C:\temp\" & _GetImageFolderPathFromId($iID, '') $save_result = _GDIPlus_ImageSaveToFile($resizedbitmap, $locImgFile) ;saves to temp file PostImage(_GetImageFolderPathFromId($iID, '/'), FileRead($locImgFile)) ;file reads image and uploads to http server FileDelete($locImgFile) ;deletes image when done ;;; - END CODE THAT REQUIRES UPDATE To: ;;; - CODE THAT REQUIRES UPDATE PostImage(_GetImageFolderPathFromId($iID, '/'), _GDIPlus_SaveImage2BinaryString($resizedbitmap)) ;sends binary image to server directly ;;; - END CODE THAT REQUIRES UPDATE Does NOT work. Anyone have any ideas? Thanks in advance.
-
I am trying to add a specific icon or image to a specific ListView Item . I add the items in the ListView control with this command : _GUICtrlListView_AddItem . Right now what I only managed to do is to add an icon for ALL the items in the control, BUT, if I try to add an icon to only one item , its just impossible Atleast for me >_< I have tried GUICtrlSetImage(-1, "C:icon.ico") tried with creating _GUIImageList_Create , icons not transparent , 16x16 pixels, tried many other icons, tried with .bmp, .png - nothing worked so far O_O ! Anyone yet managed to do something with this problem so far? Thanks
-
Function Reference _GuiImageListEx.au3 Functions that assist with ImageList control management with support a vertical image strip! Sintax: _GUIImageList_AddVerticalStrip( hWnd, hInstance, sImage[, iWidth = 0[, iHeight = 0[, iImgCount = -1 ]]] ) _GUIImageList_DrawVerticalStrip( hWnd, iIndex, hDC, iX, iY[, iStyle = 0 ] ) _GUIImageList_DrawVerticalStripEx( hWnd, iIndex, hDC, iX, iY[, iDX = 0[, iDY = 0[, iStyle = 0 ] ) _GUIImageList_DestroyEx( hWnd ) Supports: ; Bitmaps with vertical image strip! Downloads: Version: 0.12 _GuiImageListEx_(RedirectLink).html Note: Solve this old problem: Need the WinApiEx.au3: Usage example is included! Sample: Fixes: Regards, João Carlos.
- 4 replies
-
- _guiimagelist
- draw
-
(and 5 more)
Tagged with:
-
I know there are snippet threads, but I'd like this one to be specific. I've see quite a few neat GDI+ code snippets (UEZ and Progandy come to mind first) to manipulate, create, etc, and I thought it'd be neat to be able to find them under one thread. I'm going to reserve the next 3 posts because I'm unsure at the moment if it's the "Quote" or "Spoiler" bbcode tags that has the 10 limit. You can link or post the snippets you find or create and I'll title them and put them in the threads for everyone to find. ( Going to have to remember to edit with regular editor! ) Some of these may not have titles, so I may create my own, if the author(s) want(s) a different one, let me know. _GDIPlus_WaterMark.au3 - Author: UEZ - Added: 2012-10-13 - Updated: _GDIPlus_BMPFromMemory – Author UEZ – Added: 2012-10-14 – Updated: Example – Needle Movement (4bit example provided, link to 32bit found in code) – Author: UEZ - Added: 2012-10-14 – Updated:
-
Short version, can it be done? In theory it should be simple enough, open a file, write a header, then dump each pixel data in succession... headers are probably going to give me trouble more than anything, but is the overall idea solid? I'm trying to write a script for making large screenshots, and while this approach might be a little primitive... screw it, whatever works, right?
- 6 replies
-
- screenshot
- capture
-
(and 3 more)
Tagged with: