Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/18/2016 in all areas

  1. jguinch

    need help with regex

    @iamtheky : To understand how look arround assertions work, here is an example : You have the string A123B456C789 and you want to capture each numbers enclosed by a letter (123 and 456) What comes to your mind is probably a regex like [A-Z](\d+)[A-Z] : in this case, you will have only one result (123) because the regex consumes the specified characters (A123B) and then continues to search from the position after the first match. It remains "456C789" in the chain : the B has been consumed, so 456 cannot be considered enclosed by 2 letters. To avoid the regex consumes characters, you can use a look arround assertion : [A-Z](\d+)(?=[A-Z]) With this regex, the letter after the number is not consumed : it means take one letter, then a number, and look after to see if there is a letter. "Look arround" does not consume characters, so the first match for this regex consumes A123, that's all. Next search starts from B, so the capture works, 456 is captured. The last search starts from C and so on . I could have used a look before for this job : (?<=[A-Z])(\d+)[A-Z], it works as well. I hope it will help you to understand
    2 points
  2. Since I disovered FreeBasic I decided to create a DLL to implement much faster image processing functionality to AutoIt. Following functions are implemented yet: _GDIPlus_BitmapApplyFilter_BWJJNDithering _GDIPlus_BitmapApplyFilter_BWBayerOrderedDithering _GDIPlus_BitmapApplyFilter_Cartoon1 _GDIPlus_BitmapApplyFilter_ColorAccent _GDIPlus_BitmapApplyFilter_Convolution_AnotherBlur _GDIPlus_BitmapApplyFilter_Convolution_BoxBlur _GDIPlus_BitmapApplyFilter_Convolution_EdgeDetection1 _GDIPlus_BitmapApplyFilter_Convolution_EdgeDetection2 _GDIPlus_BitmapApplyFilter_Convolution_EdgeDetection3 _GDIPlus_BitmapApplyFilter_Convolution_EdgeDetection4 _GDIPlus_BitmapApplyFilter_Convolution_EdgeDetection5 _GDIPlus_BitmapApplyFilter_Convolution_EdgeDetection6 _GDIPlus_BitmapApplyFilter_Convolution_Emboss1 _GDIPlus_BitmapApplyFilter_Convolution_Emboss45Degree _GDIPlus_BitmapApplyFilter_Convolution_EmbossTopLeftBottomRight _GDIPlus_BitmapApplyFilter_Convolution_Gaussian3x3 _GDIPlus_BitmapApplyFilter_Convolution_Gaussian5x5_1 _GDIPlus_BitmapApplyFilter_Convolution_Gaussian5x5_2 _GDIPlus_BitmapApplyFilter_Convolution_GaussianBlur _GDIPlus_BitmapApplyFilter_Convolution_IntenseEmboss _GDIPlus_BitmapApplyFilter_Convolution_Kirsch _GDIPlus_BitmapApplyFilter_Convolution_Laplace1 _GDIPlus_BitmapApplyFilter_Convolution_Laplace2 _GDIPlus_BitmapApplyFilter_Convolution_Laplace3 _GDIPlus_BitmapApplyFilter_Convolution_LaplacianOfGaussian _GDIPlus_BitmapApplyFilter_Convolution_ManualMatrix _GDIPlus_BitmapApplyFilter_Convolution_MotionBlur _GDIPlus_BitmapApplyFilter_Convolution_Outline3x3 _GDIPlus_BitmapApplyFilter_Convolution_Prewitt _GDIPlus_BitmapApplyFilter_Convolution_Sharpen1 _GDIPlus_BitmapApplyFilter_Convolution_Sharpen2 _GDIPlus_BitmapApplyFilter_Convolution_Sobel _GDIPlus_BitmapApplyFilter_Convolution_SovelVsPrewitt _GDIPlus_BitmapApplyFilter_Convolution_TriangleBlur _GDIPlus_BitmapApplyFilter_Convolution_Unsharp _GDIPlus_BitmapApplyFilter_Convolution_Unsharp5x5 _GDIPlus_BitmapApplyFilter_Delaunay _GDIPlus_BitmapApplyFilter_Dilatation _GDIPlus_BitmapApplyFilter_DistortionBlur _GDIPlus_BitmapApplyFilter_Edges _GDIPlus_BitmapApplyFilter_Erosion _GDIPlus_BitmapApplyFilter_FakeGreyscale _GDIPlus_BitmapApplyFilter_FishEye _GDIPlus_BitmapApplyFilter_Indexed _GDIPlus_BitmapApplyFilter_Jitter _GDIPlus_BitmapApplyFilter_Kuwahara _GDIPlus_BitmapApplyFilter_Linellism _GDIPlus_BitmapApplyFilter_Median _GDIPlus_BitmapApplyFilter_Median2 _GDIPlus_BitmapApplyFilter_Mosaic _GDIPlus_BitmapApplyFilter_OilPainting _GDIPlus_BitmapApplyFilter_Open _GDIPlus_BitmapApplyFilter_PenSketch _GDIPlus_BitmapApplyFilter_PenSketch2 _GDIPlus_BitmapApplyFilter_Pixelate _GDIPlus_BitmapApplyFilter_Pointillism _GDIPlus_BitmapApplyFilter_RadialBlur _GDIPlus_BitmapApplyFilter_Raster _GDIPlus_BitmapApplyFilter_Spiral _GDIPlus_BitmapApplyFilter_Swirl _GDIPlus_BitmapApplyFilter_SymmetricNearestNeighbour _GDIPlus_BitmapApplyFilter_TiltShift _GDIPlus_BitmapApplyFilter_TimeWarp _GDIPlus_BitmapApplyFilter_Ver _GDIPlus_BitmapApplyFilter_Wave _GDIPlus_BitmapApplyFilter_XRay Since I am absolutely a newbie in FreeBasic, the DLL may contain errors. Please report any bug. FreeBasic source code can be found here: https://pastebin.com/Lugp6rCR To do: add function headers with descriptions speed-up FB code -> partly done add more filters -> ongoing Credits to: Jakub Szymanowski rdc Dewald Esterhuizen Santhosh G_ Christian Graus www.gutgames.com Have fun. You can compare the speed with AutoIt version: #AutoIt3Wrapper_Version=b #include <Array.au3> #include <GDIPlus.au3> Global $sFile = FileOpenDialog("Select an image", "", "Images (*.jpg;*.png;*.gif;*.bmp)") If @error Then Exit _GDIPlus_Startup() Global Const $STM_SETIMAGE = 0x0172 Global Const $hImage = _GDIPlus_ImageLoadFromFile($sFile) Global Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage) Global Const $hGUI = GUICreate("GDI+ Image Filters", $iW * 2, $iH) Global $fProg = 0, $iEnd = $iW * $iH - 1 AdlibRegister("Progress", 490) Global $t = TimerInit() Global Const $hGDIBitmap = _GDIPlus_BitmapApplyFilter_Median($hImage, 4) ConsoleWrite(Round(TimerDiff($t) / 1000, 2) & " s / " & Round(TimerDiff($t) / 60000, 2) & " min" & @CRLF) Global Const $iPic = GUICtrlCreatePic("", 0, 0, $iW - 1, $iH - 1) Global Const $iPic_o = GUICtrlCreatePic("", $iW, 0, $iW - 1, $iH - 1) _WinAPI_DeleteObject(GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hGDIBitmap)) Global Const $hGDIBitmap2 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _WinAPI_DeleteObject(GUICtrlSendMsg($iPic_o, $STM_SETIMAGE, $IMAGE_BITMAP, $hGDIBitmap2)) GUISetState() AdlibUnRegister("Progress") ToolTip("") Do Until GUIGetMsg() = -3 _GDIPlus_ImageDispose($hImage) _WinAPI_DeleteObject($hGDIBitmap) _WinAPI_DeleteObject($hGDIBitmap2) _GDIPlus_Shutdown() Exit Func Progress() ToolTip(Int($fProg / $iEnd * 100) & " % / " & Round(TimerDiff($t) / 60000, 2) & " min", MouseGetPos(0) + 30, MouseGetPos(1) + 30) EndFunc #Region Symmetric Nearest Neighbour Func _GDIPlus_BitmapApplyFilter_SymmetricNearestNeighbour($hImage, $fRadius = 2, $bGDI = True) ;no alpha channel implemented yet Local Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage) Local Const $hBitmap_Dest = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $tBitmapData_Dest = _GDIPlus_BitmapLockBits($hBitmap_Dest, 0, 0, $iW - 1, $iH - 1, $GDIP_ILMWRITE, $GDIP_PXF32ARGB) Local Const $iScan0_Dest = DllStructGetData($tBitmapData_Dest, "Scan0") Local Const $tPixel_Dest = DllStructCreate("int[" & $iW * $iH & "];", $iScan0_Dest) Local Const $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW - 1, $iH - 1, $GDIP_ILMREAD, $GDIP_PXF32ARGB) Local Const $iScan0 = DllStructGetData($tBitmapData, "Scan0") Local Const $tPixel = DllStructCreate("int[" & $iW * $iH & "];", $iScan0) Local $iRowOffset, $iX, $iY, $c, $k, $sumR, $sumG, $sumB, $iCount, $xx, $yy, $iR, $iG, $iB, $iR1, $iG1, $iB1, $iR2, $iG2, $iB2, $x, $y For $iY = 0 To $iH - 1 $iRowOffset = $iY * $iW For $iX = 0 To $iW - 1 $sumR = 0 $sumG = 0 $sumB = 0 $iCount = 0 $c = DllStructGetData($tPixel, 1, $iRowOffset + $iX) $iR = BitShift(BitAND(0x00FF0000, $c), 16) $iG = BitShift(BitAND(0x0000FF00, $c), 8) $iB = BitAND(0x000000FF, $c) For $yy = -$fRadius To $fRadius For $xx = -$fRadius To $fRadius $k = $iX + $xx $x = $k < 0 ? 0 : $k > $iW - 1 ? $iW - 1 : $k $k = $iY + $yy $y = $k < 0 ? 0 : $k > $iH - 1 ? $iH - 1 : $k $c = DllStructGetData($tPixel, 1, $y * $iW + $x) $iR1 = BitShift(BitAND(0x00FF0000, $c), 16) $iG1 = BitShift(BitAND(0x0000FF00, $c), 8) $iB1 = BitAND(0x000000FF, $c) $k = $iX - $xx $x = $k < 0 ? 0 : $k > $iW - 1 ? $iW - 1 : $k $k = ($iY - $yy) $y = $k < 0 ? 0 : $k > $iH - 1 ? $iH - 1 : $k $c = DllStructGetData($tPixel, 1, $y * $iW + $x) $iR2 = BitShift(BitAND(0x00FF0000, $c), 16) $iG2 = BitShift(BitAND(0x0000FF00, $c), 8) $iB2 = BitAND(0x000000FF, $c) If __DeltaE($iR, $iG, $iB, $iR1, $iG1, $iB1) < __DeltaE($iR, $iG, $iB, $iR2, $iG2, $iB2) Then $sumR += $iR1 $sumG += $iG1 $sumB += $iB1 Else $sumR += $iR2 $sumG += $iG2 $sumB += $iB2 EndIf $iCount += 1 Next Next DllStructSetData($tPixel_Dest, 1, 0xFF000000 + Int($sumR / $iCount) * 0x10000 + Int($sumG / $iCount) * 0x100 + Int($sumB / $iCount), $iRowOffset + $iX) $fProg += 1 Next Next _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData) _GDIPlus_BitmapUnlockBits($hBitmap_Dest, $tBitmapData_Dest) _GDIPlus_ImageSaveToFile($hBitmap_Dest, @ScriptDir & "\Filter_SNN" & $fRadius & "_" & @YEAR & @MON & @MDAY & @MIN & @SEC & ".png") If $bGDI Then Local $hGDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_Dest) _GDIPlus_BitmapDispose($hBitmap_Dest) Return $hGDIBitmap EndIf Return $hBitmap_Dest EndFunc Func __DeltaE($iR1, $iG1, $iB1, $iR2, $iG2, $iB2) Return Sqrt(($iR1 - $iR2) * ($iR1 - $iR2) + ($iG1 - $iG2) * ($iG1 - $iG2) + ($iB1 - $iB2) * ($iB1 - $iB2)) EndFunc #EndRegion #Region Jitter Func _GDIPlus_BitmapApplyFilter_Jitter($hImage, $iAmount = 20, $bGDI = True) Local Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage) Local Const $hBitmap_Dest = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $tBitmapData_Dest = _GDIPlus_BitmapLockBits($hBitmap_Dest, 0, 0, $iW - 1, $iH - 1, $GDIP_ILMWRITE, $GDIP_PXF32ARGB) Local Const $iScan0_Dest = DllStructGetData($tBitmapData_Dest, "Scan0") Local Const $tPixel_Dest = DllStructCreate("int[" & $iW * $iH & "];", $iScan0_Dest) Local Const $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW - 1, $iH - 1, $GDIP_ILMREAD, $GDIP_PXF32ARGB) Local Const $iScan0 = DllStructGetData($tBitmapData, "Scan0") Local Const $tPixel = DllStructCreate("int[" & $iW * $iH & "];", $iScan0) Local $iX, $iY, $iRowOffset, $fNX, $fNY For $iY = 0 To $iH - 1 $iRowOffset = $iY * $iW + 1 For $iX = 0 To $iW - 1 $fNX = $iX + Int((Random() - 0.5) * $iAmount) $fNX = $fNX < 1 ? 1 : $fNX > $iW - 1 ? $iW - 1 : $fNX $fNY = ($iY + Int((Random() - 0.5) * $iAmount)) $fNY = $fNY < 1 ? 1 : $fNY > $iH - 1 ? $iH - 1 : $fNY $fNY *= $iW DllStructSetData($tPixel_Dest, 1, DllStructGetData($tPixel, 1, $fNY + $fNX), $iRowOffset + $iX) $fProg += 1 Next Next _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData) _GDIPlus_BitmapUnlockBits($hBitmap_Dest, $tBitmapData_Dest) _GDIPlus_ImageSaveToFile($hBitmap_Dest, @ScriptDir & "\Filter_Jitter" & $iAmount & "_" & @YEAR & @MON & @MDAY & @MIN & @SEC & ".png") If $bGDI Then Local $hGDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_Dest) _GDIPlus_BitmapDispose($hBitmap_Dest) Return $hGDIBitmap EndIf Return $hBitmap_Dest EndFunc #EndRegion #Region Median Func _GDIPlus_BitmapApplyFilter_Median($hImage, $fRadius = 3, $bGDI = True) Local Const $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage) Local Const $hBitmap_Dest = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $tBitmapData_Dest = _GDIPlus_BitmapLockBits($hBitmap_Dest, 0, 0, $iW - 1, $iH - 1, $GDIP_ILMWRITE, $GDIP_PXF32ARGB) Local Const $iScan0_Dest = DllStructGetData($tBitmapData_Dest, "Scan0") Local Const $tPixel_Dest = DllStructCreate("int[" & $iW * $iH & "];", $iScan0_Dest) Local Const $tBitmapData = _GDIPlus_BitmapLockBits($hImage, 0, 0, $iW - 1, $iH - 1, $GDIP_ILMREAD, $GDIP_PXF32ARGB) Local Const $iScan0 = DllStructGetData($tBitmapData, "Scan0") Local Const $tPixel = DllStructCreate("int[" & $iW * $iH & "];", $iScan0) Local $iX, $iY, $iRowOffset For $iY = 0 To $iH - 1 $iRowOffset = $iY * $iW + 1 For $iX = 0 To $iW - 1 DllStructSetData($tPixel_Dest, 1, __Median_Value($iX, $iY, $fRadius, $tPixel, $iW, $iH), $iRowOffset + $iX) $fProg += 1 Next Next _GDIPlus_BitmapUnlockBits($hImage, $tBitmapData) _GDIPlus_BitmapUnlockBits($hBitmap_Dest, $tBitmapData_Dest) _GDIPlus_ImageSaveToFile($hBitmap_Dest, @ScriptDir & "\Filter_Median" & $fRadius & "_" & @YEAR & @MON & @MDAY & @MIN & @SEC & ".png") If $bGDI Then Local $hGDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_Dest) _GDIPlus_BitmapDispose($hBitmap_Dest) Return $hGDIBitmap EndIf Return $hBitmap_Dest EndFunc Func __Median_Value($iPosX, $iPosY, $fRadius, $tPixel, $iW, $iH) Local $iX, $iY, $aColors[1000], $iColors = 0, $iSize = $iW * $iH - 1, $iOff, $e For $iX = $iPosX - $fRadius To $iPosX + $fRadius For $iY = $iPosY - $fRadius To $iPosY + $fRadius $iOff = 1 + $iY * $iW + $iX $aColors[$iColors] = DllStructGetData($tPixel, 1, $iOff < 1 ? 1 : $iOff > $iSize ? $iSize : $iOff) $iColors += 1 Next Next ReDim $aColors[$iColors] ;~ _ArraySort($aColors, 0) $e = $iColors - 1 __ArrayQuickSort1D($aColors, 0, $e) Local $iMid = Floor($iColors / 2), $iMedian If BitAND($iColors, 1) Then $iMedian = Int($aColors[$iMid + 1]) Else $iMedian = Int(($aColors[$iMid] + $aColors[$iMid + 1]) / 2) EndIf Return $iMedian EndFunc #EndRegion _GDIPlus_BitmapApplyFilter v0.9.8 build 2024-04-17 beta.7z
    1 point
  3. scintilla4evr

    ColorEx UDF

    Hello! I wrote a small UDF for converting and comparing colors and I'd like to share it with you. Features: Converting colors to CMYK, XYZ, CIE-L*ab and CIE-L*CH Calculating color harmonies Calculating delta value for colors (Delta C*, H* and E*) Lots of color constants (over 1900, including colors from Google Material Design and web colors) ColorEx UDF
    1 point
  4. jguinch

    need help with regex

    \D? takes any non-digits. If it matches, the non digit is consumed, but with "?" it is not mandatory, so it works with 123 even if there is no letter before (it's not what I wanted to do in my example). Look at the difference of the two regex here (the consumed characters appear in blue and green) : https://regex101.com/r/uG2lZ7/1 https://regex101.com/r/uG2lZ7/2 The first link works, the second no. It's not easy to explain, I spent a lot of time doing tests before to understand Another example : check if a string contains some desired words. You have to check if a string contains the words "iamtheky", "King" and "Regex", the order does not matter. ^(?=.*iamtheky)(?=.*King)(?=.*Regex) : the "look after" assertion retains the current position (beginnig) and searchs on the right. First, it looks for .*iamtheky and comes back at the current position. If the string is found, the regex continues the job (looks at the right for .*King and comes back again). If the string is not found, the regex fails. So it matchs with both iamtheky is the future King of Regex and The future Regex's King is iamtheky
    1 point
  5. Danyfirex

    Convert XML to XLS

    Try this. #include <Excel.au3> Local $sSourceFileXML = "C:\Users\xxx\Desktop\1.xml" Local $sFinalFileXLS = "C:\Users\xxx\Desktop\1.xls" _Convert($sSourceFileXML, $sFinalFileXLS) Func _Convert($sXML, $sXLS) Local $oExcel = _Excel_Open(False) If @error Then Return False Local $oWorkbook = _Excel_BookOpen($oExcel, $sXML) If @error Then _Excel_Close($oExcel) Return False EndIf Local $iResult = _Excel_BookSaveAs($oWorkbook, $sXLS) _Excel_Close($oExcel) Return $iResult EndFunc ;==>_Convert Saludos
    1 point
  6. Yes, we have a pretty lively chat going on right here: https://www.autoitscript.com/forum/forum/6-chat/ As a new member you cannot see Chat, but I have changed that for you.
    1 point
  7. jchd

    need help with regex

    See http://www.pcre.org/original/doc/html/pcrepattern.html for more information about feaures and gory details. EDIT: forgot to mention that AutoIt currently uses the "legacy" version of PCRE, now nicknamed PCRE1. As the PCRE main webpage explains, PCRE has been substantively rewritten as PCRE2. While 99.9% of the regexp features are compatible, some corner cases have been fixed or changed. The main changes are in the library interface functions. So do not refer to PCRE2 documentation until a new version of AutoIt is made available with explicit support for it.
    1 point
  8. Hello you must get the lower 32 bits value of your x64 value. Basically you can do this. Local $iHotItem = BitShift(_GUICtrlListView_GetHotItem(($hListView)), 32) If $iHotItem > -1 Then ConsoleWrite($iHotItem & @CRLF) EndIf Saludos
    1 point
  9. water

    Excel... UDF error handling

    Thanks for the feedback. So we will wait until someone has a real problem that can only be solved with cross instance functions
    1 point
  10. Yes it's a array, but only $xyPush[0] = 1 and not > 1 as you exspexted, so test this way: While 1 Local $Cordinate = MyTCP_Client($sIPAddress, $iPort) ConsoleWrite($Cordinate) Local $xyPush = StringSplit($Cordinate, " ") If IsArray($xyPush) Then _ArrayDisplay($xyPush) If $xyPush[0] > 1 Then MouseMove($xyPush[1], $xyPush[2], 3) If ($xyPush[0] > 2) And $xyPush[3] Then MouseClick($MOUSE_CLICK_LEFT) ElseIf ($xyPush[0] > 3) And $xyPush[4] Then MouseClick($MOUSE_CLICK_RIGHT) EndIf EndIf Sleep(10) WEnd or this way: While 1 Local $Cordinate = MyTCP_Client($sIPAddress, $iPort) ConsoleWrite($Cordinate) $Cordinate &= '0 0 0 0'; bewaring from to small array ;only affect's unnececarry mousmoves to 0,0 ;if $coordinate before not as exspected Local $xyPush = StringSplit($Cordinate, " ") ;_ArrayDisplay($xyPush) MouseMove($xyPush[1], $xyPush[2], 3) If $xyPush[3] Then MouseClick($MOUSE_CLICK_LEFT) ElseIf And $xyPush[4] Then MouseClick($MOUSE_CLICK_RIGHT) EndIf EndIf Sleep(10) WEnd
    1 point
  11. mikell

    need help with regex

    iamtheky, Because the OP's particular sample is very simple, the answer is : none Furthermore, regex101 says that the lookbehind consumes more steps than the simple expression Edit But I strongly suspect that Melba chose the lookbehind for teaching purpose, to introduce the concept - which is extremely powerful and useful in more complex situations
    1 point
  12. The problem seems to be the LZMA decompression function which is probably not 64-bit compatible. The output of $L_BinImg differs between x86 / x64! The output from x64 is not a valid bitmap format and thus the error appears. This works: #AutoIt3Wrapper_UseX64=Y #include <ButtonConstants.au3> #include <GDIPlus.au3> #include <GDIPlusConstants.au3> #include <GuiButton.au3> #include <GUIConstants.au3> #include <MsgBoxConstants.au3> #include <StaticConstants.au3> #include <WinAPI.au3> Local $L_GuiWinHdl, $L_CtrlID, $L_BinImg $L_GuiWinHdl = GUICreate("Test", 400, 400 ) $L_CtrlID = GUICtrlCreatePic("", -1, -1, 200, 200 ) GUISetState() _GDIPlus_Startup() Local $L_BinImg = _Image() _Set_Control_From_Binary( $L_CtrlID, $L_BinImg ) MsgBox($MB_OK, "Test", "@error = " & @error ) GUIDelete( $L_GuiWinHdl ) _GDIPlus_Shutdown() Exit ; ;= = = = ; ; Func _Set_Control_From_Binary( $arg_ControlID, ByRef $arg_BinaryImage ) ; ; By UEZ, Prog@ndy, and Zedna, etc ; Local $Lf_BitmapHdl, $Lf_HbitmapHdl, $Lf_Error = 0, $Lf_Extended = 0 If @OSBuild < 6000 Then $Lf_BitmapHdl = _GDIPlus_BitmapCreateFromMemory( $arg_BinaryImage ) $Lf_Error = @error $Lf_Extended = @extended If $Lf_Error <> 0 Then SetError( $Lf_Error, $Lf_Extended ) Return EndIf $Lf_HbitmapHdl = _ConvertBitmapToHbitmap( $Lf_BitmapHdl ) $Lf_Error = @error $Lf_Extended = @extended _GDIPlus_BitmapDispose( $Lf_BitmapHdl ) Else $Lf_HbitmapHdl = _GDIPlus_BitmapCreateFromMemory( $arg_BinaryImage, True ) $Lf_Error = @error $Lf_Extended = @extended If $Lf_Error <> 0 Then SetError( $Lf_Error, $Lf_Extended ) Return EndIf EndIf _WinAPI_DeleteObject( GUICtrlSendMsg( $arg_ControlID, $STM_SETIMAGE, $IMAGE_BITMAP, $Lf_HbitmapHdl ) ) SetError( $Lf_Error, $Lf_Extended ) Return $Lf_Error EndFunc ;==> _Set_Control_From_Binary ; ;= = = = ; Func _ConvertBitmapToHbitmap($hBitmap) Local $Lf_Error = 0 Local $iButtonColor = _WinAPI_GetSysColor($COLOR_BTNFACE) $iButtonColor = 0x10000 * BitAND($iButtonColor, 0xFF) + BitAND($iButtonColor, 0x00FF00) + BitShift($iButtonColor, 16) Local $iWidth = _GDIPlus_ImageGetWidth($hBitmap), $iHeight = _GDIPlus_ImageGetHeight($hBitmap) Local $hBitmap_New = _GDIPlus_BitmapCreateFromMemory($iWidth, $iHeight) Local $hCtx_new = _GDIPlus_ImageGetGraphicsContext($hBitmap_New) Local $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000 + $iButtonColor) _GDIPlus_GraphicsFillRect($hCtx_new, 0, 0, $iWidth, $iHeight, $hBrush) _GDIPlus_GraphicsDrawImageRect($hCtx_new, $hBitmap, 0, 0, $iWidth, $iHeight) Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_New) $Lf_Error = @error _GDIPlus_BrushDispose($hBrush) _GDIPlus_BitmapDispose($hBitmap_New) _GDIPlus_GraphicsDispose($hCtx_new) SetError( $Lf_Error ) Return $hHBitmap EndFunc ;==>_ConvertBitmapToHbitmap ; ;= = = = ; Func _Image($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Image $Image &= '/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAAeAGQDAREAAhEBAxEB/8QAHgAAAQQCAwEAAAAAAAAAAAAABwAFBggJCgIDBAv/xABBEAAABgEBAwYKCAQHAAAAAAABAgMEBQYHCAAREgkTFBUhMQoZGkFRVVdhlNQWF3GRlbHW8CIjMjNTZIGSoaTB/8QAHgEAAQQCAwEAAAAAAAAAAAAAAAUGBwgECQIDCgH/xABEEQAABgEBAwYKBwYGAwAAAAABAgMEBQYHEQAIEhMUFRchMRZBUVRVYZSV1NUYI3GBkbHBCSIyocXxJUVSY4TwhZLR/9oADAMBAAIRAxEAPwDbq1F6vm+PrHMVaJeJj1YotEiSNeppneOkkWhpd3ISZW4vYs8S+OvCNWMWoiv0xnIuHcgfjQax04UXGB5xg1kXKZgBwBXHEuicQSTEygNk0EBOCLgHKQEdKLOAOnySqBEkQ0OovUfL28EnUJqQhGDhMeZGUY8DRwmAuFipNzv3Dt4CRnDIzBwdWNbtWR0lecN3ay7owmSQZ0GmeUBuTRZQiU+cpQEwlL15bhEA3juATBZgE24O8dwb/d3bTQ0wpFKlKJmeo9mo8zjA17g7ujxAPL4/tEdR2qpI72FibnOCcqYoAI6B0nPiIB4gE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pt66dLZ1zUik4XVVTapsKXwN0znExUSqFiyKHKmUQIBziJzAG8w7xHZVXvdqcmEy0mQ5ja6j0dFl117+wjIodvqDZuM8O46YEKRpAKpFIGhQGcsSogAetWWUMP3iO0bN4JnovMO82c83CI/5aph+TINsMbZPj3vij/wAJh8LsqFxvTC90Qf3rMj+cgO3DyS/Rb7cc3fD1T5LY8K57z4vsTD4Xbl1c030Qf3pMfMNl5Jfot9uObvhqp8lseFc/58X2Nh8LsdXNN9EH96THzDZeSX6Lfbjm74aqfJbHhXP+fF9jYfC7HVzTfRB/ekx8w2Xkl+i3245u+GqnyWx4Vz/nxfY2Hwux1c030Qf3pMfMNl5Jfot9uObvhqp8lseFc/58X2Nh8LsdXNN9EH96THzDZeSX6Lfbjm74aqfJbHhXP+fF9jYfC7HVzTfRB/ekx8w2Xkl+i3245u+GqnyWx4Vz/nxfY2Hwux1c030Qf3pMfMNuBvBK9FRwED5vzaYB7wFvVe3/AKe3EbTOj3vSj9rNj8NtyLjyoF7SxSgD6pSY+YbXK0g+Dp8nvpMuEJkVOuWLLt6rM6lYq9MZFeJOY6Kk26R0WrlCuNihDi4bJqKAgvzBVCCqqO8RVU4kx1JPnuoOXKihBMU/JBwpocZCmIVQG6QEQKcCnOHGCYG0ObUf3h1X46CiIkSmYMEEFSpnRBybiXeCiqoRVREz1wZV2ZEyiaZxSMsKeqaehf3CaZ5yEIkQiaZCppplKRNMhQIQhCABSkIUoAUpSlAClKUAAAAAAAANsLZW2//Z' Local $bString = _WinAPI_Base64Decode($Image) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Test.jpg", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Image 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
    1 point
  13. water

    Excel... UDF error handling

    Don't know if this is possible at all (not all methods/properties/collections are necessarily exposed as COM by Microsoft). I'm not sure I did ever test cross-instance-copying. The rewritten Excel UDF is available since version 3.3.12.0 (June, 2014). This is the first question regarding this issue. If you really need it for production I will spend some time to investigate.
    1 point
  14. water

    Excel... UDF error handling

    #5: Seems to be a limitation of Excel. http://excel.tips.net/T003404_Copying_Between_Instances_of_Excel.html
    1 point
  15. water

    Excel... UDF error handling

    #1: $oSourceSheet = "??????????????????" is evaluated before calling the function. As there is no COM error handler in place at that time and hence the script crashes. WAD. #2: Same as #1 #3: Same as #1 When the error occurs in a function then it is handled by the COM error handler. If it occurs while evaluating the function call then you need to add a COM error handler yourself. The COM error handling after 3.3.12.0 is far from being perfect (I already told Jon about that). Let's see what the next version brings in this respect. For the time being we have to make the best out of it.
    1 point
  16. orbs

    Runwait with @ComSpec

    switch your quotes - external is single, internal is double. like this: RunWait(@ComSpec & ' /c "C:\Program Files\Microsoft Baseline Security Analyzer 2\MBSACLI" /n Password+OS+SQL+IIS /wa /unicode >' & $FilePath1, "", @SW_SHOW)
    1 point
  17. Hi. I just released this software, we need it to override the DHCP server at work. Our DHCP server does not allow per-mac-address configuration, so I coded this utility to allow our developers to use our area's custom DNS server, regardless of what DHCP provides, and let them have the possibiity to quickly shift to automatic configuration when they take their laptops home. https://github.com/pupitetris/DNS-Updater An afternoon's worth of coding, and another half day for polish and release. Pretty old-school simplicity; it was a good excercise to finally code some UI using AutoIt. Hope it's useful to someone.
    1 point
  18. scintilla4evr

    Advanced Math UDF

    Version 1.5: Added graph functions Added GraphFindPathDijkstra() for finding the path in an undirected graph (example included) Advanced Math UDF PS. No example for a genetic algorithm yet. Sorry! Will you forgive me?
    1 point
  19. Jon

    Forum Rules

    We want the forum to be a pleasant place for everyone to discuss AutoIt scripting, and we also want to protect the reputation of AutoIt. So we ask you to respect these simple rules while you are here: Forum Posting 1. Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects: Malware of any form - trojan, virus, keylogger, spam tool, "joke/spoof" script, etc. Bypassing of security measures - log-in and security dialogs, CAPTCHAs, anti-bot agents, software activation, etc. Automation of software/sites contrary to their EULA (see Reporting bullet below). Launching, automation or script interaction with games or game servers, regardless of the game. Running or injecting any code (in any form) intended to alter the original functionality of another process. Decompilation of AutoIt scripts or details of decompiler software. This list is non-exhaustive - the Moderating team reserve the right to close any thread that they feel is contrary to the ethos of the forum. 2. Do not post material that could be considered pornographic, violent or explicit - or express personal opinions that would not be acceptable in a civilized society. Do not post any copyrighted material unless the copyright is owned by you or by this site. 3. To protect this community, any files posted by you are subject to checks to ensure that they do not contain malware. This includes, but is not limited to, decompilation and reverse engineering. 4. Do not flame or insult other members - and just report the thread to a Moderator (see below) if you are so attacked. 5. Do not PM other users asking for support - that is why the forum exists, so post there instead. 6. Do not create multiple accounts - if you inadvertently created multiple accounts then contact a Moderator to close the unwanted ones. 7. Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above. 8. Do not delete your posts, nor completely remove their content, if doing so will interrupt the flow of the thread. 9. Do not post in a thread while the Moderating team are actively trying to determine whether it is legal. The Moderation team will do their best to act in fair and reasonable manner. Sanctions will only be applied as a last resort and any action taken will be explained in the relevant thread. If moderation action is taken, you will need to acknowledge this through a dialog or you will be unable to post further in the forum. Please note that this dialog is not an agreement that the warning was justified - it is only there so that members are aware that moderation action has been taken and that they may have certain restrictions applied to their account. If you feel that you have been unfairly moderated then contact the Moderator concerned - using a PM or the "Report" button is preferable to opening a new thread (although new members may have to do this). But do be aware that the Moderation team has the final word - the rules are set out by the site owner and you are only welcome here if you respect his wishes. Signatures and Avatars There is no formal policy for the use of signatures but if a moderator thinks it is too big and/or distracting then you may be asked to tone it down. No-one likes wading through signatures that are a page high. Similarly for avatars, expect distracting flashing and animated gifs to be removed. Reporting If you feel a post needs Moderator attention, please use the "Report" button next to the post date at the top. You can then enter details of why you have reported the post - but there is no need to include the content of the post as that is done automatically. The Moderating team will be alerted to the post and will deal with it as soon as they can. If you suspect a EULA violation, do not expect the Moderating team to do all the work - please provide some evidence in the report such as a copy of (or link to) the EULA in question, as well as the section you believe has been violated. Finally, please do not enter into an argument with the original poster - that is why we have Moderators. Spam Please do not react to spam in any way other than reporting it. Multiple reports are combined by the forum software, so there is no need to announce that you have reported the spam - in fact doing so only increases the work for the Moderator who deals with it. Interacting with this website Anyone found abusing the website is subject to harsh punishment without warning. A non-exhaustive list of potential abuses include: Automated forum registration or login. Automated posting or sending messages on the forum. Automated manipulation of polls, user reputation or other forum features. Automated creation or comments on issue tracker tickets. Automated creation or editing of wiki pages. Other abuses which are either examples of excessive bandwidth usage or automation of the site. Use common sense. If you do not have common sense, don't do anything. Do not automate the forum, wiki or issue tracker in any way at all. Scripts which automatically update AutoIt such as AutoUpdateIt are acceptable as long as they are not abused and do not generate excessive bandwidth usage.
    1 point
  20. Let me see if I understand it correctly. I think I know what you actually want. this is fairly simple Look it up in tht help file. This is how you make the listview. Yes I know it looks scary & loads of code, but you will just need a fraction of it: _GUICtrlListView_Create Hire is 1 small sample just to get you started: MAKE SHURE YOU CHECK OUT THE HELP FILE SAMPLE !!! this is just 1 half assed code. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiListView.au3> $Form1 = GUICreate('boo', 361, 270, 200, 200) ;~ Create listview $hListView = _GUICtrlListView_Create ($Form1, "", 0, 0, 260, 377) ; LEFT],[TOP],WIDTH],[HEIGHT] _GUICtrlListView_SetExtendedListViewStyle ($hListView, BitOR($LVS_AUTOARRANGE,$LVS_EX_FULLROWSELECT,$LVS_EX_DOUBLEBUFFER,$LVS_EX_SUBITEMIMAGES)) ; Add columns _GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100) _GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 150) ; Add items _GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0) _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1) _GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1) _GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState(@SW_SHOW) Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE ;~ ======================================================== ;~ This thing is responcible for click events ;~ ======================================================== Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iCode, $tNMHDR, $hWndListView $hWndListView = $hListView If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) $Index = DllStructGetData($tInfo, "Index") $subitemNR = DllStructGetData($tInfo, "SubItem") ; make sure user clicks on the listview & only the activate If $Index <> -1 Then ; col1 ITem index $item = StringSplit(_GUICtrlListView_GetItemTextString($hListView, $Index),'|') $item = $item[1] ;Col item 2 index $item2 = StringSplit(_GUICtrlListView_GetItemTextString($hListView, $subitemNR),'|') $item2= $item2[2] ConsoleWrite($item & ' ' & $item2 & @CRLF) EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY
    1 point
×
×
  • Create New...