-
Posts
1,242 -
Joined
-
Last visited
-
Days Won
42
Werty's Achievements
-
You pretty much got what we are allowed to discuss on that subject, going deeper would be against forum rules as it's not allowed to discuss keylogging or keypresses other than a few simple _IsPressed() which you already got.
-
ioa747 reacted to a post in a topic:
How to detect when Start menu opens (Win10/Win11)
-
Werty reacted to a post in a topic:
How to detect when Start menu opens (Win10/Win11)
-
How to detect when Start menu opens (Win10/Win11)
Werty replied to WildByDesign's topic in AutoIt General Help and Support
Ok that works, kinda, it doesnt trigger until I moved the mouse from the start button and into the window. -
How to detect when Start menu opens (Win10/Win11)
Werty replied to WildByDesign's topic in AutoIt General Help and Support
Same thing, atleast if I'm doing it right, could you post an example of what exactly you mean? -
How to detect when Start menu opens (Win10/Win11)
Werty replied to WildByDesign's topic in AutoIt General Help and Support
I'm on win10 and have hidden taskbar, your script triggers when I only hover over the start button, without clicking and opening it. -
[Solved] Complex UDF simplification?
Werty replied to donnyh13's topic in AutoIt General Help and Support
What about .fr and .es? -
Werty reacted to a post in a topic:
Guiscape -- A new GUI builder project!
-
Exit test() Func test() Local $sStr = "a ''' 123 ''' b" ConsoleWrite(@CRLF & StringReplace(StringLeft($sStr, StringLen($sStr)/2+1), "'''", "*'") & StringReplace(StringRight($sStr, StringLen($sStr)/2), "'''", "'*") & @CRLF & @CRLF) ; ' a *' 123 *' b ' EndFunc Not pretty but works 😛
-
f in C# means float, but you are treating them as Hex. So it's just $t =$Hue * 6 in AU3, removing the f.
-
How do you handle password in your code ?
Werty replied to cramaboule's topic in AutoIt General Help and Support
Then why not use a hardware serial like baseboard serial so the program can only be run on that machine. -
May not be related, but in AutoIt after version 3.3.12 there were things that were broken, like stuff I was able to do in 3.3.12 didnt work in later AutoIt versions, but that was concerning ImageMagick.dll COM object, dont know if that also ruined stuff like your problem. Reference post https://www.autoitscript.com/forum/topic/199781-rgb-imgs-to-cmyk-to-tiff/#comment-1433227
-
Check if an image is grayscale or not
Werty replied to Zhelkus's topic in AutoIt General Help and Support
Also... Func _RGBSaturation($r, $g, $b) Local $m = $r >= $g ? $r : $g >= $b ? $g : $b If $m = 0 Then Return 0 Return (($m - ($r <= $g ? $r : $g <= $b ? $g : $b)) / $m) * 100 EndFunc ..and then get rid of the _Max() and _Min() functions. With a little more effort the whole thing could probably be a one liner and getting rid of the RGBSaturation() func also. -
Check if an image is grayscale or not
Werty replied to Zhelkus's topic in AutoIt General Help and Support
Nice You dont have to use stride/offset or nested loop, nested loops are slow so use a single loop, the result is the same, also dont have to create that struct inside the loop all the time... Func _IsImageGrayScale_rafforzata($sInFile, $iEveryNthPixel = 1, $iTolerance = 8, $fGrayThreshold = 0.97) Local $qn=25 ;valore del quasi nero. originale 25 Local $saturazione = 10 ;valore della saturazione. Originale 10 _GDIPlus_Startup() Local $hImage = _GDIPlus_ImageLoadFromFile($sInFile) If @error Or $hImage = 0 Then _GDIPlus_Shutdown() Return SetError(1, 0, False) EndIf Local $iW = _GDIPlus_ImageGetWidth($hImage) Local $iH = _GDIPlus_ImageGetHeight($hImage) Local $hBitmap = _GDIPlus_BitmapCloneArea($hImage, 0, 0, $iW, $iH, $GDIP_PXF32ARGB) _GDIPlus_ImageDispose($hImage) Local $tBitmapData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $iW, $iH, $GDIP_ILMREAD, $GDIP_PXF32ARGB) Local $tPixels = DllStructCreate("dword[" & $iW * $iH & "];", $tBitmapData.Scan0) Local $iTotal = 0, $iGray = 0 For $Loop = 1 To $iW * $iH Step $iEveryNthPixel Local $rgb = DllStructGetData($tPixels, 1, $Loop) Local $r = BitAND($rgb, 0xFF) Local $g = BitAND(BitShift($rgb, 8), 0xFF) Local $b = BitAND(BitShift($rgb, 16), 0xFF) ; Ignora pixel quasi bianchi o quasi neri (soglie più larghe) If ($r > 230 And $g > 230 And $b > 230) Or ($r < $qn And $g < $qn And $b < $qn) Then ContinueLoop $iTotal += 1 ;~ ; Metodo 1: tolleranza RGB If (Abs($r - $g) <= $iTolerance) And (Abs($r - $b) <= $iTolerance) And (Abs($g - $b) <= $iTolerance) Then $iGray += 1 ContinueLoop EndIf ;~ ; Metodo 2: saturazione If _RGBSaturation($r, $g, $b) < $saturazione Then $iGray += 1 EndIf Next _GDIPlus_BitmapUnlockBits($hBitmap, $tBitmapData) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_Shutdown() If $iTotal = 0 Then Return True ; Solo bianco/nero Return ($iGray / $iTotal) >= $fGrayThreshold EndFunc Func _RGBSaturation($r, $g, $b) Local $max = _Max3($r, $g, $b) Local $min = _Min3($r, $g, $b) If $max = 0 Then Return 0 Return (($max - $min) / $max) * 100 EndFunc ;---------------------------------------------------------------- Func _Max3($a,$b,$c) local $m=$a if $m<$b then $m=$b if $m<$c then $m=$c Return $m EndFunc Func _Min3($a,$b,$c) local $m=$a if $m>$b then $m=$b if $m>$c then $m=$c Return $m EndFunc On a side note, instead of... Local $iStride = DllStructGetData($tBitmapData, "Stride") Local $iScan0 = DllStructGetData($tBitmapData, "Scan0") ...you can do it like this Local $iStride = $tBitmapData.Stride Local $iScan0 = $tBitmapData.Scan0 -
It´s DELETE THIS.......................PLEASE!
-
Make active transparent icon on image background
Werty replied to Davidyese's topic in AutoIt General Help and Support
I dont see $btny used anywhere, $btnx appears to be used for both X and Y positions. -
MiniMark (a minimalistic rtf editor)
Werty replied to TheAutomator's topic in AutoIt Example Scripts
It's usually called "Strike(through)", not "Stripe", and maybe put an Underline under the characters in the bmp's that can be ctrl'ed, and maybe put a lowercase "u" in front of "uLine". It looks nice, havent tried it though, cant be bothered installing fonts nor compile it as exe. Btw, please put all the files in a folder before zipping, so people dont have to create a folder in their examples scripts folder themselfes.